aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-07-01 02:51:48 +0000
committerGuy Harris <guy@alum.mit.edu>2013-07-01 02:51:48 +0000
commitf426c3cd45fe1aa1c1f52ea21d34d2273a6ea33c (patch)
treea0a9e7d10c256c7df7e3edb11c14dc1e5dea94bf /ui/gtk
parent3e0168d1c548d1734a733ff81fff7e42fde0e955 (diff)
Consistently maintain the callState member of an iax2_info_t structure
as a voip_call_state value; don't have it sometimes a voip_call_state and sometimes a frame subtype. This should squelch some complaints from newer versions of Clang about unnecessary array-bounds checks - the array-bounds checks are done on frame subtypes, where they *are* necessary (nothing prevents an untrustworthy IAX2 implementation or an untrustworthy capture file writer from putting an arbitrary value in the packets), not on voip_call_state values (where it was only necessary because the value wasn't, in that case, a voip_call_state value, it was a frame subtype cast to a voip_call_state). svn path=/trunk/; revision=50277
Diffstat (limited to 'ui/gtk')
-rw-r--r--ui/gtk/voip_calls.c47
1 files changed, 2 insertions, 45 deletions
diff --git a/ui/gtk/voip_calls.c b/ui/gtk/voip_calls.c
index d3599f7883..dcd1de2cb2 100644
--- a/ui/gtk/voip_calls.c
+++ b/ui/gtk/voip_calls.c
@@ -3763,48 +3763,6 @@ remove_tap_listener_skinny_calls(void)
/* ***************************TAP for IAX2 **********************************/
/****************************************************************************/
-/* IAX2 to tap-voip call state mapping */
-static const voip_call_state tap_iax_voip_state[] = {
- VOIP_NO_STATE,
- VOIP_CALL_SETUP, /*NEW*/
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_COMPLETED, /*HANGUP*/
- VOIP_REJECTED, /*REJECT*/
- VOIP_RINGING, /*ACCEPT*/
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_CALL_SETUP, /*DIAL*/
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE,
- VOIP_NO_STATE
-};
-
static void free_iax2_info(gpointer p) {
iax2_info_t *ii = (iax2_info_t *)p;
@@ -3857,7 +3815,7 @@ iax2_calls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
tmp_iax2info->scallno = ii->scallno;
if (tmp_iax2info->scallno == 0) tmp_iax2info->scallno = ii->dcallno;
- tmp_iax2info->callState = tap_iax_voip_state[ii->callState];
+ tmp_iax2info->callState = ii->callState;
callsinfo->npackets = 1;
@@ -3874,8 +3832,7 @@ iax2_calls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
tapinfo->callsinfo_list = g_list_prepend(tapinfo->callsinfo_list, callsinfo);
} else {
- if ((ii->callState > 0) && (ii->callState < (sizeof(tap_iax_voip_state)/sizeof(tap_iax_voip_state[0]))))
- callsinfo->call_state = tap_iax_voip_state[ii->callState];
+ callsinfo->call_state = ii->callState;
callsinfo->stop_fd = pinfo->fd;
++(callsinfo->npackets);