2012-11-26 21:19:44 +00:00
|
|
|
/*
|
2004-01-27 01:35:25 +00:00
|
|
|
* packet-iax2.c
|
|
|
|
*
|
|
|
|
* Routines for IAX2 packet disassembly
|
|
|
|
* By Alastair Maw <asterisk@almaw.com>
|
|
|
|
* Copyright 2003 Alastair Maw
|
|
|
|
*
|
|
|
|
* IAX2 is a VoIP protocol for the open source PBX Asterisk. Please see
|
2012-05-07 23:37:38 +00:00
|
|
|
* http://www.asterisk.org for more information; see RFC 5456 for the
|
|
|
|
* protocol.
|
2004-01-27 01:35:25 +00:00
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2004-01-27 01:35:25 +00:00
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2004-01-27 01:35:25 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2009-09-06 14:25:47 +00:00
|
|
|
*
|
2007-06-29 19:00:46 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2009-09-06 14:25:47 +00:00
|
|
|
*
|
2007-06-29 19:00:46 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2009-09-06 14:25:47 +00:00
|
|
|
*
|
2007-06-29 19:00:46 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 23:18:38 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2004-01-27 01:35:25 +00:00
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2004-01-27 01:35:25 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
2009-10-12 20:57:01 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
#include <glib.h>
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
#include <epan/circuit.h>
|
2004-01-27 01:35:25 +00:00
|
|
|
#include <epan/packet.h>
|
2004-06-25 06:31:47 +00:00
|
|
|
#include <epan/to_str.h>
|
2005-08-13 01:29:31 +00:00
|
|
|
#include <epan/emem.h>
|
2005-10-02 20:59:54 +00:00
|
|
|
#include <epan/reassemble.h>
|
2013-01-11 15:57:11 +00:00
|
|
|
#include <epan/expert.h>
|
2008-08-08 20:07:23 +00:00
|
|
|
#include <epan/aftypes.h>
|
2009-03-11 06:43:46 +00:00
|
|
|
#include <epan/tap.h>
|
|
|
|
#include <epan/tap-voip.h>
|
2004-01-27 01:35:25 +00:00
|
|
|
|
|
|
|
#include "packet-iax2.h"
|
2005-09-17 00:02:31 +00:00
|
|
|
#include <epan/iax2_codec_type.h>
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2009-10-12 20:57:01 +00:00
|
|
|
#define IAX2_PORT 4569
|
|
|
|
#define PROTO_TAG_IAX2 "IAX2"
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* enough to hold any address in an address_t */
|
|
|
|
#define MAX_ADDRESS 16
|
|
|
|
|
|
|
|
/* the maximum number of transfers (of each end) we can deal with per call,
|
|
|
|
* plus one */
|
|
|
|
#define IAX_MAX_TRANSFERS 2
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* #define DEBUG_HASHING */
|
2005-10-11 19:44:59 +00:00
|
|
|
/* #define DEBUG_DESEGMENT */
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Wireshark ID of the IAX2 protocol */
|
2004-01-27 01:35:25 +00:00
|
|
|
static int proto_iax2 = -1;
|
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
/* tap register id */
|
|
|
|
static int iax2_tap = -1;
|
|
|
|
|
|
|
|
/* protocol tap info */
|
2009-03-11 07:35:43 +00:00
|
|
|
static iax2_info_t ii_arr[1];
|
2009-03-11 06:43:46 +00:00
|
|
|
static iax2_info_t *iax2_info = ii_arr;
|
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* The following hf_* variables are used to hold the wireshark IDs of
|
2004-06-25 06:31:47 +00:00
|
|
|
* our header fields; they are filled out when we call
|
|
|
|
* proto_register_field_array() in proto_register_iax2()
|
|
|
|
*/
|
|
|
|
static int hf_iax2_packet_type = -1;
|
2004-01-27 01:35:25 +00:00
|
|
|
static int hf_iax2_retransmission = -1;
|
2005-08-03 20:37:28 +00:00
|
|
|
static int hf_iax2_callno = -1;
|
2004-01-27 01:35:25 +00:00
|
|
|
static int hf_iax2_scallno = -1;
|
|
|
|
static int hf_iax2_dcallno = -1;
|
|
|
|
static int hf_iax2_ts = -1;
|
|
|
|
static int hf_iax2_minits = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
static int hf_iax2_minividts = -1;
|
2005-08-03 20:37:28 +00:00
|
|
|
static int hf_iax2_absts = -1;
|
|
|
|
static int hf_iax2_lateness = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
static int hf_iax2_minividmarker = -1;
|
2004-01-27 01:35:25 +00:00
|
|
|
static int hf_iax2_oseqno = -1;
|
|
|
|
static int hf_iax2_iseqno = -1;
|
|
|
|
static int hf_iax2_type = -1;
|
|
|
|
static int hf_iax2_csub = -1;
|
2005-08-03 20:37:28 +00:00
|
|
|
static int hf_iax2_dtmf_csub = -1;
|
2004-01-27 01:35:25 +00:00
|
|
|
static int hf_iax2_cmd_csub = -1;
|
|
|
|
static int hf_iax2_iax_csub = -1;
|
|
|
|
static int hf_iax2_voice_csub = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
static int hf_iax2_voice_codec = -1;
|
|
|
|
static int hf_iax2_video_csub = -1;
|
|
|
|
static int hf_iax2_video_codec = -1;
|
|
|
|
static int hf_iax2_marker = -1;
|
2007-06-29 19:00:46 +00:00
|
|
|
static int hf_iax2_modem_csub = -1;
|
2010-05-25 05:48:36 +00:00
|
|
|
static int hf_iax2_trunk_metacmd = -1;
|
|
|
|
static int hf_iax2_trunk_cmddata = -1;
|
|
|
|
static int hf_iax2_trunk_cmddata_ts = -1;
|
|
|
|
static int hf_iax2_trunk_ts = -1;
|
|
|
|
static int hf_iax2_trunk_ncalls = -1;
|
|
|
|
static int hf_iax2_trunk_call_len = -1;
|
|
|
|
static int hf_iax2_trunk_call_scallno = -1;
|
|
|
|
static int hf_iax2_trunk_call_ts = -1;
|
2011-08-16 19:20:25 +00:00
|
|
|
static int hf_iax2_trunk_call_data = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
static int hf_iax2_cap_g723_1 = -1;
|
|
|
|
static int hf_iax2_cap_gsm = -1;
|
|
|
|
static int hf_iax2_cap_ulaw = -1;
|
|
|
|
static int hf_iax2_cap_alaw = -1;
|
2011-12-09 23:14:14 +00:00
|
|
|
static int hf_iax2_cap_g726_aal2 = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
static int hf_iax2_cap_adpcm = -1;
|
|
|
|
static int hf_iax2_cap_slinear = -1;
|
|
|
|
static int hf_iax2_cap_lpc10 = -1;
|
|
|
|
static int hf_iax2_cap_g729a = -1;
|
|
|
|
static int hf_iax2_cap_speex = -1;
|
|
|
|
static int hf_iax2_cap_ilbc = -1;
|
2011-12-09 23:14:14 +00:00
|
|
|
static int hf_iax2_cap_g726 = -1;
|
|
|
|
static int hf_iax2_cap_g722 = -1;
|
|
|
|
static int hf_iax2_cap_siren7 = -1;
|
|
|
|
static int hf_iax2_cap_siren14 = -1;
|
|
|
|
static int hf_iax2_cap_slinear16 = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
static int hf_iax2_cap_jpeg = -1;
|
|
|
|
static int hf_iax2_cap_png = -1;
|
|
|
|
static int hf_iax2_cap_h261 = -1;
|
|
|
|
static int hf_iax2_cap_h263 = -1;
|
2011-12-09 23:14:14 +00:00
|
|
|
static int hf_iax2_cap_h263_plus = -1;
|
|
|
|
static int hf_iax2_cap_h264 = -1;
|
|
|
|
static int hf_iax2_cap_mpeg4 = -1;
|
2004-02-13 19:15:38 +00:00
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
static int hf_iax2_fragments = -1;
|
|
|
|
static int hf_iax2_fragment = -1;
|
|
|
|
static int hf_iax2_fragment_overlap = -1;
|
|
|
|
static int hf_iax2_fragment_overlap_conflict = -1;
|
|
|
|
static int hf_iax2_fragment_multiple_tails = -1;
|
|
|
|
static int hf_iax2_fragment_too_long_fragment = -1;
|
|
|
|
static int hf_iax2_fragment_error = -1;
|
2011-01-30 21:01:07 +00:00
|
|
|
static int hf_iax2_fragment_count = -1;
|
2005-10-02 20:59:54 +00:00
|
|
|
static int hf_iax2_reassembled_in = -1;
|
2010-02-02 16:01:52 +00:00
|
|
|
static int hf_iax2_reassembled_length = -1;
|
2005-10-02 20:59:54 +00:00
|
|
|
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* hf_iax2_ies is an array of header fields, one per potential Information
|
|
|
|
* Element. It's done this way (rather than having separate variables for each
|
|
|
|
* IE) to make the dissection of information elements clearer and more
|
2011-08-16 19:20:25 +00:00
|
|
|
* orthogonal.
|
2005-08-03 20:37:28 +00:00
|
|
|
*
|
|
|
|
* To add the ability to dissect a new information element, just add an
|
|
|
|
* appropriate entry to hf[] in proto_register_iax2(); dissect_ies() will then
|
|
|
|
* pick it up automatically.
|
|
|
|
*/
|
2011-02-19 00:05:12 +00:00
|
|
|
#define NUM_HF_IAX2_IES 256
|
|
|
|
static int hf_iax2_ies[NUM_HF_IAX2_IES];
|
2005-08-03 20:37:28 +00:00
|
|
|
static int hf_iax2_ie_datetime = -1;
|
2004-02-13 19:15:38 +00:00
|
|
|
static int hf_IAX_IE_APPARENTADDR_SINFAMILY = -1;
|
|
|
|
static int hf_IAX_IE_APPARENTADDR_SINPORT = -1;
|
|
|
|
static int hf_IAX_IE_APPARENTADDR_SINADDR = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
static int hf_IAX_IE_UNKNOWN_BYTE = -1;
|
|
|
|
static int hf_IAX_IE_UNKNOWN_I16 = -1;
|
|
|
|
static int hf_IAX_IE_UNKNOWN_I32 = -1;
|
|
|
|
static int hf_IAX_IE_UNKNOWN_BYTES = -1;
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* These are the ids of the subtrees that we may be creating */
|
|
|
|
static gint ett_iax2 = -1;
|
|
|
|
static gint ett_iax2_full_mini_subtree = -1;
|
2012-11-26 21:19:44 +00:00
|
|
|
static gint ett_iax2_type = -1; /* Frame-type specific subtree */
|
|
|
|
static gint ett_iax2_ie = -1; /* single IE */
|
|
|
|
static gint ett_iax2_codecs = -1; /* capabilities IE */
|
2004-06-25 06:31:47 +00:00
|
|
|
static gint ett_iax2_ies_apparent_addr = -1; /* apparent address IE */
|
2005-10-02 20:59:54 +00:00
|
|
|
static gint ett_iax2_fragment = -1;
|
|
|
|
static gint ett_iax2_fragments = -1;
|
2010-05-25 05:48:36 +00:00
|
|
|
static gint ett_iax2_trunk_cmddata = -1;
|
|
|
|
static gint ett_iax2_trunk_call = -1;
|
2005-10-02 20:59:54 +00:00
|
|
|
|
|
|
|
static const fragment_items iax2_fragment_items = {
|
|
|
|
&ett_iax2_fragment,
|
|
|
|
&ett_iax2_fragments,
|
|
|
|
&hf_iax2_fragments,
|
|
|
|
&hf_iax2_fragment,
|
|
|
|
&hf_iax2_fragment_overlap,
|
|
|
|
&hf_iax2_fragment_overlap_conflict,
|
|
|
|
&hf_iax2_fragment_multiple_tails,
|
|
|
|
&hf_iax2_fragment_too_long_fragment,
|
|
|
|
&hf_iax2_fragment_error,
|
2011-01-30 21:01:07 +00:00
|
|
|
&hf_iax2_fragment_count,
|
2005-10-02 20:59:54 +00:00
|
|
|
&hf_iax2_reassembled_in,
|
2010-02-02 16:01:52 +00:00
|
|
|
&hf_iax2_reassembled_length,
|
2012-09-07 02:09:59 +00:00
|
|
|
/* Reassembled data field */
|
|
|
|
NULL,
|
2005-10-02 20:59:54 +00:00
|
|
|
"iax2 fragments"
|
|
|
|
};
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
static dissector_handle_t data_handle;
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* data-call subdissectors, AST_DATAFORMAT_* */
|
|
|
|
static dissector_table_t iax2_dataformat_dissector_table;
|
|
|
|
/* voice/video call subdissectors, AST_FORMAT_* */
|
|
|
|
static dissector_table_t iax2_codec_dissector_table;
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
/* IAX2 Meta trunk packet Command data flags */
|
|
|
|
#define IAX2_TRUNK_TS 1
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* IAX2 Full-frame types */
|
2004-01-27 01:35:25 +00:00
|
|
|
static const value_string iax_frame_types[] = {
|
2012-11-26 21:19:44 +00:00
|
|
|
{0, "(0?)"},
|
|
|
|
{AST_FRAME_DTMF_END, "DTMF End"},
|
|
|
|
{AST_FRAME_VOICE, "Voice"},
|
|
|
|
{AST_FRAME_VIDEO, "Video"},
|
|
|
|
{AST_FRAME_CONTROL, "Control"},
|
|
|
|
{AST_FRAME_NULL, "NULL"},
|
|
|
|
{AST_FRAME_IAX, "IAX"},
|
|
|
|
{AST_FRAME_TEXT, "Text"},
|
|
|
|
{AST_FRAME_IMAGE, "Image"},
|
|
|
|
{AST_FRAME_HTML, "HTML"},
|
|
|
|
{AST_FRAME_CNG, "Comfort Noise"},
|
|
|
|
{AST_FRAME_MODEM, "Modem"},
|
2007-06-29 19:00:46 +00:00
|
|
|
{AST_FRAME_DTMF_BEGIN, "DTMF Begin"},
|
2012-11-26 21:19:44 +00:00
|
|
|
{0, NULL}
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
2012-11-26 21:19:44 +00:00
|
|
|
static value_string_ext iax_frame_types_ext = VALUE_STRING_EXT_INIT(iax_frame_types);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* Subclasses for IAX packets */
|
2004-01-27 01:35:25 +00:00
|
|
|
static const value_string iax_iax_subclasses[] = {
|
2012-11-26 21:19:44 +00:00
|
|
|
{ 0, "(0?)"},
|
|
|
|
{ 1, "NEW"},
|
|
|
|
{ 2, "PING"},
|
|
|
|
{ 3, "PONG"},
|
|
|
|
{ 4, "ACK"},
|
|
|
|
{ 5, "HANGUP"},
|
|
|
|
{ 6, "REJECT"},
|
|
|
|
{ 7, "ACCEPT"},
|
|
|
|
{ 8, "AUTHREQ"},
|
|
|
|
{ 9, "AUTHREP"},
|
2004-01-27 01:35:25 +00:00
|
|
|
{10, "INVAL"},
|
|
|
|
{11, "LAGRQ"},
|
|
|
|
{12, "LAGRP"},
|
|
|
|
{13, "REGREQ"},
|
|
|
|
{14, "REGAUTH"},
|
|
|
|
{15, "REGACK"},
|
|
|
|
{16, "REGREJ"},
|
|
|
|
{17, "REGREL"},
|
|
|
|
{18, "VNAK"},
|
|
|
|
{19, "DPREQ"},
|
|
|
|
{20, "DPREP"},
|
|
|
|
{21, "DIAL"},
|
|
|
|
{22, "TXREQ"},
|
|
|
|
{23, "TXCNT"},
|
|
|
|
{24, "TXACC"},
|
|
|
|
{25, "TXREADY"},
|
|
|
|
{26, "TXREL"},
|
|
|
|
{27, "TXREJ"},
|
|
|
|
{28, "QUELCH"},
|
|
|
|
{29, "UNQULCH"},
|
|
|
|
{30, "POKE"},
|
|
|
|
{31, "PAGE"},
|
|
|
|
{32, "MWI"},
|
|
|
|
{33, "UNSUPPORTED"},
|
2004-06-25 06:31:47 +00:00
|
|
|
{34, "TRANSFER"},
|
2005-04-04 05:10:45 +00:00
|
|
|
{35, "PROVISION"},
|
|
|
|
{36, "FWDOWNL"},
|
|
|
|
{37, "FWDATA"},
|
2011-12-09 23:14:14 +00:00
|
|
|
{38, "TXMEDIA"},
|
|
|
|
{39, "RTKEY"},
|
|
|
|
{40, "CALLTOKEN"},
|
2012-11-26 21:19:44 +00:00
|
|
|
{0, NULL}
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
2012-11-26 21:19:44 +00:00
|
|
|
static value_string_ext iax_iax_subclasses_ext = VALUE_STRING_EXT_INIT(iax_iax_subclasses);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* Subclasses for Control packets */
|
2004-01-27 01:35:25 +00:00
|
|
|
static const value_string iax_cmd_subclasses[] = {
|
|
|
|
{0, "(0?)"},
|
|
|
|
{1, "HANGUP"},
|
|
|
|
{2, "RING"},
|
|
|
|
{3, "RINGING"},
|
|
|
|
{4, "ANSWER"},
|
|
|
|
{5, "BUSY"},
|
|
|
|
{6, "TKOFFHK"},
|
2004-06-25 06:31:47 +00:00
|
|
|
{7, "OFFHOOK"},
|
|
|
|
{0xFF, "stop sounds"}, /* sent by app_dial, and not much else */
|
2012-11-26 21:19:44 +00:00
|
|
|
{0, NULL}
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
2012-11-26 21:19:44 +00:00
|
|
|
static value_string_ext iax_cmd_subclasses_ext = VALUE_STRING_EXT_INIT(iax_cmd_subclasses);
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
/* IAX2 to tap-voip call state mapping */
|
|
|
|
static const voip_call_state tap_cmd_voip_state[] = {
|
2009-10-12 20:57:01 +00:00
|
|
|
VOIP_NO_STATE,
|
|
|
|
VOIP_COMPLETED, /*HANGUP*/
|
|
|
|
VOIP_RINGING, /*RING*/
|
|
|
|
VOIP_RINGING, /*RINGING*/
|
|
|
|
VOIP_IN_CALL, /*ANSWER*/
|
|
|
|
VOIP_REJECTED, /*BUSY*/
|
|
|
|
VOIP_UNKNOWN, /*TKOFFHK*/
|
|
|
|
VOIP_UNKNOWN /*OFFHOOK*/
|
2009-03-11 06:43:46 +00:00
|
|
|
};
|
2011-05-04 19:32:35 +00:00
|
|
|
#define NUM_TAP_CMD_VOIP_STATES array_length(tap_cmd_voip_state)
|
2009-03-11 06:43:46 +00:00
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* Subclasses for Modem packets */
|
2007-06-29 19:00:46 +00:00
|
|
|
static const value_string iax_modem_subclasses[] = {
|
|
|
|
{0, "(0?)"},
|
|
|
|
{1, "T.38"},
|
|
|
|
{2, "V.150"},
|
2012-11-26 21:19:44 +00:00
|
|
|
{0, NULL}
|
2007-06-29 19:00:46 +00:00
|
|
|
};
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* Information elements */
|
2004-01-27 01:35:25 +00:00
|
|
|
static const value_string iax_ies_type[] = {
|
2012-11-26 21:19:44 +00:00
|
|
|
{IAX_IE_CALLED_NUMBER, "Number/extension being called"},
|
|
|
|
{IAX_IE_CALLING_NUMBER, "Calling number"},
|
|
|
|
{IAX_IE_CALLING_ANI, "Calling number ANI for billing"},
|
|
|
|
{IAX_IE_CALLING_NAME, "Name of caller"},
|
|
|
|
{IAX_IE_CALLED_CONTEXT, "Context for number"},
|
|
|
|
{IAX_IE_USERNAME, "Username (peer or user) for authentication"},
|
|
|
|
{IAX_IE_PASSWORD, "Password for authentication"},
|
|
|
|
{IAX_IE_CAPABILITY, "Actual codec capability"},
|
|
|
|
{IAX_IE_FORMAT, "Desired codec format"},
|
|
|
|
{IAX_IE_LANGUAGE, "Desired language"},
|
|
|
|
{IAX_IE_VERSION, "Protocol version"},
|
|
|
|
{IAX_IE_ADSICPE, "CPE ADSI capability"},
|
|
|
|
{IAX_IE_DNID, "Originally dialed DNID"},
|
|
|
|
{IAX_IE_AUTHMETHODS, "Authentication method(s)"},
|
|
|
|
{IAX_IE_CHALLENGE, "Challenge data for MD5/RSA"},
|
|
|
|
{IAX_IE_MD5_RESULT, "MD5 challenge result"},
|
|
|
|
{IAX_IE_RSA_RESULT, "RSA challenge result"},
|
|
|
|
{IAX_IE_APPARENT_ADDR, "Apparent address of peer"},
|
|
|
|
{IAX_IE_REFRESH, "When to refresh registration"},
|
|
|
|
{IAX_IE_DPSTATUS, "Dialplan status"},
|
|
|
|
{IAX_IE_CALLNO, "Call number of peer"},
|
|
|
|
{IAX_IE_CAUSE, "Cause"},
|
|
|
|
{IAX_IE_IAX_UNKNOWN, "Unknown IAX command"},
|
|
|
|
{IAX_IE_MSGCOUNT, "How many messages waiting"},
|
|
|
|
{IAX_IE_AUTOANSWER, "Request auto-answering"},
|
|
|
|
{IAX_IE_MUSICONHOLD, "Request musiconhold with QUELCH"},
|
|
|
|
{IAX_IE_TRANSFERID, "Transfer Request Identifier"},
|
|
|
|
{IAX_IE_RDNIS, "Referring DNIS"},
|
|
|
|
{IAX_IE_PROVISIONING, "Provisioning info"},
|
|
|
|
{IAX_IE_AESPROVISIONING, "AES Provisioning info"},
|
|
|
|
{IAX_IE_DATETIME, "Date/Time"},
|
|
|
|
{IAX_IE_DEVICETYPE, "Device type"},
|
|
|
|
{IAX_IE_SERVICEIDENT, "Service Identifier"},
|
|
|
|
{IAX_IE_FIRMWAREVER, "Firmware revision"},
|
|
|
|
{IAX_IE_FWBLOCKDESC, "Firmware block description"},
|
|
|
|
{IAX_IE_FWBLOCKDATA, "Firmware block of data"},
|
|
|
|
{IAX_IE_PROVVER, "Provisioning version"},
|
|
|
|
{IAX_IE_CALLINGPRES, "Calling presentation"},
|
|
|
|
{IAX_IE_CALLINGTON, "Calling type of number"},
|
|
|
|
{IAX_IE_CALLINGTNS, "Calling transit network select"},
|
|
|
|
{IAX_IE_SAMPLINGRATE, "Supported sampling rates"},
|
|
|
|
{IAX_IE_CAUSECODE, "Hangup cause"},
|
|
|
|
{IAX_IE_ENCRYPTION, "Encryption format"},
|
|
|
|
{IAX_IE_ENCKEY, "Raw encryption key"},
|
|
|
|
{IAX_IE_CODEC_PREFS, "Codec preferences"},
|
|
|
|
{IAX_IE_RR_JITTER, "Received jitter"},
|
|
|
|
{IAX_IE_RR_LOSS, "Received loss"},
|
|
|
|
{IAX_IE_RR_PKTS, "Received frames"},
|
|
|
|
{IAX_IE_RR_DELAY, "Max playout delay in ms for received frames"},
|
|
|
|
{IAX_IE_RR_DROPPED, "Dropped frames"},
|
|
|
|
{IAX_IE_RR_OOO, "Frames received out of order"},
|
|
|
|
{IAX_IE_VARIABLE, "IAX2 variable"},
|
|
|
|
{IAX_IE_OSPTOKEN, "OSP Token"},
|
|
|
|
{IAX_IE_CALLTOKEN, "Call Token"},
|
|
|
|
{IAX_IE_CAPABILITY2, "64-bit codec capability"},
|
|
|
|
{IAX_IE_FORMAT2, "64-bit codec format"},
|
|
|
|
{IAX_IE_DATAFORMAT, "Data call format"},
|
|
|
|
{0, NULL}
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
2012-11-26 21:19:44 +00:00
|
|
|
static value_string_ext iax_ies_type_ext = VALUE_STRING_EXT_INIT(iax_ies_type);
|
2004-01-27 01:35:25 +00:00
|
|
|
|
|
|
|
static const value_string codec_types[] = {
|
2012-11-26 21:19:44 +00:00
|
|
|
{AST_FORMAT_G723_1, "G.723.1 compression"},
|
|
|
|
{AST_FORMAT_GSM, "GSM compression"},
|
|
|
|
{AST_FORMAT_ULAW, "Raw mu-law data (G.711)"},
|
|
|
|
{AST_FORMAT_ALAW, "Raw A-law data (G.711)"},
|
|
|
|
{AST_FORMAT_G726_AAL2, "ADPCM (G.726, 32kbps)"},
|
|
|
|
{AST_FORMAT_ADPCM, "ADPCM (IMA)"},
|
|
|
|
{AST_FORMAT_SLINEAR, "Raw 16-bit Signed Linear (8000 Hz) PCM"},
|
|
|
|
{AST_FORMAT_LPC10, "LPC10, 180 samples/frame"},
|
|
|
|
{AST_FORMAT_G729A, "G.729a Audio"},
|
|
|
|
{AST_FORMAT_SPEEX, "SpeeX Free Compression"},
|
|
|
|
{AST_FORMAT_ILBC, "iLBC Free Compression"},
|
|
|
|
{AST_FORMAT_G726, "G.726 compression"},
|
|
|
|
{AST_FORMAT_G722, "G.722 wideband"},
|
|
|
|
{AST_FORMAT_SIREN7, "G.722.1 32k wideband (aka Siren7)"},
|
|
|
|
{AST_FORMAT_SIREN14, "G.722.1 Annex C 48k wideband (aka Siren14)"},
|
|
|
|
{AST_FORMAT_SLINEAR16, "Raw 16kHz signed linear audio"},
|
|
|
|
{AST_FORMAT_JPEG, "JPEG Images"},
|
|
|
|
{AST_FORMAT_PNG, "PNG Images"},
|
|
|
|
{AST_FORMAT_H261, "H.261 Video"},
|
|
|
|
{AST_FORMAT_H263, "H.263 Video"},
|
|
|
|
{AST_FORMAT_H263_PLUS, "H.263+ Video"},
|
|
|
|
{AST_FORMAT_H264, "H.264 Video"},
|
|
|
|
{AST_FORMAT_MP4_VIDEO, "MPEG4 Video"},
|
|
|
|
{0, NULL}
|
2004-06-25 06:31:47 +00:00
|
|
|
};
|
2012-11-26 21:19:44 +00:00
|
|
|
static value_string_ext codec_types_ext = VALUE_STRING_EXT_INIT(codec_types);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
static const value_string iax_dataformats[] = {
|
2012-11-26 21:19:44 +00:00
|
|
|
{AST_DATAFORMAT_NULL, "N/A (analogue call?)"},
|
|
|
|
{AST_DATAFORMAT_V110, "ITU-T V.110 rate adaption"},
|
|
|
|
{AST_DATAFORMAT_H223_H245, "ITU-T H.223/H.245"},
|
|
|
|
{0, NULL}
|
2004-06-25 06:31:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const value_string iax_packet_types[] = {
|
2009-10-12 20:57:01 +00:00
|
|
|
{IAX2_FULL_PACKET, "Full packet"},
|
2004-06-25 06:31:47 +00:00
|
|
|
{IAX2_MINI_VOICE_PACKET, "Mini voice packet"},
|
|
|
|
{IAX2_MINI_VIDEO_PACKET, "Mini video packet"},
|
2010-05-25 05:48:36 +00:00
|
|
|
{IAX2_TRUNK_PACKET, "Trunk packet"},
|
2012-11-26 21:19:44 +00:00
|
|
|
{0, NULL}
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-04-04 05:10:45 +00:00
|
|
|
static const value_string iax_causecodes[] = {
|
2012-11-26 21:19:44 +00:00
|
|
|
{AST_CAUSE_UNALLOCATED, "Unallocated"},
|
|
|
|
{AST_CAUSE_NO_ROUTE_TRANSIT_NET, "No route transit net"},
|
|
|
|
{AST_CAUSE_NO_ROUTE_DESTINATION, "No route to destination"},
|
|
|
|
{AST_CAUSE_MISDIALLED_TRUNK_PREFIX, "Misdialled trunk prefix"},
|
|
|
|
{AST_CAUSE_CHANNEL_UNACCEPTABLE, "Channel unacceptable"},
|
|
|
|
{AST_CAUSE_CALL_AWARDED_DELIVERED, "Call awarded delivered"},
|
|
|
|
{AST_CAUSE_PRE_EMPTED, "Preempted"},
|
|
|
|
{AST_CAUSE_NUMBER_PORTED_NOT_HERE, "Number ported not here"},
|
|
|
|
{AST_CAUSE_NORMAL_CLEARING, "Normal clearing"},
|
|
|
|
{AST_CAUSE_USER_BUSY, "User busy"},
|
|
|
|
{AST_CAUSE_NO_USER_RESPONSE, "No user response"},
|
|
|
|
{AST_CAUSE_NO_ANSWER, "No answer"},
|
|
|
|
{AST_CAUSE_SUBSCRIBER_ABSENT, "Subscriber absent"},
|
|
|
|
{AST_CAUSE_CALL_REJECTED, "Call rejected"},
|
|
|
|
{AST_CAUSE_NUMBER_CHANGED, "Number changed"},
|
|
|
|
{AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION, "Redirected to new destination"},
|
|
|
|
{AST_CAUSE_ANSWERED_ELSEWHERE, "Answered elsewhere"},
|
|
|
|
{AST_CAUSE_DESTINATION_OUT_OF_ORDER, "Destination out of order"},
|
|
|
|
{AST_CAUSE_INVALID_NUMBER_FORMAT, "Invalid number format"},
|
|
|
|
{AST_CAUSE_FACILITY_REJECTED, "Facility rejected"},
|
|
|
|
{AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY, "Response to status inquiry"},
|
|
|
|
{AST_CAUSE_NORMAL_UNSPECIFIED, "Normal unspecified"},
|
|
|
|
{AST_CAUSE_NORMAL_CIRCUIT_CONGESTION, "Normal circuit congestion"},
|
|
|
|
{AST_CAUSE_NETWORK_OUT_OF_ORDER, "Network out of order"},
|
|
|
|
{AST_CAUSE_NORMAL_TEMPORARY_FAILURE, "Normal temporary failure"},
|
|
|
|
{AST_CAUSE_SWITCH_CONGESTION, "Switch congestion"},
|
|
|
|
{AST_CAUSE_ACCESS_INFO_DISCARDED, "Access info discarded"},
|
|
|
|
{AST_CAUSE_REQUESTED_CHAN_UNAVAIL, "Requested channel unavailable"},
|
|
|
|
{AST_CAUSE_FACILITY_NOT_SUBSCRIBED, "Facility not subscribed"},
|
|
|
|
{AST_CAUSE_OUTGOING_CALL_BARRED, "Outgoing call barred"},
|
|
|
|
{AST_CAUSE_INCOMING_CALL_BARRED, "Incoming call barred"},
|
|
|
|
{AST_CAUSE_BEARERCAPABILITY_NOTAUTH, "Bearer capability not authorized"},
|
|
|
|
{AST_CAUSE_BEARERCAPABILITY_NOTAVAIL, "Bearer capability not available"},
|
|
|
|
{AST_CAUSE_BEARERCAPABILITY_NOTIMPL, "Bearer capability not implemented"},
|
|
|
|
{AST_CAUSE_CHAN_NOT_IMPLEMENTED, "Channel not implemented"},
|
|
|
|
{AST_CAUSE_FACILITY_NOT_IMPLEMENTED, "Facility not implemented"},
|
|
|
|
{AST_CAUSE_INVALID_CALL_REFERENCE, "Invalid call reference"},
|
|
|
|
{AST_CAUSE_INCOMPATIBLE_DESTINATION, "Incompatible destination"},
|
|
|
|
{AST_CAUSE_INVALID_MSG_UNSPECIFIED, "Invalid message unspecified"},
|
|
|
|
{AST_CAUSE_MANDATORY_IE_MISSING, "Mandatory IE missing"},
|
|
|
|
{AST_CAUSE_MESSAGE_TYPE_NONEXIST, "Message type nonexistent"},
|
|
|
|
{AST_CAUSE_WRONG_MESSAGE, "Wrong message"},
|
|
|
|
{AST_CAUSE_IE_NONEXIST, "IE nonexistent"},
|
|
|
|
{AST_CAUSE_INVALID_IE_CONTENTS, "Invalid IE contents"},
|
|
|
|
{AST_CAUSE_WRONG_CALL_STATE, "Wrong call state"},
|
|
|
|
{AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE, "Recovery on timer expire"},
|
|
|
|
{AST_CAUSE_MANDATORY_IE_LENGTH_ERROR, "Mandatory IE length error"},
|
|
|
|
{AST_CAUSE_PROTOCOL_ERROR, "Protocol error"},
|
|
|
|
{AST_CAUSE_INTERWORKING, "Interworking"},
|
2005-04-04 05:10:45 +00:00
|
|
|
{0, NULL}
|
|
|
|
};
|
2012-11-26 21:19:44 +00:00
|
|
|
static value_string_ext iax_causecodes_ext = VALUE_STRING_EXT_INIT(iax_causecodes);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
|
|
|
|
/* In order to track IAX calls, we have a hash table which maps
|
|
|
|
* {addr,port type,port,call} to a unique circuit id.
|
|
|
|
*
|
|
|
|
* Each call has two such circuits associated with it (a forward and a
|
|
|
|
* reverse circuit, where 'forward' is defined as the direction the NEW
|
|
|
|
* packet went in), and we maintain an iax_call_data structure for each
|
|
|
|
* call, attached to both circuits with circuit_add_proto_data.
|
|
|
|
*
|
|
|
|
* Because {addr,port type,port,call} quadruplets can be reused
|
|
|
|
* (Asterisk reuses call numbers), circuit ids aren't unique to
|
|
|
|
* individual calls and we treat NEW packets somewhat specially. When we
|
|
|
|
* get such a packet, we see if there are any calls with a matching
|
|
|
|
* circuit id, and make sure that its circuits are marked as ended
|
|
|
|
* before that packet.
|
|
|
|
*
|
|
|
|
* A second complication is that we only know one quadruplet at the time
|
|
|
|
* the NEW packet is processed: there is therefore cunningness in
|
|
|
|
* iax_lookup_circuit_details() to look for replies to NEW packets and
|
|
|
|
* create the reverse circuit.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* start with a hash of {addr,port type,port,call}->{id} */
|
|
|
|
|
|
|
|
typedef struct {
|
2012-11-26 21:19:44 +00:00
|
|
|
address addr;
|
2004-06-25 06:31:47 +00:00
|
|
|
port_type ptype;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 port;
|
|
|
|
guint32 callno;
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
/* this is where addr->data points to. it's put in here for easy freeing */
|
|
|
|
guint8 address_data[MAX_ADDRESS];
|
2004-06-25 06:31:47 +00:00
|
|
|
} iax_circuit_key;
|
|
|
|
|
|
|
|
/* tables */
|
2012-08-27 16:17:38 +00:00
|
|
|
static GHashTable *iax_fid_table = NULL;
|
2013-03-22 23:59:54 +00:00
|
|
|
static reassembly_table iax_reassembly_table;
|
2012-08-27 16:17:38 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
static GHashTable *iax_circuit_hashtab = NULL;
|
|
|
|
static guint circuitcount = 0;
|
|
|
|
|
|
|
|
/* the number of keys and values to reserve space for in each memory chunk.
|
|
|
|
We assume we won't be tracking many calls at once so this is quite low.
|
|
|
|
*/
|
|
|
|
#define IAX_INIT_PACKET_COUNT 10
|
|
|
|
|
|
|
|
#ifdef DEBUG_HASHING
|
|
|
|
static gchar *key_to_str( const iax_circuit_key *key )
|
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
static int i = 0;
|
2004-06-25 06:31:47 +00:00
|
|
|
static gchar *strp, str[3][80];
|
|
|
|
|
|
|
|
i++;
|
2012-11-26 21:19:44 +00:00
|
|
|
if (i >= 3) {
|
|
|
|
i = 0;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
2012-11-26 21:19:44 +00:00
|
|
|
strp = str[i];
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2009-09-06 14:25:47 +00:00
|
|
|
/* why doesn't ep_address_to_str take a const pointer?
|
2004-06-25 06:31:47 +00:00
|
|
|
cast the warnings into oblivion. */
|
|
|
|
|
2005-08-18 19:31:15 +00:00
|
|
|
/* XXX - is this a case for ep_alloc? */
|
|
|
|
g_snprintf(strp, 80, "{%s:%i,%i}",
|
2009-10-12 20:57:01 +00:00
|
|
|
ep_address_to_str((address *)&key->addr),
|
|
|
|
key->port,
|
|
|
|
key->callno);
|
2004-06-25 06:31:47 +00:00
|
|
|
return strp;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Hash Functions */
|
|
|
|
static gint iax_circuit_equal(gconstpointer v, gconstpointer w)
|
|
|
|
{
|
|
|
|
const iax_circuit_key *v1 = (const iax_circuit_key *)v;
|
|
|
|
const iax_circuit_key *v2 = (const iax_circuit_key *)w;
|
|
|
|
gint result;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
result = (ADDRESSES_EQUAL(&(v1->addr), &(v2->addr)) &&
|
|
|
|
v1->ptype == v2->ptype &&
|
|
|
|
v1->port == v2->port &&
|
|
|
|
v1->callno== v2->callno);
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("+++ Comparing for equality: %s, %s: %u", key_to_str(v1), key_to_str(v2), result);
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
return result;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint iax_circuit_hash(gconstpointer v)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
|
|
|
const iax_circuit_key *key = (const iax_circuit_key *)v;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint hash_val;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
hash_val = 0;
|
2007-04-26 04:30:41 +00:00
|
|
|
ADD_ADDRESS_TO_HASH(hash_val, &key->addr);
|
2004-06-25 06:31:47 +00:00
|
|
|
hash_val += (guint)(key->ptype);
|
|
|
|
hash_val += (guint)(key->port);
|
|
|
|
hash_val += (guint)(key->callno);
|
|
|
|
|
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("+++ Hashing key: %s, result %#x", key_to_str(key), hash_val);
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
return (guint)hash_val;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* Find, or create, a circuit for the given
|
|
|
|
{address,porttype,port,call} quadruplet
|
|
|
|
*/
|
2008-06-28 21:09:57 +00:00
|
|
|
static guint iax_circuit_lookup(const address *address_p,
|
2009-10-12 20:57:01 +00:00
|
|
|
port_type ptype,
|
|
|
|
guint32 port,
|
|
|
|
guint32 callno)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_circuit_key key;
|
|
|
|
guint32 *circuit_id_p;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
key.addr = *address_p;
|
|
|
|
key.ptype = ptype;
|
|
|
|
key.port = port;
|
2004-06-25 06:31:47 +00:00
|
|
|
key.callno = callno;
|
|
|
|
|
2013-03-18 21:16:23 +00:00
|
|
|
circuit_id_p = (guint32 *)g_hash_table_lookup(iax_circuit_hashtab, &key);
|
2012-11-26 21:19:44 +00:00
|
|
|
if (! circuit_id_p) {
|
2004-06-25 06:31:47 +00:00
|
|
|
iax_circuit_key *new_key;
|
|
|
|
|
2013-03-18 21:16:23 +00:00
|
|
|
new_key = se_new(iax_circuit_key);
|
2008-06-28 21:09:57 +00:00
|
|
|
new_key->addr.type = address_p->type;
|
2012-11-26 21:19:44 +00:00
|
|
|
new_key->addr.len = MIN(address_p->len, MAX_ADDRESS);
|
2005-08-03 20:37:28 +00:00
|
|
|
new_key->addr.data = new_key->address_data;
|
2012-11-26 21:19:44 +00:00
|
|
|
memcpy(new_key->address_data, address_p->data, new_key->addr.len);
|
|
|
|
new_key->ptype = ptype;
|
|
|
|
new_key->port = port;
|
|
|
|
new_key->callno = callno;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2013-03-18 21:16:23 +00:00
|
|
|
circuit_id_p = (guint32 *)se_new(iax_circuit_key);
|
2004-06-25 06:31:47 +00:00
|
|
|
*circuit_id_p = ++circuitcount;
|
|
|
|
|
|
|
|
g_hash_table_insert(iax_circuit_hashtab, new_key, circuit_id_p);
|
|
|
|
|
|
|
|
#ifdef DEBUG_HASHING
|
2005-10-11 19:44:59 +00:00
|
|
|
g_debug("Created new circuit id %u for node %s", *circuit_id_p, key_to_str(new_key));
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
return *circuit_id_p;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
typedef struct {
|
2005-10-11 19:44:59 +00:00
|
|
|
guint32 current_frag_id; /* invalid unless current_frag_bytes > 0 */
|
2005-10-02 20:59:54 +00:00
|
|
|
guint32 current_frag_bytes;
|
2005-10-11 19:44:59 +00:00
|
|
|
guint32 current_frag_minlen;
|
2005-10-02 20:59:54 +00:00
|
|
|
} iax_call_dirdata;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* This is our per-call data structure, which is attached to both the
|
|
|
|
* forward and reverse circuits.
|
|
|
|
*/
|
|
|
|
typedef struct iax_call_data {
|
|
|
|
/* For this data, src and dst are relative to the original direction under
|
|
|
|
which this call is stored. Obviously if the reversed flag is set true by
|
|
|
|
iax_find_call, src and dst are reversed relative to the direction the
|
|
|
|
actual source and destination of the data.
|
|
|
|
|
|
|
|
if the codec changes mid-call, we update it here; because we store a codec
|
|
|
|
number with each packet too, we handle going back to earlier packets
|
|
|
|
without problem.
|
|
|
|
*/
|
|
|
|
|
|
|
|
iax_dataformat_t dataformat;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 src_codec, dst_codec;
|
|
|
|
guint32 src_vformat, dst_vformat;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* when a transfer takes place, we'll get a new circuit id; we assume that we
|
|
|
|
don't try to transfer more than IAX_MAX_TRANSFERS times in a call */
|
|
|
|
guint forward_circuit_ids[IAX_MAX_TRANSFERS];
|
|
|
|
guint reverse_circuit_ids[IAX_MAX_TRANSFERS];
|
|
|
|
guint n_forward_circuit_ids;
|
|
|
|
guint n_reverse_circuit_ids;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* this is the subdissector for the call */
|
|
|
|
dissector_handle_t subdissector;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* the absolute start time of the call */
|
|
|
|
nstime_t start_time;
|
2005-10-02 20:59:54 +00:00
|
|
|
|
|
|
|
iax_call_dirdata dirdata[2];
|
2005-08-03 20:37:28 +00:00
|
|
|
} iax_call_data;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
static void iax_init_hash( void )
|
|
|
|
{
|
|
|
|
if (iax_circuit_hashtab)
|
|
|
|
g_hash_table_destroy(iax_circuit_hashtab);
|
|
|
|
iax_circuit_hashtab = g_hash_table_new(iax_circuit_hash, iax_circuit_equal);
|
|
|
|
circuitcount = 0;
|
2012-08-27 16:17:38 +00:00
|
|
|
|
|
|
|
if (iax_fid_table)
|
|
|
|
g_hash_table_destroy(iax_fid_table);
|
|
|
|
iax_fid_table = g_hash_table_new(g_direct_hash, g_direct_equal);
|
|
|
|
|
2013-03-22 23:59:54 +00:00
|
|
|
reassembly_table_init(&iax_reassembly_table,
|
|
|
|
&addresses_reassembly_table_functions);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
/* creates a new CT_IAX2 circuit with a specified circuit id for a call
|
|
|
|
*
|
|
|
|
* typically a call has up to three associated circuits: an original source, an
|
|
|
|
* original destination, and the result of a transfer.
|
|
|
|
*
|
|
|
|
* For each endpoint, a CT_IAX2 circuit is created and added to the call_data
|
|
|
|
* by this function
|
|
|
|
*
|
|
|
|
* 'reversed' should be true if this end is the one which would have _received_
|
|
|
|
* the NEW packet, or it is an endpoint to which the 'destination' is being
|
|
|
|
* transferred.
|
|
|
|
*
|
|
|
|
*/
|
2013-01-11 15:57:11 +00:00
|
|
|
static circuit_t *iax2_new_circuit_for_call(packet_info *pinfo, proto_item * item,
|
|
|
|
guint circuit_id, guint framenum,
|
|
|
|
iax_call_data *iax_call, gboolean reversed)
|
2005-08-03 20:37:28 +00:00
|
|
|
{
|
|
|
|
circuit_t *res;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if ((reversed && iax_call->n_reverse_circuit_ids >= IAX_MAX_TRANSFERS) ||
|
|
|
|
(! reversed && iax_call->n_forward_circuit_ids >= IAX_MAX_TRANSFERS)) {
|
2013-01-11 15:57:11 +00:00
|
|
|
expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN, "Too many transfers for iax_call");
|
2005-08-03 20:37:28 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
res = circuit_new(CT_IAX2,
|
|
|
|
circuit_id,
|
2012-11-26 21:19:44 +00:00
|
|
|
framenum);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
circuit_add_proto_data(res, proto_iax2, iax_call);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (reversed)
|
2005-08-03 20:37:28 +00:00
|
|
|
iax_call -> reverse_circuit_ids[iax_call->n_reverse_circuit_ids++] = circuit_id;
|
|
|
|
else
|
|
|
|
iax_call -> forward_circuit_ids[iax_call->n_forward_circuit_ids++] = circuit_id;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* returns true if this circuit id is a "forward" circuit for this call: ie, it
|
|
|
|
* is the point which _sent_ the original 'NEW' packet, or a point to which that
|
|
|
|
* end was subsequently transferred */
|
|
|
|
static gboolean is_forward_circuit(guint circuit_id,
|
2009-10-12 20:57:01 +00:00
|
|
|
const iax_call_data *iax_call)
|
2005-08-03 20:37:28 +00:00
|
|
|
{
|
|
|
|
guint i;
|
2012-11-26 21:19:44 +00:00
|
|
|
for(i=0; i<iax_call->n_forward_circuit_ids; i++) {
|
|
|
|
if (circuit_id == iax_call->forward_circuit_ids[i])
|
2005-08-03 20:37:28 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* returns true if this circuit id is a "reverse" circuit for this call: ie, it
|
|
|
|
* is the point which _received_ the original 'NEW' packet, or a point to which that
|
|
|
|
* end was subsequently transferred */
|
|
|
|
static gboolean is_reverse_circuit(guint circuit_id,
|
2009-10-12 20:57:01 +00:00
|
|
|
const iax_call_data *iax_call)
|
2005-08-03 20:37:28 +00:00
|
|
|
{
|
|
|
|
guint i;
|
2012-11-26 21:19:44 +00:00
|
|
|
for(i=0; i<iax_call->n_reverse_circuit_ids; i++){
|
|
|
|
if (circuit_id == iax_call->reverse_circuit_ids[i])
|
2005-08-03 20:37:28 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-01-11 15:57:11 +00:00
|
|
|
static iax_call_data *iax_lookup_call_from_dest(packet_info *pinfo, proto_item * item,
|
|
|
|
guint src_circuit_id,
|
2005-08-03 20:37:28 +00:00
|
|
|
guint dst_circuit_id,
|
|
|
|
guint framenum,
|
|
|
|
gboolean *reversed_p)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
circuit_t *dst_circuit;
|
|
|
|
iax_call_data *iax_call;
|
|
|
|
gboolean reversed = FALSE;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
dst_circuit = find_circuit(CT_IAX2,
|
|
|
|
dst_circuit_id,
|
|
|
|
framenum);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (!dst_circuit) {
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ destination circuit not found, must have missed NEW packet");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
2012-11-26 21:19:44 +00:00
|
|
|
if (reversed_p)
|
2005-02-10 08:07:44 +00:00
|
|
|
*reversed_p = FALSE;
|
2004-06-25 06:31:47 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ found destination circuit");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_call = (iax_call_data *)circuit_get_proto_data(dst_circuit, proto_iax2);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* there's no way we can create a CT_IAX2 circuit without adding
|
|
|
|
iax call data to it; assert this */
|
2005-06-10 18:28:22 +00:00
|
|
|
DISSECTOR_ASSERT(iax_call);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (is_forward_circuit(dst_circuit_id, iax_call)) {
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ destination circuit matches forward_circuit_id of call, "
|
|
|
|
"therefore packet is reversed");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
reversed = TRUE;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call -> n_reverse_circuit_ids == 0) {
|
2004-06-25 06:31:47 +00:00
|
|
|
/* we are going in the reverse direction, and this call
|
2009-10-12 20:57:01 +00:00
|
|
|
doesn't have a reverse circuit associated with it.
|
|
|
|
create one now. */
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ reverse_circuit_id of call is zero, need to create a "
|
|
|
|
"new reverse circuit for this call");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
|
|
|
|
2013-01-11 15:57:11 +00:00
|
|
|
iax2_new_circuit_for_call(pinfo, item, src_circuit_id, framenum, iax_call, TRUE);
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ done");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
2012-11-26 21:19:44 +00:00
|
|
|
} else if (!is_reverse_circuit(src_circuit_id, iax_call)) {
|
2013-01-11 15:57:11 +00:00
|
|
|
expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN,
|
|
|
|
"IAX Packet %u from circuit ids %u->%u conflicts with earlier call with circuit ids %u->%u",
|
2012-11-26 21:19:44 +00:00
|
|
|
framenum,
|
|
|
|
src_circuit_id, dst_circuit_id,
|
|
|
|
iax_call->forward_circuit_ids[0],
|
|
|
|
iax_call->reverse_circuit_ids[0]);
|
2004-06-25 06:31:47 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2012-11-26 21:19:44 +00:00
|
|
|
} else if (is_reverse_circuit(dst_circuit_id, iax_call)) {
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ destination circuit matches reverse_circuit_id of call, "
|
|
|
|
"therefore packet is forward");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
reversed = FALSE;
|
2012-11-26 21:19:44 +00:00
|
|
|
if (!is_forward_circuit(src_circuit_id, iax_call)) {
|
2013-01-11 15:57:11 +00:00
|
|
|
expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN,
|
|
|
|
"IAX Packet %u from circuit ids %u->%u conflicts with earlier call with circuit ids %u->%u",
|
2012-11-26 21:19:44 +00:00
|
|
|
framenum,
|
|
|
|
src_circuit_id, dst_circuit_id,
|
|
|
|
iax_call->forward_circuit_ids[0],
|
|
|
|
iax_call->reverse_circuit_ids[0]);
|
|
|
|
if (reversed_p)
|
2005-02-10 08:07:44 +00:00
|
|
|
*reversed_p = FALSE;
|
2004-06-25 06:31:47 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
} else {
|
2005-06-10 18:28:22 +00:00
|
|
|
DISSECTOR_ASSERT_NOT_REACHED();
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (reversed_p)
|
2004-06-25 06:31:47 +00:00
|
|
|
*reversed_p = reversed;
|
|
|
|
|
|
|
|
return iax_call;
|
|
|
|
}
|
|
|
|
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* looks up an iax_call for this packet */
|
2009-09-06 14:25:47 +00:00
|
|
|
static iax_call_data *iax_lookup_call( packet_info *pinfo,
|
2005-08-03 20:37:28 +00:00
|
|
|
guint32 scallno,
|
|
|
|
guint32 dcallno,
|
|
|
|
gboolean *reversed_p)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
gboolean reversed = FALSE;
|
2004-06-25 06:31:47 +00:00
|
|
|
iax_call_data *iax_call = NULL;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint src_circuit_id;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ iax_lookup_circuit_details: Looking up circuit for frame %u, "
|
|
|
|
"from {%s:%u:%u} to {%s:%u:%u}", pinfo->fd->num,
|
|
|
|
ep_address_to_str(&pinfo->src), pinfo->srcport, scallno,
|
|
|
|
ep_address_to_str(&pinfo->dst), pinfo->destport, dcallno);
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
src_circuit_id = iax_circuit_lookup(&pinfo->src, pinfo->ptype,
|
|
|
|
pinfo->srcport, scallno);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* the most reliable indicator of call is the destination callno, if
|
|
|
|
we have one */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (dcallno != 0) {
|
2004-06-25 06:31:47 +00:00
|
|
|
guint dst_circuit_id;
|
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ dcallno non-zero, looking up destination circuit");
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
dst_circuit_id = iax_circuit_lookup(&pinfo->dst, pinfo->ptype,
|
|
|
|
pinfo->destport, dcallno);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2013-01-11 15:57:11 +00:00
|
|
|
iax_call = iax_lookup_call_from_dest(pinfo, NULL, src_circuit_id, dst_circuit_id,
|
2005-08-03 20:37:28 +00:00
|
|
|
pinfo->fd->num, &reversed);
|
2004-06-25 06:31:47 +00:00
|
|
|
} else {
|
2005-08-03 20:37:28 +00:00
|
|
|
circuit_t *src_circuit;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* in all other circumstances, the source circuit should already
|
2011-08-16 19:20:25 +00:00
|
|
|
* exist: its absence indicates that we missed the all-important NEW
|
2004-06-25 06:31:47 +00:00
|
|
|
* packet.
|
|
|
|
*/
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
src_circuit = find_circuit(CT_IAX2,
|
|
|
|
src_circuit_id,
|
|
|
|
pinfo->fd->num);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (src_circuit) {
|
|
|
|
iax_call = (iax_call_data *)circuit_get_proto_data(src_circuit, proto_iax2);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* there's no way we can create a CT_IAX2 circuit without adding
|
2009-10-12 20:57:01 +00:00
|
|
|
iax call data to it; assert this */
|
2005-06-10 18:28:22 +00:00
|
|
|
DISSECTOR_ASSERT(iax_call);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (is_forward_circuit(src_circuit_id, iax_call))
|
2009-10-12 20:57:01 +00:00
|
|
|
reversed = FALSE;
|
2012-11-26 21:19:44 +00:00
|
|
|
else if (is_reverse_circuit(src_circuit_id, iax_call))
|
2009-10-12 20:57:01 +00:00
|
|
|
reversed = TRUE;
|
2004-06-25 06:31:47 +00:00
|
|
|
else {
|
2009-10-12 20:57:01 +00:00
|
|
|
/* there's also no way we can attach an iax_call_data to a circuit
|
|
|
|
without the circuit being either the forward or reverse circuit
|
|
|
|
for that call; assert this too.
|
|
|
|
*/
|
|
|
|
DISSECTOR_ASSERT_NOT_REACHED();
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (reversed_p)
|
2004-06-25 06:31:47 +00:00
|
|
|
*reversed_p = reversed;
|
|
|
|
|
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call) {
|
|
|
|
g_debug("++ Found call for packet: id %u, reversed=%c", iax_call->forward_circuit_ids[0], reversed?'1':'0');
|
2004-06-25 06:31:47 +00:00
|
|
|
} else {
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("++ Call not found. Must have missed the NEW packet?");
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
#endif
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
return iax_call;
|
|
|
|
}
|
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* initialize the per-direction parts of an iax_call_data structure */
|
2005-10-11 19:44:59 +00:00
|
|
|
static void init_dir_data(iax_call_dirdata *dirdata)
|
|
|
|
{
|
|
|
|
dirdata -> current_frag_bytes=0;
|
|
|
|
dirdata -> current_frag_minlen=0;
|
|
|
|
}
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* handles a NEW packet by creating a new iax call and forward circuit.
|
|
|
|
the reverse circuit is not created until the ACK is received and
|
|
|
|
is created by iax_lookup_circuit_details. */
|
2009-09-06 14:25:47 +00:00
|
|
|
static iax_call_data *iax_new_call( packet_info *pinfo,
|
2005-08-03 20:37:28 +00:00
|
|
|
guint32 scallno)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_call_data *call;
|
|
|
|
guint circuit_id;
|
|
|
|
static const nstime_t millisecond = {0, 1000000};
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
#ifdef DEBUG_HASHING
|
2012-11-26 21:19:44 +00:00
|
|
|
g_debug("+ new_circuit: Handling NEW packet, frame %u", pinfo->fd->num);
|
2004-06-25 06:31:47 +00:00
|
|
|
#endif
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
circuit_id = iax_circuit_lookup(&pinfo->src, pinfo->ptype,
|
|
|
|
pinfo->srcport, scallno);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2013-03-18 21:16:23 +00:00
|
|
|
call = se_new(iax_call_data);
|
|
|
|
call -> dataformat = AST_DATAFORMAT_NULL;
|
2005-08-03 20:37:28 +00:00
|
|
|
call -> src_codec = 0;
|
|
|
|
call -> dst_codec = 0;
|
|
|
|
call -> n_forward_circuit_ids = 0;
|
|
|
|
call -> n_reverse_circuit_ids = 0;
|
|
|
|
call -> subdissector = NULL;
|
2005-08-24 21:31:56 +00:00
|
|
|
call -> start_time = pinfo->fd->abs_ts;
|
2005-08-28 19:28:04 +00:00
|
|
|
nstime_delta(&call -> start_time, &call -> start_time, &millisecond);
|
2005-10-11 19:44:59 +00:00
|
|
|
init_dir_data(&call->dirdata[0]);
|
|
|
|
init_dir_data(&call->dirdata[1]);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2013-01-11 15:57:11 +00:00
|
|
|
iax2_new_circuit_for_call(pinfo, NULL, circuit_id, pinfo->fd->num, call, FALSE);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
return call;
|
|
|
|
}
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
|
|
|
|
/* per-packet data */
|
|
|
|
typedef struct iax_packet_data {
|
2012-11-26 21:19:44 +00:00
|
|
|
gboolean first_time; /* we're dissecting this packet for the first time; so
|
|
|
|
* things like codec and transfer requests should be
|
|
|
|
* propagated into the call data */
|
2004-06-25 06:31:47 +00:00
|
|
|
iax_call_data *call_data;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 codec;
|
|
|
|
gboolean reversed;
|
|
|
|
nstime_t abstime; /* the absolute time of this packet, based on its
|
|
|
|
* timestamp and the NEW packet's time (-1 if unknown) */
|
2004-06-25 06:31:47 +00:00
|
|
|
} iax_packet_data;
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
static iax_packet_data *iax_new_packet_data(iax_call_data *call, gboolean reversed)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2013-03-18 21:16:23 +00:00
|
|
|
iax_packet_data *p = se_new(iax_packet_data);
|
2012-11-26 21:19:44 +00:00
|
|
|
p->first_time = TRUE;
|
|
|
|
p->call_data = call;
|
|
|
|
p->codec = 0;
|
|
|
|
p->reversed = reversed;
|
|
|
|
p->abstime.secs = -1;
|
|
|
|
p->abstime.nsecs = -1;
|
2004-06-25 06:31:47 +00:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static void iax2_populate_pinfo_from_packet_data(packet_info *pinfo, const iax_packet_data *p)
|
2005-08-03 20:37:28 +00:00
|
|
|
{
|
|
|
|
/* info for subdissectors. We always pass on the original forward circuit,
|
|
|
|
* and steal the p2p_dir flag to indicate the direction */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (p->call_data == NULL) {
|
2005-08-03 20:37:28 +00:00
|
|
|
/* if we missed the NEW packet for this call, call_data will be null. it's
|
|
|
|
* tbd what the best thing to do here is. */
|
|
|
|
pinfo -> ctype = CT_NONE;
|
|
|
|
} else {
|
|
|
|
pinfo -> ctype = CT_IAX2;
|
|
|
|
pinfo -> circuit_id = (guint32)p->call_data->forward_circuit_ids[0];
|
|
|
|
pinfo -> p2p_dir = p->reversed?P2P_DIR_RECV:P2P_DIR_SENT;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_IF_DIR))
|
|
|
|
col_set_str(pinfo->cinfo, COL_IF_DIR, p->reversed ? "rev" : "fwd");
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* ************************************************************************* */
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* this is passed up from the IE dissector to the main dissector */
|
|
|
|
typedef struct
|
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
address peer_address;
|
2005-08-03 20:37:28 +00:00
|
|
|
port_type peer_ptype;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 peer_port;
|
|
|
|
guint32 peer_callno;
|
|
|
|
guint32 dataformat;
|
2005-08-03 20:37:28 +00:00
|
|
|
} iax2_ie_data;
|
|
|
|
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_fullpacket(tvbuff_t *tvb, guint32 offset,
|
|
|
|
guint16 scallno,
|
|
|
|
packet_info *pinfo,
|
|
|
|
proto_tree *iax2_tree,
|
|
|
|
proto_tree *main_tree);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_minipacket(tvbuff_t *tvb, guint32 offset,
|
|
|
|
guint16 scallno,
|
|
|
|
packet_info *pinfo,
|
|
|
|
proto_tree *iax2_tree,
|
|
|
|
proto_tree *main_tree);
|
|
|
|
|
|
|
|
static guint32 dissect_minivideopacket(tvbuff_t *tvb, guint32 offset,
|
|
|
|
guint16 scallno,
|
|
|
|
packet_info *pinfo,
|
|
|
|
proto_tree *iax2_tree,
|
|
|
|
proto_tree *main_tree);
|
|
|
|
|
|
|
|
static guint32 dissect_trunkpacket(tvbuff_t *tvb, guint32 offset,
|
2009-10-12 20:57:01 +00:00
|
|
|
guint16 scallno,
|
2012-11-26 21:19:44 +00:00
|
|
|
packet_info *pinfo,
|
|
|
|
proto_tree *iax2_tree,
|
|
|
|
proto_tree *main_tree);
|
2010-05-25 05:48:36 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
static void dissect_payload(tvbuff_t *tvb, guint32 offset,
|
2009-10-12 20:57:01 +00:00
|
|
|
packet_info *pinfo, proto_tree *iax2_tree,
|
|
|
|
proto_tree *tree, guint32 ts, gboolean video,
|
|
|
|
iax_packet_data *iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
|
|
|
|
static void
|
2012-11-26 21:19:44 +00:00
|
|
|
dissect_iax2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
2004-01-27 01:35:25 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_item *iax2_item = NULL;
|
|
|
|
proto_tree *iax2_tree = NULL;
|
|
|
|
proto_tree *full_mini_subtree = NULL;
|
|
|
|
guint32 offset = 0, len;
|
|
|
|
guint16 scallno = 0;
|
|
|
|
guint16 stmp;
|
|
|
|
packet_type type;
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* set up the protocol and info fields in the summary pane */
|
2012-11-26 21:19:44 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_IAX2);
|
2009-08-09 08:14:59 +00:00
|
|
|
col_clear(pinfo->cinfo, COL_INFO);
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* add the 'iax2' tree to the main tree */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (tree) {
|
|
|
|
iax2_item = proto_tree_add_item(tree, proto_iax2, tvb, offset, -1, ENC_NA);
|
|
|
|
iax2_tree = proto_item_add_subtree(iax2_item, ett_iax2);
|
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
stmp = tvb_get_ntohs(tvb, offset);
|
2012-11-26 21:19:44 +00:00
|
|
|
if (stmp == 0) {
|
2010-05-25 05:48:36 +00:00
|
|
|
/* starting with 0x0000 indicates meta packet which can be either a mini
|
|
|
|
* video packet or a trunk packet */
|
2004-06-25 06:31:47 +00:00
|
|
|
offset+=2;
|
|
|
|
stmp = tvb_get_ntohs(tvb, offset);
|
2012-11-26 21:19:44 +00:00
|
|
|
if (stmp & 0x8000) {
|
2004-06-25 06:31:47 +00:00
|
|
|
/* mini video packet */
|
|
|
|
type = IAX2_MINI_VIDEO_PACKET;
|
|
|
|
scallno = stmp & 0x7FFF;
|
|
|
|
offset += 2;
|
|
|
|
}
|
|
|
|
else {
|
2010-05-25 05:48:36 +00:00
|
|
|
type = IAX2_TRUNK_PACKET;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* The source call/fullpacket flag is common to both mini and full packets */
|
|
|
|
scallno = tvb_get_ntohs(tvb, offset);
|
|
|
|
offset += 2;
|
2012-11-26 21:19:44 +00:00
|
|
|
if (scallno & 0x8000)
|
2004-06-25 06:31:47 +00:00
|
|
|
type = IAX2_FULL_PACKET;
|
|
|
|
else {
|
|
|
|
type = IAX2_MINI_VOICE_PACKET;
|
|
|
|
}
|
|
|
|
scallno &= 0x7FFF;
|
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (tree) {
|
2004-06-25 06:31:47 +00:00
|
|
|
proto_item *full_mini_base;
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
full_mini_base = proto_tree_add_uint(iax2_tree, hf_iax2_packet_type, tvb, 0, offset, type);
|
|
|
|
full_mini_subtree = proto_item_add_subtree(full_mini_base, ett_iax2_full_mini_subtree);
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (scallno != 0)
|
|
|
|
proto_tree_add_item(full_mini_subtree, hf_iax2_scallno, tvb, offset-2, 2, ENC_BIG_ENDIAN);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2009-03-11 07:35:43 +00:00
|
|
|
iax2_info->ptype = type;
|
|
|
|
iax2_info->scallno = 0;
|
|
|
|
iax2_info->dcallno = 0;
|
|
|
|
iax2_info->ftype = 0;
|
|
|
|
iax2_info->csub = 0;
|
|
|
|
iax2_info->payload_len = 0;
|
|
|
|
iax2_info->timestamp = 0;
|
|
|
|
iax2_info->callState = VOIP_NO_STATE;
|
|
|
|
iax2_info->messageName = NULL;
|
|
|
|
iax2_info->callingParty = NULL;
|
|
|
|
iax2_info->calledParty = NULL;
|
|
|
|
iax2_info->payload_data = NULL;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
switch (type) {
|
2004-06-25 06:31:47 +00:00
|
|
|
case IAX2_FULL_PACKET:
|
2012-11-26 21:19:44 +00:00
|
|
|
len = dissect_fullpacket(tvb, offset, scallno, pinfo, full_mini_subtree, tree);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
case IAX2_MINI_VOICE_PACKET:
|
2009-03-11 06:43:46 +00:00
|
|
|
iax2_info->messageName = "MINI_VOICE_PACKET";
|
2012-11-26 21:19:44 +00:00
|
|
|
len = dissect_minipacket(tvb, offset, scallno, pinfo, full_mini_subtree, tree);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
case IAX2_MINI_VIDEO_PACKET:
|
2009-03-11 06:43:46 +00:00
|
|
|
iax2_info->messageName = "MINI_VIDEO_PACKET";
|
2012-11-26 21:19:44 +00:00
|
|
|
len = dissect_minivideopacket(tvb, offset, scallno, pinfo, full_mini_subtree, tree);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
2010-05-25 05:48:36 +00:00
|
|
|
case IAX2_TRUNK_PACKET:
|
|
|
|
iax2_info->messageName = "TRUNK_PACKET";
|
2012-11-26 21:19:44 +00:00
|
|
|
len = dissect_trunkpacket(tvb, offset, scallno, pinfo, full_mini_subtree, tree);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
len = 0;
|
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* update the 'length' of the main IAX2 header field so that it covers just the headers,
|
|
|
|
not the audio data. */
|
|
|
|
proto_item_set_len(iax2_item, len);
|
2009-03-11 06:43:46 +00:00
|
|
|
tap_queue_packet(iax2_tap, pinfo, iax2_info);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
static proto_item *dissect_datetime_ie(tvbuff_t *tvb, guint32 offset, proto_tree *ies_tree)
|
|
|
|
{
|
|
|
|
struct tm tm;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 ie_val;
|
|
|
|
nstime_t datetime;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(ies_tree, hf_iax2_ies[IAX_IE_DATETIME], tvb, offset + 2, 4, ENC_BIG_ENDIAN);
|
2005-08-03 20:37:28 +00:00
|
|
|
ie_val = tvb_get_ntohl(tvb, offset+2);
|
|
|
|
|
|
|
|
/* who's crazy idea for a time encoding was this? */
|
2012-11-26 21:19:44 +00:00
|
|
|
tm.tm_sec = (ie_val & 0x1f) << 1;
|
|
|
|
tm.tm_min = (ie_val>>5) & 0x3f;
|
|
|
|
tm.tm_hour = (ie_val>>11) & 0x1f;
|
|
|
|
tm.tm_mday = (ie_val>>16) & 0x1f;
|
|
|
|
tm.tm_mon = ((ie_val>>21) & 0x0f) - 1;
|
2005-08-03 20:37:28 +00:00
|
|
|
tm.tm_year = ((ie_val>>25) & 0x7f) + 100;
|
|
|
|
tm.tm_isdst= -1; /* there's no info on whether DST was in force; assume it's
|
|
|
|
* the same as currently */
|
|
|
|
|
|
|
|
datetime.secs = mktime(&tm);
|
|
|
|
datetime.nsecs = 0;
|
2012-11-26 21:19:44 +00:00
|
|
|
return proto_tree_add_time(ies_tree, hf_iax2_ie_datetime, tvb, offset+2, 4, &datetime);
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* dissect the information elements in an IAX frame. Returns the updated offset */
|
2013-01-11 15:57:11 +00:00
|
|
|
static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
|
|
|
|
proto_tree *iax_tree, proto_item * iax_item,
|
2012-11-26 21:19:44 +00:00
|
|
|
iax2_ie_data *ie_data)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2005-08-03 20:37:28 +00:00
|
|
|
DISSECTOR_ASSERT(ie_data);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
while (offset < tvb_reported_length(tvb)) {
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
int ies_type = tvb_get_guint8(tvb, offset);
|
|
|
|
int ies_len = tvb_get_guint8(tvb, offset + 1);
|
2007-08-07 22:49:31 +00:00
|
|
|
guint16 apparent_addr_family;
|
|
|
|
|
|
|
|
/* do non-tree-dependent stuff first */
|
2012-11-26 21:19:44 +00:00
|
|
|
switch (ies_type) {
|
2007-08-07 22:49:31 +00:00
|
|
|
case IAX_IE_DATAFORMAT:
|
|
|
|
if (ies_len != 4) THROW(ReportedBoundsError);
|
|
|
|
ie_data -> dataformat = tvb_get_ntohl(tvb, offset+2);
|
|
|
|
break;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
case IAX_IE_CALLED_NUMBER:
|
2012-08-26 23:44:25 +00:00
|
|
|
iax2_info->calledParty = ep_strdup(tvb_format_text(tvb, offset+2, ies_len));
|
2009-03-11 06:43:46 +00:00
|
|
|
break;
|
|
|
|
case IAX_IE_CALLING_NUMBER:
|
2012-08-26 23:44:25 +00:00
|
|
|
iax2_info->callingParty = ep_strdup(tvb_format_text(tvb, offset+2, ies_len));
|
2009-03-11 06:43:46 +00:00
|
|
|
break;
|
2007-08-07 22:49:31 +00:00
|
|
|
|
|
|
|
case IAX_IE_APPARENT_ADDR:
|
2008-08-08 20:07:23 +00:00
|
|
|
/* The IAX2 I-D says that the "apparent address" structure
|
|
|
|
"is the same as the linux struct sockaddr_in", without
|
|
|
|
bothering to note that the address family field is in
|
|
|
|
*host* byte order in that structure (the I-D seems to be
|
|
|
|
assuming that "everything is a Vax^Wx86 or x86-64" with
|
|
|
|
the address family field being little-endian).
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2008-08-08 20:07:23 +00:00
|
|
|
This means the address family values are the Linux
|
|
|
|
address family values. */
|
2007-08-07 22:49:31 +00:00
|
|
|
apparent_addr_family = tvb_get_letohs(tvb, offset+2);
|
2012-11-26 21:19:44 +00:00
|
|
|
switch (apparent_addr_family) {
|
2008-08-08 20:07:23 +00:00
|
|
|
case LINUX_AF_INET:
|
2007-08-07 22:49:31 +00:00
|
|
|
/* IAX is always over UDP */
|
|
|
|
ie_data->peer_ptype = PT_UDP;
|
|
|
|
ie_data->peer_port = tvb_get_ntohs(tvb, offset+4);
|
|
|
|
|
|
|
|
/* the ip address is big-endian, but then so is peer_address.data */
|
Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). They
are like the non-TVB versions except that they take a TVB and an offset
instead of (frequently) a pointer into the TVB.
Calling tvb_get_ptr() before modifying the rest of the fields should help fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't
reproduce that problem).
Replace a bunch of calls like:
SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length));
with:
TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length);
svn path=/trunk/; revision=46324
2012-12-02 04:49:13 +00:00
|
|
|
TVB_SET_ADDRESS(&ie_data->peer_address, AT_IPv4, tvb, offset+6, 4);
|
2007-08-07 22:49:31 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-01-11 15:57:11 +00:00
|
|
|
expert_add_info_format(pinfo, iax_item, PI_PROTOCOL, PI_WARN,
|
|
|
|
"Not supported in IAX dissector: peer address family of %u", apparent_addr_family);
|
2007-08-07 22:49:31 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2007-08-07 22:49:31 +00:00
|
|
|
/* the rest of this stuff only needs doing if we have an iax_tree */
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_tree && ies_type < NUM_HF_IAX2_IES) {
|
2005-08-03 20:37:28 +00:00
|
|
|
proto_item *ti, *ie_item = NULL;
|
2004-06-25 06:31:47 +00:00
|
|
|
proto_tree *ies_tree;
|
2005-08-03 20:37:28 +00:00
|
|
|
int ie_hf = hf_iax2_ies[ies_type];
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
ti = proto_tree_add_text(iax_tree, tvb, offset, ies_len+2, " ");
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
ies_tree = proto_item_add_subtree(ti, ett_iax2_ie);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
proto_tree_add_text(ies_tree, tvb, offset, 1, "IE id: %s (0x%02X)",
|
2012-11-26 21:19:44 +00:00
|
|
|
val_to_str_ext_const(ies_type, &iax_ies_type_ext, "Unknown"),
|
2009-10-12 20:57:01 +00:00
|
|
|
ies_type);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_text(ies_tree, tvb, offset + 1, 1, "Length: %u", ies_len);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* hf_iax2_ies[] is an array, indexed by IE number, of header-fields, one
|
2009-10-12 20:57:01 +00:00
|
|
|
per IE. Apart from a couple of special cases which require more
|
|
|
|
complex decoding, we can just look up an entry from the array, and add
|
2012-05-07 23:37:38 +00:00
|
|
|
the relevant item, although the encoding value used depends on the
|
|
|
|
type of the item.
|
2005-08-03 20:37:28 +00:00
|
|
|
*/
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
switch (ies_type) {
|
2005-08-03 20:37:28 +00:00
|
|
|
case IAX_IE_DATETIME:
|
2012-11-26 21:19:44 +00:00
|
|
|
ie_item = dissect_datetime_ie(tvb, offset, ies_tree);
|
2005-08-03 20:37:28 +00:00
|
|
|
break;
|
|
|
|
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2009-10-12 20:57:01 +00:00
|
|
|
case IAX_IE_CAPABILITY:
|
|
|
|
{
|
|
|
|
proto_tree *codec_tree;
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
if (ies_len != 4) THROW(ReportedBoundsError);
|
|
|
|
|
2009-10-12 20:57:01 +00:00
|
|
|
ie_item =
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(ies_tree, ie_hf,
|
|
|
|
tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
2009-10-12 20:57:01 +00:00
|
|
|
codec_tree =
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_item_add_subtree(ie_item, ett_iax2_codecs);
|
|
|
|
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_g723_1, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_gsm, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_ulaw, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_alaw, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_g726_aal2, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_adpcm, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_slinear, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_lpc10, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_g729a, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_speex, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_ilbc, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_g726, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_g722, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_siren7, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_siren14, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_slinear16, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_jpeg, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_png, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_h261, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_h263, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_h263_plus, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_h264, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(codec_tree, hf_iax2_cap_mpeg4, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
2009-10-12 20:57:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case IAX_IE_APPARENT_ADDR:
|
|
|
|
{
|
|
|
|
proto_tree *sockaddr_tree = NULL;
|
|
|
|
|
|
|
|
ie_item = proto_tree_add_text(ies_tree, tvb, offset + 2, 16, "Apparent Address");
|
|
|
|
sockaddr_tree = proto_item_add_subtree(ie_item, ett_iax2_ies_apparent_addr);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2008-08-08 20:07:23 +00:00
|
|
|
/* The IAX2 I-D says that the "apparent address" structure
|
|
|
|
"is the same as the linux struct sockaddr_in", without
|
|
|
|
bothering to note that the address family field is in
|
|
|
|
*host* byte order in that structure (the I-D seems to be
|
|
|
|
assuming that "everything is a Vax^Wx86 or x86-64" with
|
|
|
|
the address family field being little-endian).
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2008-08-08 20:07:23 +00:00
|
|
|
This means the address family values are the Linux
|
|
|
|
address family values. */
|
2009-10-12 20:57:01 +00:00
|
|
|
apparent_addr_family = tvb_get_letohs(tvb, offset+2);
|
|
|
|
proto_tree_add_uint(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINFAMILY, tvb, offset + 2, 2, apparent_addr_family);
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
switch (apparent_addr_family) {
|
2009-10-12 20:57:01 +00:00
|
|
|
case LINUX_AF_INET:
|
|
|
|
{
|
|
|
|
guint32 addr;
|
|
|
|
proto_tree_add_uint(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINPORT, tvb, offset + 4, 2, ie_data->peer_port);
|
|
|
|
memcpy(&addr, ie_data->peer_address.data, 4);
|
|
|
|
proto_tree_add_ipv4(sockaddr_tree, hf_IAX_IE_APPARENTADDR_SINADDR, tvb, offset + 6, 4, addr);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
2012-11-26 21:19:44 +00:00
|
|
|
if (ie_hf != -1) {
|
2005-08-03 20:37:28 +00:00
|
|
|
/* throw an error if the IE isn't the expected length */
|
2012-05-07 23:37:38 +00:00
|
|
|
enum ftenum type = proto_registrar_get_nth(ie_hf)->type;
|
|
|
|
gint explen = ftype_length(type);
|
2012-11-26 21:19:44 +00:00
|
|
|
if (explen != 0 && ies_len != explen)
|
2005-08-03 20:37:28 +00:00
|
|
|
THROW(ReportedBoundsError);
|
2012-05-07 23:37:38 +00:00
|
|
|
switch (type) {
|
|
|
|
case FT_UINT8:
|
|
|
|
case FT_UINT16:
|
|
|
|
case FT_UINT24:
|
|
|
|
case FT_UINT32:
|
|
|
|
case FT_UINT64:
|
|
|
|
case FT_INT8:
|
|
|
|
case FT_INT16:
|
|
|
|
case FT_INT24:
|
|
|
|
case FT_INT32:
|
|
|
|
case FT_INT64:
|
|
|
|
case FT_BOOLEAN:
|
|
|
|
case FT_IPv4:
|
|
|
|
ie_item = proto_tree_add_item(ies_tree, ie_hf, tvb, offset + 2, ies_len, ENC_BIG_ENDIAN);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FT_BYTES:
|
|
|
|
case FT_NONE:
|
|
|
|
ie_item = proto_tree_add_item(ies_tree, ie_hf, tvb, offset + 2, ies_len, ENC_NA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FT_STRING:
|
|
|
|
case FT_STRINGZ:
|
|
|
|
ie_item = proto_tree_add_item(ies_tree, ie_hf, tvb, offset + 2, ies_len, ENC_UTF_8|ENC_NA);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
DISSECTOR_ASSERT_NOT_REACHED();
|
|
|
|
break;
|
|
|
|
}
|
2009-10-12 20:57:01 +00:00
|
|
|
} else {
|
2005-08-03 20:37:28 +00:00
|
|
|
/* we don't understand this ie: add a generic one */
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 value;
|
2005-08-03 20:37:28 +00:00
|
|
|
const guint8 *ptr;
|
2012-11-26 21:19:44 +00:00
|
|
|
const gchar *ie_name = val_to_str_ext_const(ies_type, &iax_ies_type_ext, "Unknown");
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
switch (ies_len) {
|
2005-08-03 20:37:28 +00:00
|
|
|
case 1:
|
|
|
|
value = tvb_get_guint8(tvb, offset + 2);
|
|
|
|
ie_item =
|
|
|
|
proto_tree_add_uint_format(ies_tree, hf_IAX_IE_UNKNOWN_BYTE,
|
|
|
|
tvb, offset+2, 1, value,
|
2012-11-26 21:19:44 +00:00
|
|
|
"%s: %#02x", ie_name, value);
|
2005-08-03 20:37:28 +00:00
|
|
|
break;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
case 2:
|
|
|
|
value = tvb_get_ntohs(tvb, offset + 2);
|
|
|
|
ie_item =
|
|
|
|
proto_tree_add_uint_format(ies_tree, hf_IAX_IE_UNKNOWN_I16,
|
|
|
|
tvb, offset+2, 2, value,
|
2012-11-26 21:19:44 +00:00
|
|
|
"%s: %#04x", ie_name, value);
|
2005-08-03 20:37:28 +00:00
|
|
|
break;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
case 4:
|
|
|
|
value = tvb_get_ntohl(tvb, offset + 2);
|
|
|
|
ie_item =
|
|
|
|
proto_tree_add_uint_format(ies_tree, hf_IAX_IE_UNKNOWN_I32,
|
|
|
|
tvb, offset+2, 4, value,
|
2012-11-26 21:19:44 +00:00
|
|
|
"%s: %#08x", ie_name, value);
|
2005-08-03 20:37:28 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2012-02-09 19:17:28 +00:00
|
|
|
ptr = tvb_get_ephemeral_string(tvb, offset + 2, ies_len);
|
2005-08-03 20:37:28 +00:00
|
|
|
ie_item =
|
|
|
|
proto_tree_add_string_format(ies_tree, hf_IAX_IE_UNKNOWN_BYTES,
|
2007-03-28 21:55:11 +00:00
|
|
|
tvb, offset+2, ies_len, ptr,
|
2012-11-26 21:19:44 +00:00
|
|
|
"%s: %s", ie_name, ptr);
|
2005-08-03 20:37:28 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-10-12 20:57:01 +00:00
|
|
|
}
|
|
|
|
break;
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* by now, we *really* ought to have added an item */
|
|
|
|
DISSECTOR_ASSERT(ie_item != NULL);
|
|
|
|
|
|
|
|
/* Retrieve the text from the item we added, and append it to the main IE
|
|
|
|
* item */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (!PROTO_ITEM_IS_HIDDEN(ti)) {
|
2009-10-12 20:57:01 +00:00
|
|
|
field_info *ie_finfo = PITEM_FINFO(ie_item);
|
|
|
|
|
|
|
|
/* if the representation of the item has already been set, use that;
|
|
|
|
else we have to allocate a block to put the text into */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (ie_finfo && ie_finfo->rep != NULL)
|
2009-10-12 20:57:01 +00:00
|
|
|
proto_item_set_text(ti, "Information Element: %s",
|
|
|
|
ie_finfo->rep->representation);
|
|
|
|
else {
|
2005-08-03 20:37:28 +00:00
|
|
|
guint8 *ie_val = NULL;
|
2013-03-18 21:16:23 +00:00
|
|
|
ie_val = (guint8 *)ep_alloc(ITEM_LABEL_LENGTH);
|
2009-10-12 20:57:01 +00:00
|
|
|
proto_item_fill_label(ie_finfo, ie_val);
|
|
|
|
proto_item_set_text(ti, "Information Element: %s",
|
|
|
|
ie_val);
|
|
|
|
}
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
}
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
offset += ies_len + 2;
|
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint32 uncompress_subclass(guint8 csub)
|
|
|
|
{
|
|
|
|
/* If the SC_LOG flag is set, return 2^csub otherwise csub */
|
|
|
|
if (csub & 0x80) {
|
|
|
|
/* special case for 'compressed' -1 */
|
|
|
|
if (csub == 0xff)
|
|
|
|
return (guint32)-1;
|
|
|
|
else
|
|
|
|
return 1 << (csub & 0x1F);
|
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
else
|
2004-06-25 06:31:47 +00:00
|
|
|
return (guint32)csub;
|
|
|
|
}
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* returns the new offset */
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_iax2_command(tvbuff_t *tvb, guint32 offset,
|
|
|
|
packet_info *pinfo, proto_tree *tree,
|
2009-10-12 20:57:01 +00:00
|
|
|
iax_packet_data *iax_packet)
|
2005-08-03 20:37:28 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
guint8 csub = tvb_get_guint8(tvb, offset);
|
|
|
|
guint8 address_data[MAX_ADDRESS];
|
2013-01-11 15:57:11 +00:00
|
|
|
proto_item* ti;
|
2012-11-26 21:19:44 +00:00
|
|
|
iax2_ie_data ie_data;
|
2005-08-04 22:54:04 +00:00
|
|
|
iax_call_data *iax_call;
|
|
|
|
|
|
|
|
ie_data.peer_address.type = AT_NONE;
|
2012-11-26 21:19:44 +00:00
|
|
|
ie_data.peer_address.len = 0;
|
2005-08-04 22:54:04 +00:00
|
|
|
ie_data.peer_address.data = address_data;
|
2013-03-18 21:16:23 +00:00
|
|
|
ie_data.peer_ptype = PT_NONE;
|
2012-11-26 21:19:44 +00:00
|
|
|
ie_data.peer_port = 0;
|
|
|
|
ie_data.peer_callno = 0;
|
|
|
|
ie_data.dataformat = (guint32)-1;
|
|
|
|
iax_call = iax_packet -> call_data;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
/* add the subclass */
|
2013-01-11 15:57:11 +00:00
|
|
|
ti = proto_tree_add_uint(tree, hf_iax2_iax_csub, tvb, offset, 1, csub);
|
2005-08-03 20:37:28 +00:00
|
|
|
offset++;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
|
|
|
|
val_to_str_ext(csub, &iax_iax_subclasses_ext, "unknown (0x%02x)"));
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (offset >= tvb_reported_length(tvb))
|
2005-08-03 20:37:28 +00:00
|
|
|
return offset;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2013-01-11 15:57:11 +00:00
|
|
|
offset = dissect_ies(tvb, pinfo, offset, tree, ti, &ie_data);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
/* if this is a data call, set up a subdissector for the circuit */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call && ie_data.dataformat != (guint32)-1 && iax_call -> subdissector == NULL) {
|
|
|
|
iax_call -> subdissector = dissector_get_uint_handle(iax2_dataformat_dissector_table, ie_data.dataformat);
|
2013-03-18 21:16:23 +00:00
|
|
|
iax_call -> dataformat = (iax_dataformat_t)ie_data.dataformat;
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* if this is a transfer request, record it in the call data */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (csub == IAX_COMMAND_TXREQ && iax_packet -> first_time) {
|
|
|
|
if (ie_data.peer_address.type != AT_NONE && ie_data.peer_callno != 0) {
|
2005-08-03 20:37:28 +00:00
|
|
|
guint tx_circuit = iax_circuit_lookup(&ie_data.peer_address,
|
2009-10-12 20:57:01 +00:00
|
|
|
ie_data.peer_ptype,
|
|
|
|
ie_data.peer_port,
|
|
|
|
ie_data.peer_callno);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2013-01-11 15:57:11 +00:00
|
|
|
iax2_new_circuit_for_call(pinfo, NULL, tx_circuit, pinfo->fd->num, iax_call, iax_packet->reversed);
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
|
|
|
}
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static void iax2_add_ts_fields(packet_info *pinfo, proto_tree *iax2_tree, iax_packet_data *iax_packet, guint16 shortts)
|
2005-08-03 20:37:28 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 longts =shortts;
|
|
|
|
nstime_t ts;
|
2005-08-03 20:37:28 +00:00
|
|
|
proto_item *item;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_packet->call_data == NULL) {
|
2005-08-03 20:37:28 +00:00
|
|
|
/* no call info for this frame; perhaps we missed the NEW packet */
|
|
|
|
return;
|
|
|
|
}
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_packet->abstime.secs == -1) {
|
2005-08-03 20:37:28 +00:00
|
|
|
time_t start_secs = iax_packet->call_data->start_time.secs;
|
2012-11-26 21:19:44 +00:00
|
|
|
gint32 abs_secs = (gint32)(start_secs + longts/1000);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
/* deal with short timestamps by assuming that packets are never more than
|
|
|
|
* 16 seconds late */
|
2005-08-24 21:31:56 +00:00
|
|
|
while(abs_secs < pinfo->fd->abs_ts.secs - 16) {
|
2005-08-03 20:37:28 +00:00
|
|
|
longts += 32768;
|
2012-11-26 21:19:44 +00:00
|
|
|
abs_secs = (gint32)(start_secs + longts/1000);
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
iax_packet->abstime.secs=abs_secs;
|
|
|
|
iax_packet->abstime.nsecs=iax_packet->call_data->start_time.nsecs + (longts % 1000) * 1000000;
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_packet->abstime.nsecs >= 1000000000) {
|
2005-08-03 20:37:28 +00:00
|
|
|
iax_packet->abstime.nsecs -= 1000000000;
|
|
|
|
iax_packet->abstime.secs ++;
|
|
|
|
}
|
|
|
|
}
|
2009-03-11 06:43:46 +00:00
|
|
|
iax2_info->timestamp = longts;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
if (iax2_tree) {
|
|
|
|
item = proto_tree_add_time(iax2_tree, hf_iax2_absts, NULL, 0, 0, &iax_packet->abstime);
|
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
ts = pinfo->fd->abs_ts;
|
|
|
|
nstime_delta(&ts, &ts, &iax_packet->abstime);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
item = proto_tree_add_time(iax2_tree, hf_iax2_lateness, NULL, 0, 0, &ts);
|
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* returns the new offset */
|
2004-06-25 06:31:47 +00:00
|
|
|
static guint32
|
2012-11-26 21:19:44 +00:00
|
|
|
dissect_fullpacket(tvbuff_t *tvb, guint32 offset,
|
|
|
|
guint16 scallno,
|
|
|
|
packet_info *pinfo, proto_tree *iax2_tree,
|
|
|
|
proto_tree *main_tree)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
|
|
|
guint16 dcallno;
|
|
|
|
guint32 ts;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint8 type;
|
|
|
|
guint8 csub;
|
2004-06-25 06:31:47 +00:00
|
|
|
guint32 codec;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree *packet_type_tree = NULL;
|
|
|
|
iax_call_data *iax_call;
|
2004-06-25 06:31:47 +00:00
|
|
|
iax_packet_data *iax_packet;
|
2012-11-26 21:19:44 +00:00
|
|
|
gboolean reversed;
|
|
|
|
gboolean rtp_marker;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-02-10 08:07:44 +00:00
|
|
|
/*
|
2009-09-06 14:25:47 +00:00
|
|
|
* remove the top bit for retransmission detection
|
2005-02-10 08:07:44 +00:00
|
|
|
*/
|
2011-04-18 17:35:25 +00:00
|
|
|
dcallno = tvb_get_ntohs(tvb, offset) & 0x7FFF;
|
2012-11-26 21:19:44 +00:00
|
|
|
ts = tvb_get_ntohl(tvb, offset + 2);
|
2005-02-10 08:07:44 +00:00
|
|
|
type = tvb_get_guint8(tvb, offset + 8);
|
|
|
|
csub = tvb_get_guint8(tvb, offset + 9);
|
2012-11-26 21:19:44 +00:00
|
|
|
iax2_info->ftype = type;
|
|
|
|
iax2_info->csub = csub;
|
2009-03-11 06:43:46 +00:00
|
|
|
iax2_info->scallno = scallno;
|
|
|
|
iax2_info->dcallno = dcallno;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* see if we've seen this packet before */
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_packet = (iax_packet_data *)p_get_proto_data(pinfo->fd, proto_iax2);
|
|
|
|
if (!iax_packet) {
|
2004-06-25 06:31:47 +00:00
|
|
|
/* if not, find or create an iax_call info structure for this IAX session. */
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (type == AST_FRAME_IAX && csub == IAX_COMMAND_NEW) {
|
2004-06-25 06:31:47 +00:00
|
|
|
/* NEW packets start a new call */
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_call = iax_new_call(pinfo, scallno);
|
2004-06-25 06:31:47 +00:00
|
|
|
reversed = FALSE;
|
|
|
|
} else {
|
2005-08-03 20:37:28 +00:00
|
|
|
iax_call = iax_lookup_call(pinfo, scallno, dcallno,
|
|
|
|
&reversed);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
iax_packet = iax_new_packet_data(iax_call, reversed);
|
2012-11-26 21:19:44 +00:00
|
|
|
p_add_proto_data(pinfo->fd, proto_iax2, iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
} else {
|
|
|
|
iax_call = iax_packet->call_data;
|
2005-08-03 20:37:28 +00:00
|
|
|
reversed = iax_packet->reversed;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
iax2_populate_pinfo_from_packet_data(pinfo, iax_packet);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
2004-06-25 06:31:47 +00:00
|
|
|
proto_item *packet_type_base;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_dcallno, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_retransmission, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call) {
|
2009-09-06 14:25:47 +00:00
|
|
|
proto_item *item =
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_uint(iax2_tree, hf_iax2_callno, tvb, 0, 4,
|
|
|
|
iax_call->forward_circuit_ids[0]);
|
2005-08-03 20:37:28 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_uint(iax2_tree, hf_iax2_ts, tvb, offset+2, 4, ts);
|
2005-08-03 20:37:28 +00:00
|
|
|
iax2_add_ts_fields(pinfo, iax2_tree, iax_packet, (guint16)ts);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_oseqno, tvb, offset+6, 1,
|
|
|
|
ENC_BIG_ENDIAN);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_iseqno, tvb, offset+7, 1,
|
|
|
|
ENC_BIG_ENDIAN);
|
|
|
|
packet_type_base = proto_tree_add_uint(iax2_tree, hf_iax2_type, tvb,
|
|
|
|
offset+8, 1, type);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* add the type-specific subtree */
|
2012-11-26 21:19:44 +00:00
|
|
|
packet_type_tree = proto_item_add_subtree(packet_type_base, ett_iax2_type);
|
2009-03-11 06:43:46 +00:00
|
|
|
} else {
|
|
|
|
iax2_add_ts_fields(pinfo, iax2_tree, iax_packet, (guint16)ts);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2009-03-11 06:43:46 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* add frame type to info line */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "%s, source call# %d, timestamp %ums",
|
|
|
|
val_to_str_ext(type, &iax_frame_types_ext, "Unknown (0x%02x)"),
|
|
|
|
scallno, ts);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
2012-11-26 21:19:44 +00:00
|
|
|
iax2_info->messageName = val_to_str_ext(type, &iax_frame_types_ext, "Unknown (0x%02x)");
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
switch (type) {
|
2004-06-25 06:31:47 +00:00
|
|
|
case AST_FRAME_IAX:
|
2012-11-26 21:19:44 +00:00
|
|
|
offset=dissect_iax2_command(tvb, offset+9, pinfo, packet_type_tree, iax_packet);
|
|
|
|
iax2_info->messageName = val_to_str_ext(csub, &iax_iax_subclasses_ext, "unknown (0x%02x)");
|
2013-03-18 21:16:23 +00:00
|
|
|
iax2_info->callState = (voip_call_state)csub;
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2007-06-29 19:00:46 +00:00
|
|
|
case AST_FRAME_DTMF_BEGIN:
|
|
|
|
case AST_FRAME_DTMF_END:
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(packet_type_tree, hf_iax2_dtmf_csub, tvb, offset+9, 1, ENC_ASCII|ENC_NA);
|
2004-06-25 06:31:47 +00:00
|
|
|
offset += 10;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " digit %c", csub);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AST_FRAME_CONTROL:
|
|
|
|
/* add the subclass */
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_uint(packet_type_tree, hf_iax2_cmd_csub, tvb,
|
2009-10-12 20:57:01 +00:00
|
|
|
offset+9, 1, csub);
|
2004-06-25 06:31:47 +00:00
|
|
|
offset += 10;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
|
|
|
|
val_to_str_ext(csub, &iax_cmd_subclasses_ext, "unknown (0x%02x)"));
|
|
|
|
iax2_info->messageName = val_to_str_ext (csub, &iax_cmd_subclasses_ext, "unknown (0x%02x)");
|
2011-02-19 00:05:12 +00:00
|
|
|
if (csub < NUM_TAP_CMD_VOIP_STATES) iax2_info->callState = tap_cmd_voip_state[csub];
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AST_FRAME_VOICE:
|
|
|
|
/* add the codec */
|
|
|
|
iax_packet -> codec = codec = uncompress_subclass(csub);
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (packet_type_tree) {
|
2005-10-11 19:44:59 +00:00
|
|
|
proto_item *item;
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(packet_type_tree, hf_iax2_voice_csub, tvb, offset+9, 1, ENC_BIG_ENDIAN);
|
|
|
|
item = proto_tree_add_uint(packet_type_tree, hf_iax2_voice_codec, tvb, offset+9, 1, codec);
|
2005-10-11 19:44:59 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
offset += 10;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call) {
|
|
|
|
if (reversed) {
|
2009-10-12 20:57:01 +00:00
|
|
|
iax_call->dst_codec = codec;
|
2004-06-25 06:31:47 +00:00
|
|
|
} else {
|
2009-10-12 20:57:01 +00:00
|
|
|
iax_call->src_codec = codec;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
dissect_payload(tvb, offset, pinfo, iax2_tree, main_tree, ts, FALSE, iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AST_FRAME_VIDEO:
|
|
|
|
/* bit 6 of the csub is used to represent the rtp 'marker' bit */
|
|
|
|
rtp_marker = csub & 0x40 ? TRUE:FALSE;
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_packet -> codec = codec = uncompress_subclass((guint8)(csub & ~40));
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (packet_type_tree) {
|
2005-10-11 19:44:59 +00:00
|
|
|
proto_item *item;
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(packet_type_tree, hf_iax2_video_csub, tvb, offset+9, 1, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(packet_type_tree, hf_iax2_marker, tvb, offset+9, 1, ENC_BIG_ENDIAN);
|
|
|
|
item = proto_tree_add_uint(packet_type_tree, hf_iax2_video_codec, tvb, offset+9, 1, codec);
|
2005-10-11 19:44:59 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
offset += 10;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call && iax_packet -> first_time) {
|
|
|
|
if (reversed) {
|
2009-10-12 20:57:01 +00:00
|
|
|
iax_call->dst_vformat = codec;
|
2004-06-25 06:31:47 +00:00
|
|
|
} else {
|
2009-10-12 20:57:01 +00:00
|
|
|
iax_call->src_vformat = codec;
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (rtp_marker)
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, ", Mark");
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
dissect_payload(tvb, offset, pinfo, iax2_tree, main_tree, ts, TRUE, iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
|
2007-06-29 19:00:46 +00:00
|
|
|
case AST_FRAME_MODEM:
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(packet_type_tree, hf_iax2_modem_csub, tvb, offset+9, 1, ENC_BIG_ENDIAN);
|
2007-06-29 19:00:46 +00:00
|
|
|
offset += 10;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
|
|
|
|
val_to_str(csub, iax_modem_subclasses, "unknown (0x%02x)"));
|
2007-06-29 19:00:46 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AST_FRAME_HTML:
|
|
|
|
case AST_FRAME_CNG:
|
2004-06-25 06:31:47 +00:00
|
|
|
default:
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_uint(packet_type_tree, hf_iax2_csub, tvb, offset+9,
|
|
|
|
1, csub);
|
2004-06-25 06:31:47 +00:00
|
|
|
offset += 10;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, " subclass %d", csub);
|
2004-06-25 06:31:47 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* next time we come to parse this packet, don't propagate the codec into the
|
2005-08-03 20:37:28 +00:00
|
|
|
* call_data */
|
|
|
|
iax_packet->first_time = FALSE;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static iax_packet_data *iax2_get_packet_data_for_minipacket(packet_info *pinfo,
|
2009-10-12 20:57:01 +00:00
|
|
|
guint16 scallno,
|
|
|
|
gboolean video)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
|
|
|
/* see if we've seen this packet before */
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_packet_data *p = (iax_packet_data *)p_get_proto_data(pinfo->fd, proto_iax2);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (!p) {
|
2004-06-25 06:31:47 +00:00
|
|
|
/* if not, find or create an iax_call info structure for this IAX session. */
|
|
|
|
gboolean reversed;
|
|
|
|
iax_call_data *iax_call;
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
iax_call = iax_lookup_call(pinfo, scallno, 0, &reversed);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
p = iax_new_packet_data(iax_call, reversed);
|
|
|
|
p_add_proto_data(pinfo->fd, proto_iax2, p);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* set the codec for this frame to be whatever the last full frame used */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_call) {
|
|
|
|
if (video)
|
2004-07-23 06:37:58 +00:00
|
|
|
p->codec = reversed ? iax_call -> dst_vformat : iax_call -> src_vformat;
|
2009-09-06 14:25:47 +00:00
|
|
|
else
|
2004-07-23 06:37:58 +00:00
|
|
|
p->codec = reversed ? iax_call -> dst_codec : iax_call -> src_codec;
|
|
|
|
}
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
iax2_populate_pinfo_from_packet_data(pinfo, p);
|
2004-06-25 06:31:47 +00:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_minivideopacket(tvbuff_t *tvb, guint32 offset,
|
|
|
|
guint16 scallno, packet_info *pinfo,
|
|
|
|
proto_tree *iax2_tree, proto_tree *main_tree)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 ts;
|
2004-06-25 06:31:47 +00:00
|
|
|
iax_packet_data *iax_packet;
|
2012-11-26 21:19:44 +00:00
|
|
|
gboolean rtp_marker;
|
|
|
|
proto_item *item;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
ts = tvb_get_ntohs(tvb, offset);
|
|
|
|
|
|
|
|
/* bit 15 of the ts is used to represent the rtp 'marker' bit */
|
|
|
|
rtp_marker = ts & 0x8000 ? TRUE:FALSE;
|
|
|
|
ts &= ~0x8000;
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
iax_packet = iax2_get_packet_data_for_minipacket(pinfo, scallno, TRUE);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
|
|
|
if (iax_packet->call_data) {
|
2009-09-06 14:25:47 +00:00
|
|
|
item =
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_uint(iax2_tree, hf_iax2_callno, tvb, 0, 4,
|
|
|
|
iax_packet->call_data->forward_circuit_ids[0]);
|
2005-08-03 20:37:28 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_minividts, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2005-08-03 20:37:28 +00:00
|
|
|
iax2_add_ts_fields(pinfo, iax2_tree, iax_packet, (guint16)ts);
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_minividmarker, tvb, offset, 2, ENC_BIG_ENDIAN);
|
2009-03-11 06:43:46 +00:00
|
|
|
} else {
|
|
|
|
iax2_add_ts_fields(pinfo, iax2_tree, iax_packet, (guint16)ts);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
offset += 2;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
|
|
|
"Mini video packet, source call# %d, timestamp %ums%s",
|
|
|
|
scallno, ts, rtp_marker?", Mark":"");
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
dissect_payload(tvb, offset, pinfo, iax2_tree, main_tree, ts, TRUE, iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* next time we come to parse this packet, don't propagate the codec into the
|
2005-08-03 20:37:28 +00:00
|
|
|
* call_data */
|
|
|
|
iax_packet->first_time = FALSE;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_minipacket(tvbuff_t *tvb, guint32 offset, guint16 scallno,
|
|
|
|
packet_info *pinfo, proto_tree *iax2_tree,
|
|
|
|
proto_tree *main_tree)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 ts;
|
2004-06-25 06:31:47 +00:00
|
|
|
iax_packet_data *iax_packet;
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_item *item;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
ts = tvb_get_ntohs(tvb, offset);
|
|
|
|
|
|
|
|
iax_packet = iax2_get_packet_data_for_minipacket(pinfo, scallno, FALSE);
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
|
|
|
if (iax_packet->call_data) {
|
|
|
|
item = proto_tree_add_uint(iax2_tree, hf_iax2_callno, tvb, 0, 4,
|
|
|
|
iax_packet->call_data->forward_circuit_ids[0]);
|
2005-08-03 20:37:28 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_uint(iax2_tree, hf_iax2_minits, tvb, offset, 2, ts);
|
|
|
|
iax2_add_ts_fields(pinfo, iax2_tree, iax_packet, (guint16)ts);
|
2009-03-11 06:43:46 +00:00
|
|
|
} else {
|
|
|
|
iax2_add_ts_fields(pinfo, iax2_tree, iax_packet, (guint16)ts);
|
2005-08-03 20:37:28 +00:00
|
|
|
}
|
2009-03-11 06:43:46 +00:00
|
|
|
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
offset += 2;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO,
|
2009-10-12 20:57:01 +00:00
|
|
|
"Mini packet, source call# %d, timestamp %ums",
|
|
|
|
scallno, ts);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* XXX fix the timestamp logic */
|
2005-10-02 20:59:54 +00:00
|
|
|
dissect_payload(tvb, offset, pinfo, iax2_tree, main_tree, ts, FALSE, iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
|
2009-10-15 02:39:06 +00:00
|
|
|
/* next time we come to parse this packet, don't propagate the codec into the
|
2005-08-03 20:37:28 +00:00
|
|
|
* call_data */
|
|
|
|
iax_packet->first_time = FALSE;
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2010-05-25 05:48:36 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_trunkcall_ts(tvbuff_t *tvb, guint32 offset, proto_tree *iax2_tree, guint16 *scallno)
|
2010-05-25 05:48:36 +00:00
|
|
|
{
|
|
|
|
proto_item *call_item;
|
|
|
|
proto_tree *call_tree;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint16 datalen, rlen, ts;
|
2010-05-25 05:48:36 +00:00
|
|
|
/*
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Data Length (in octets) |R| Source Call Number |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| time-stamp | |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
|
|
|
| Data |
|
|
|
|
: :
|
|
|
|
| |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2011-08-16 19:20:25 +00:00
|
|
|
*/
|
2010-05-25 05:48:36 +00:00
|
|
|
datalen = tvb_get_ntohs(tvb, offset);
|
2012-02-28 07:32:19 +00:00
|
|
|
*scallno = tvb_get_ntohs(tvb, offset + 2);
|
2010-05-25 05:48:36 +00:00
|
|
|
ts = tvb_get_ntohs(tvb, offset + 4);
|
|
|
|
|
|
|
|
rlen = MIN(tvb_length(tvb) - offset - 6, datalen);
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
2012-02-28 07:32:19 +00:00
|
|
|
call_item = proto_tree_add_text(iax2_tree, tvb, offset, rlen + 6, "Trunk call from %u, ts: %u", *scallno, ts);
|
2010-05-25 05:48:36 +00:00
|
|
|
call_tree = proto_item_add_subtree(call_item, ett_iax2_trunk_call);
|
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_len, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_scallno, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
|
2011-10-16 23:38:49 +00:00
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_ts, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_data, tvb, offset + 6, rlen, ENC_NA);
|
2010-05-25 05:48:36 +00:00
|
|
|
}
|
|
|
|
offset += 6 + rlen;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_trunkcall_nots(tvbuff_t *tvb, guint32 offset, proto_tree *iax2_tree, guint16 *scallno)
|
2010-05-25 05:48:36 +00:00
|
|
|
{
|
|
|
|
proto_item *call_item;
|
|
|
|
proto_tree *call_tree;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint16 datalen, rlen;
|
2010-05-25 05:48:36 +00:00
|
|
|
/*
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|R| Source Call Number | Data Length (in octets) |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| |
|
|
|
|
: Data :
|
|
|
|
| |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2011-08-16 19:20:25 +00:00
|
|
|
*/
|
2012-02-28 07:32:19 +00:00
|
|
|
*scallno = tvb_get_ntohs(tvb, offset);
|
2010-05-25 05:48:36 +00:00
|
|
|
datalen = tvb_get_ntohs(tvb, offset + 2);
|
|
|
|
|
|
|
|
rlen = MIN(tvb_length(tvb) - offset - 4, datalen);
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
2012-02-28 07:32:19 +00:00
|
|
|
call_item = proto_tree_add_text(iax2_tree, tvb, offset, rlen + 6, "Trunk call from %u", *scallno);
|
2010-05-25 05:48:36 +00:00
|
|
|
call_tree = proto_item_add_subtree(call_item, ett_iax2_trunk_call);
|
|
|
|
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_scallno, tvb, offset, 2, ENC_BIG_ENDIAN);
|
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
|
2011-10-04 22:44:31 +00:00
|
|
|
proto_tree_add_item(call_tree, hf_iax2_trunk_call_data, tvb, offset + 4, rlen, ENC_NA);
|
2010-05-25 05:48:36 +00:00
|
|
|
}
|
|
|
|
offset += 4 + rlen;
|
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
2012-02-28 07:32:19 +00:00
|
|
|
typedef struct _call_list {
|
2012-11-26 21:19:44 +00:00
|
|
|
guint16 scallno;
|
2012-02-28 07:32:19 +00:00
|
|
|
struct _call_list *next;
|
|
|
|
} call_list;
|
|
|
|
|
|
|
|
static call_list *call_list_append(call_list *list, guint16 scallno)
|
|
|
|
{
|
2013-03-18 21:16:23 +00:00
|
|
|
call_list *node = ep_new0(call_list);
|
2012-02-28 07:32:19 +00:00
|
|
|
|
|
|
|
node->scallno = scallno;
|
|
|
|
|
|
|
|
if (list) {
|
|
|
|
call_list *cur = list;
|
|
|
|
while (cur->next) {
|
|
|
|
cur = cur->next;
|
|
|
|
}
|
|
|
|
cur->next = node;
|
|
|
|
return list;
|
|
|
|
} else {
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean call_list_find(call_list *list, guint16 scallno)
|
|
|
|
{
|
|
|
|
for (; list; list = list->next) {
|
|
|
|
if (list->scallno == scallno) {
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint call_list_length(call_list *list)
|
|
|
|
{
|
|
|
|
guint count = 0;
|
|
|
|
for (; list; list = list->next) {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
return count;
|
|
|
|
}
|
2010-05-25 05:48:36 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static guint32 dissect_trunkpacket(tvbuff_t *tvb, guint32 offset,
|
|
|
|
guint16 scallno_param _U_, packet_info *pinfo,
|
|
|
|
proto_tree *iax2_tree, proto_tree *main_tree _U_)
|
2010-05-25 05:48:36 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
guint8 cmddata, trunkts;
|
|
|
|
guint nframes = 0, ncalls = 0;
|
|
|
|
proto_item *cd, *nc = NULL;
|
2010-05-25 05:48:36 +00:00
|
|
|
proto_tree *field_tree = NULL;
|
2012-11-26 21:19:44 +00:00
|
|
|
call_list *calls = NULL;
|
|
|
|
/*iax_packet_data *iax_packet;*/
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
cmddata = tvb_get_guint8(tvb, offset + 1);
|
|
|
|
trunkts = cmddata & IAX2_TRUNK_TS;
|
|
|
|
|
|
|
|
/* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 */
|
|
|
|
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
|
|
|
|
/* |F| Meta Indicator |V|Meta Command | Cmd Data (0) | */
|
|
|
|
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
|
|
|
|
/* | time-stamp | */
|
|
|
|
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
2010-05-25 05:48:36 +00:00
|
|
|
/* Meta Command */
|
2011-10-06 03:35:44 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_trunk_metacmd, tvb, offset, 1, ENC_BIG_ENDIAN);
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
/* Command data */
|
|
|
|
cd = proto_tree_add_uint(iax2_tree, hf_iax2_trunk_cmddata, tvb, offset + 1, 1, cmddata);
|
|
|
|
field_tree = proto_item_add_subtree(cd, ett_iax2_trunk_cmddata);
|
|
|
|
if (trunkts)
|
|
|
|
proto_item_append_text(cd, " (trunk timestamps)");
|
|
|
|
|
|
|
|
/* CD -> Trunk timestamp */
|
|
|
|
proto_tree_add_boolean(field_tree, hf_iax2_trunk_cmddata_ts, tvb, offset + 1, 1, cmddata);
|
|
|
|
|
|
|
|
/* Timestamp */
|
2011-10-16 23:38:49 +00:00
|
|
|
proto_tree_add_item(iax2_tree, hf_iax2_trunk_ts, tvb, offset + 2, 4, ENC_BIG_ENDIAN);
|
2010-05-25 05:48:36 +00:00
|
|
|
}
|
2011-09-21 18:55:03 +00:00
|
|
|
|
2010-05-25 05:48:36 +00:00
|
|
|
offset += 6;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (trunkts) {
|
2010-05-25 05:48:36 +00:00
|
|
|
/* Trunk calls with timestamp */
|
|
|
|
while(tvb_length_remaining(tvb, offset) >= 6) {
|
2012-02-28 07:32:19 +00:00
|
|
|
guint16 scallno;
|
2012-11-26 21:19:44 +00:00
|
|
|
offset = dissect_trunkcall_ts(tvb, offset, iax2_tree, &scallno);
|
|
|
|
if (!call_list_find(calls, scallno)) {
|
|
|
|
calls = call_list_append(calls, scallno);
|
2012-02-28 07:32:19 +00:00
|
|
|
}
|
|
|
|
nframes++;
|
2012-08-27 16:17:38 +00:00
|
|
|
}
|
2010-05-25 05:48:36 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
/* Trunk calls without timestamp */
|
|
|
|
while(tvb_length_remaining(tvb, offset) >= 4) {
|
2012-02-28 07:32:19 +00:00
|
|
|
guint16 scallno;
|
2012-11-26 21:19:44 +00:00
|
|
|
offset = dissect_trunkcall_nots(tvb, offset, iax2_tree, &scallno);
|
|
|
|
if (!call_list_find(calls, scallno)) {
|
|
|
|
calls = call_list_append(calls, scallno);
|
2012-02-28 07:32:19 +00:00
|
|
|
}
|
|
|
|
nframes++;
|
2010-05-25 05:48:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
ncalls = call_list_length(calls);
|
2012-02-28 07:32:19 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax2_tree) {
|
2010-05-25 05:48:36 +00:00
|
|
|
/* number of items */
|
|
|
|
nc = proto_tree_add_uint(iax2_tree, hf_iax2_trunk_ncalls, NULL, 0, 0, ncalls);
|
|
|
|
PROTO_ITEM_SET_GENERATED(nc);
|
|
|
|
}
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "Trunk packet with %d media frame%s for %d call%s",
|
|
|
|
nframes, plurality(nframes, "", "s"),
|
|
|
|
ncalls, plurality(ncalls, "", "s"));
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
static void process_iax_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|
|
|
gboolean video, iax_packet_data *iax_packet)
|
2005-10-02 20:59:54 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 codec = iax_packet -> codec;
|
2005-10-02 20:59:54 +00:00
|
|
|
iax_call_data *iax_call = iax_packet -> call_data;
|
|
|
|
|
2005-10-04 20:21:18 +00:00
|
|
|
#ifdef DEBUG_DESEGMENT
|
2005-10-11 19:44:59 +00:00
|
|
|
g_debug("calling process_iax_pdu; len = %u", tvb_reported_length(tvb));
|
2005-10-04 20:21:18 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (!video && iax_call && iax_call->subdissector) {
|
2005-10-02 20:59:54 +00:00
|
|
|
call_dissector(iax_call->subdissector, tvb, pinfo, tree);
|
2012-11-26 21:19:44 +00:00
|
|
|
} else if (codec != 0 && dissector_try_uint(iax2_codec_dissector_table, codec, tvb, pinfo, tree)) {
|
2005-10-04 20:21:18 +00:00
|
|
|
/* codec dissector handled our data */
|
2012-11-26 21:19:44 +00:00
|
|
|
} else {
|
2005-10-04 20:21:18 +00:00
|
|
|
/* we don't know how to dissect our data: dissect it as data */
|
2012-11-26 21:19:44 +00:00
|
|
|
call_dissector(data_handle, tvb, pinfo, tree);
|
2005-10-02 20:59:54 +00:00
|
|
|
}
|
|
|
|
|
2005-10-04 20:21:18 +00:00
|
|
|
#ifdef DEBUG_DESEGMENT
|
2005-10-11 19:44:59 +00:00
|
|
|
g_debug("called process_iax_pdu; pinfo->desegment_len=%u; pinfo->desegment_offset=%u",
|
2005-10-04 20:21:18 +00:00
|
|
|
pinfo->desegment_len, pinfo->desegment_offset);
|
|
|
|
#endif
|
2005-10-02 20:59:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void desegment_iax(tvbuff_t *tvb, packet_info *pinfo, proto_tree *iax2_tree,
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree *tree, gboolean video, iax_packet_data *iax_packet)
|
2005-10-02 20:59:54 +00:00
|
|
|
{
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_call_data *iax_call = iax_packet -> call_data;
|
2005-10-04 01:16:06 +00:00
|
|
|
iax_call_dirdata *dirdata;
|
2012-11-26 21:19:44 +00:00
|
|
|
gpointer value = NULL;
|
|
|
|
guint32 frag_offset = 0;
|
|
|
|
fragment_data *fd_head;
|
|
|
|
gboolean must_desegment = FALSE;
|
2005-10-02 20:59:54 +00:00
|
|
|
|
2005-10-11 19:44:59 +00:00
|
|
|
DISSECTOR_ASSERT(iax_call);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
pinfo->can_desegment = 2;
|
2005-10-02 20:59:54 +00:00
|
|
|
pinfo->desegment_offset = 0;
|
2012-11-26 21:19:44 +00:00
|
|
|
pinfo->desegment_len = 0;
|
2005-10-02 20:59:54 +00:00
|
|
|
|
2005-10-04 20:21:18 +00:00
|
|
|
#ifdef DEBUG_DESEGMENT
|
2005-10-11 19:44:59 +00:00
|
|
|
g_debug("dissecting packet %u", pinfo->fd->num);
|
2005-10-04 20:21:18 +00:00
|
|
|
#endif
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-10-11 19:44:59 +00:00
|
|
|
dirdata = &(iax_call->dirdata[!!(iax_packet->reversed)]);
|
2005-10-04 01:16:06 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if ((!pinfo->fd->flags.visited && (dirdata->current_frag_bytes > 0)) ||
|
|
|
|
((value = g_hash_table_lookup(iax_fid_table, GUINT_TO_POINTER(pinfo->fd->num))) != NULL)) {
|
2012-08-27 16:17:38 +00:00
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
/* then we are continuing an already-started pdu */
|
2005-10-11 19:44:59 +00:00
|
|
|
guint32 fid;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 frag_len = tvb_reported_length(tvb);
|
2005-10-11 19:44:59 +00:00
|
|
|
gboolean complete;
|
|
|
|
|
|
|
|
#ifdef DEBUG_DESEGMENT
|
|
|
|
g_debug("visited: %i; c_f_b: %u; hash: %u->%u", pinfo->fd->flags.visited?1:0,
|
2012-08-27 16:17:38 +00:00
|
|
|
dirdata->current_frag_bytes, pinfo->fd->num, dirdata->current_frag_id);
|
2005-10-11 19:44:59 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (!pinfo->fd->flags.visited) {
|
2005-10-11 19:44:59 +00:00
|
|
|
guint32 tot_len;
|
2005-10-02 20:59:54 +00:00
|
|
|
fid = dirdata->current_frag_id;
|
2005-10-11 19:44:59 +00:00
|
|
|
tot_len = dirdata->current_frag_minlen;
|
2012-08-27 16:17:38 +00:00
|
|
|
DISSECTOR_ASSERT(g_hash_table_lookup(iax_fid_table, GUINT_TO_POINTER(pinfo->fd->num)) == NULL);
|
2012-11-26 21:19:44 +00:00
|
|
|
g_hash_table_insert(iax_fid_table, GUINT_TO_POINTER(pinfo->fd->num), GUINT_TO_POINTER(fid));
|
2005-10-02 20:59:54 +00:00
|
|
|
frag_offset = dirdata->current_frag_bytes;
|
|
|
|
dirdata->current_frag_bytes += frag_len;
|
2005-10-04 20:21:18 +00:00
|
|
|
complete = dirdata->current_frag_bytes > tot_len;
|
|
|
|
#ifdef DEBUG_DESEGMENT
|
2005-10-11 19:44:59 +00:00
|
|
|
g_debug("hash: %u->%u; frag_offset: %u; c_f_b: %u; totlen: %u",
|
2012-11-26 21:19:44 +00:00
|
|
|
pinfo->fd->num, fid, frag_offset, dirdata->current_frag_bytes, tot_len);
|
2005-10-04 20:21:18 +00:00
|
|
|
#endif
|
2005-10-02 20:59:54 +00:00
|
|
|
} else {
|
|
|
|
fid = GPOINTER_TO_UINT(value);
|
2005-10-04 20:21:18 +00:00
|
|
|
/* these values are unused by fragment_add if pinfo->fd->flags.visited */
|
2005-10-02 20:59:54 +00:00
|
|
|
dirdata->current_frag_bytes = 0;
|
|
|
|
complete = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* fragment_add checks for already-added */
|
2013-03-22 23:59:54 +00:00
|
|
|
fd_head = fragment_add(&iax_reassembly_table, tvb, 0, pinfo, fid, NULL,
|
2012-11-26 21:19:44 +00:00
|
|
|
frag_offset,
|
|
|
|
frag_len, !complete);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (fd_head && (pinfo->fd->num == fd_head->reassembled_in)) {
|
2005-10-04 20:21:18 +00:00
|
|
|
gint32 old_len;
|
2009-05-13 19:46:11 +00:00
|
|
|
tvbuff_t *next_tvb = tvb_new_child_real_data(tvb, fd_head->data, fd_head->datalen, fd_head->datalen);
|
2005-10-02 20:59:54 +00:00
|
|
|
add_new_data_source(pinfo, next_tvb, "Reassembled IAX2");
|
2005-10-04 20:21:18 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
process_iax_pdu(next_tvb, pinfo, tree, video, iax_packet);
|
2005-10-04 20:21:18 +00:00
|
|
|
|
|
|
|
/* calculate the amount of data which was available to the higher-level
|
|
|
|
dissector before we added this segment; if the returned offset is
|
|
|
|
within that section, the higher-level dissector was unable to find any
|
|
|
|
pdus; if it's after that, it found one or more complete PDUs.
|
|
|
|
*/
|
2007-02-21 06:48:28 +00:00
|
|
|
old_len = (gint32)(tvb_reported_length(next_tvb) - frag_len);
|
2012-11-26 21:19:44 +00:00
|
|
|
if (pinfo->desegment_len &&
|
|
|
|
(pinfo->desegment_offset < old_len)) {
|
2009-10-12 20:57:01 +00:00
|
|
|
/* oops, it wasn't actually complete */
|
2013-03-22 23:59:54 +00:00
|
|
|
fragment_set_partial_reassembly(&iax_reassembly_table, pinfo, fid, NULL);
|
2012-11-26 21:19:44 +00:00
|
|
|
if (pinfo->desegment_len == DESEGMENT_ONE_MORE_SEGMENT) {
|
2007-02-21 06:48:28 +00:00
|
|
|
/* only one more byte should be enough for a retry */
|
|
|
|
dirdata->current_frag_minlen = fd_head->datalen + 1;
|
|
|
|
} else {
|
|
|
|
dirdata->current_frag_minlen = fd_head->datalen + pinfo->desegment_len;
|
|
|
|
}
|
2005-10-02 20:59:54 +00:00
|
|
|
} else {
|
2009-10-12 20:57:01 +00:00
|
|
|
/* we successfully dissected some data; create the proto tree items for
|
|
|
|
* the fragments, and flag any remaining data for desegmentation */
|
|
|
|
|
|
|
|
proto_item *iax_tree_item, *frag_tree_item;
|
|
|
|
/* this nargery is to insert the fragment tree into the main tree
|
|
|
|
* between the IAX protocol entry and the subdissector entry */
|
|
|
|
show_fragment_tree(fd_head, &iax2_fragment_items, tree, pinfo, next_tvb, &frag_tree_item);
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_tree_item = proto_item_get_parent(proto_tree_get_parent(iax2_tree));
|
|
|
|
if (frag_tree_item && iax_tree_item)
|
|
|
|
proto_tree_move_item(tree, iax_tree_item, frag_tree_item);
|
2009-10-12 20:57:01 +00:00
|
|
|
|
|
|
|
dirdata->current_frag_minlen = dirdata->current_frag_id = dirdata->current_frag_bytes = 0;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (pinfo->desegment_len) {
|
2009-10-12 20:57:01 +00:00
|
|
|
/* there's a bit of data left to desegment */
|
|
|
|
must_desegment = TRUE;
|
|
|
|
/* make desegment_offset relative to our tvb */
|
|
|
|
pinfo->desegment_offset -= old_len;
|
|
|
|
}
|
2005-10-11 19:44:59 +00:00
|
|
|
|
|
|
|
/* don't add a 'reassembled in' item for this pdu */
|
|
|
|
fd_head = NULL;
|
2005-10-02 20:59:54 +00:00
|
|
|
}
|
|
|
|
}
|
2005-10-04 20:21:18 +00:00
|
|
|
} else {
|
|
|
|
/* This segment was not found in our table, so it doesn't
|
|
|
|
contain a continuation of a higher-level PDU.
|
|
|
|
Call the normal subdissector.
|
|
|
|
*/
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
process_iax_pdu(tvb, pinfo, tree, video, iax_packet);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (pinfo->desegment_len) {
|
2005-10-04 20:21:18 +00:00
|
|
|
/* the higher-level dissector has asked for some more data - ie,
|
|
|
|
the end of this segment does not coincide with the end of a
|
|
|
|
higher-level PDU. */
|
|
|
|
must_desegment = TRUE;
|
|
|
|
}
|
2005-10-11 19:44:59 +00:00
|
|
|
|
2005-10-04 20:21:18 +00:00
|
|
|
fd_head = NULL;
|
2005-10-02 20:59:54 +00:00
|
|
|
}
|
|
|
|
|
2005-10-04 20:21:18 +00:00
|
|
|
/* must_desegment is set if the end of this segment (or the whole of it)
|
|
|
|
* contained the start of a higher-level PDU; we must add whatever is left of
|
2005-10-11 19:44:59 +00:00
|
|
|
* this segment (after pinfo->desegment_offset) to a fragment table for disassembly. */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (must_desegment) {
|
2009-10-12 20:57:01 +00:00
|
|
|
guint32 fid = pinfo->fd->num; /* a new fragment id */
|
|
|
|
guint32 deseg_offset = pinfo->desegment_offset;
|
2012-11-26 21:19:44 +00:00
|
|
|
guint32 frag_len = tvb_reported_length_remaining(tvb, deseg_offset);
|
2009-10-12 20:57:01 +00:00
|
|
|
dirdata->current_frag_id = fid;
|
|
|
|
dirdata->current_frag_bytes = frag_len;
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (pinfo->desegment_len == DESEGMENT_ONE_MORE_SEGMENT) {
|
2009-10-12 20:57:01 +00:00
|
|
|
/* only one more byte should be enough for a retry */
|
|
|
|
dirdata->current_frag_minlen = frag_len + 1;
|
|
|
|
} else {
|
|
|
|
dirdata->current_frag_minlen = frag_len + pinfo->desegment_len;
|
|
|
|
}
|
2007-02-21 06:48:28 +00:00
|
|
|
|
2013-03-22 23:59:54 +00:00
|
|
|
fd_head = fragment_add(&iax_reassembly_table,
|
|
|
|
tvb, deseg_offset, pinfo, fid, NULL,
|
2012-11-26 21:19:44 +00:00
|
|
|
0, frag_len, TRUE);
|
2005-10-04 20:21:18 +00:00
|
|
|
#ifdef DEBUG_DESEGMENT
|
2009-10-12 20:57:01 +00:00
|
|
|
g_debug("Start offset of undissected bytes: %u; "
|
|
|
|
"Bytes remaining in this segment: %u; min required bytes: %u\n",
|
|
|
|
deseg_offset, frag_len, frag_len + pinfo->desegment_len);
|
2005-10-04 20:21:18 +00:00
|
|
|
#endif
|
2005-10-02 20:59:54 +00:00
|
|
|
}
|
|
|
|
|
2005-10-11 19:44:59 +00:00
|
|
|
/* add a 'reassembled in' item if necessary */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (fd_head != NULL) {
|
2009-10-12 20:57:01 +00:00
|
|
|
guint32 deseg_offset = pinfo->desegment_offset;
|
2012-11-26 21:19:44 +00:00
|
|
|
if (fd_head->reassembled_in != 0 &&
|
|
|
|
!(fd_head->flags & FD_PARTIAL_REASSEMBLY)) {
|
2009-10-12 20:57:01 +00:00
|
|
|
proto_item *iax_tree_item;
|
2012-11-26 21:19:44 +00:00
|
|
|
iax_tree_item = proto_tree_add_uint(tree, hf_iax2_reassembled_in,
|
|
|
|
tvb, deseg_offset, tvb_reported_length_remaining(tvb, deseg_offset),
|
|
|
|
fd_head->reassembled_in);
|
2009-10-12 20:57:01 +00:00
|
|
|
PROTO_ITEM_SET_GENERATED(iax_tree_item);
|
|
|
|
} else {
|
|
|
|
/* this fragment is never reassembled */
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_text(tree, tvb, deseg_offset, -1,
|
|
|
|
"IAX2 fragment, unfinished");
|
2009-10-12 20:57:01 +00:00
|
|
|
}
|
2005-10-02 20:59:54 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (pinfo->desegment_offset == 0) {
|
2009-08-09 07:59:51 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IAX2");
|
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "[IAX2 segment of a reassembled PDU]");
|
2005-10-02 20:59:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pinfo->can_desegment = 0;
|
|
|
|
pinfo->desegment_offset = 0;
|
|
|
|
pinfo->desegment_len = 0;
|
|
|
|
}
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
static void dissect_payload(tvbuff_t *tvb, guint32 offset,
|
2009-10-12 20:57:01 +00:00
|
|
|
packet_info *pinfo, proto_tree *iax2_tree,
|
2011-04-22 17:33:53 +00:00
|
|
|
proto_tree *tree, guint32 ts _U_, gboolean video,
|
2009-10-12 20:57:01 +00:00
|
|
|
iax_packet_data *iax_packet)
|
2004-06-25 06:31:47 +00:00
|
|
|
{
|
2006-06-23 12:04:00 +00:00
|
|
|
#if 0
|
2012-11-26 21:19:44 +00:00
|
|
|
gboolean out_of_order = FALSE;
|
2006-06-23 12:04:00 +00:00
|
|
|
#endif
|
2012-11-26 21:19:44 +00:00
|
|
|
tvbuff_t *sub_tvb;
|
|
|
|
guint32 codec = iax_packet -> codec;
|
|
|
|
guint32 nbytes;
|
|
|
|
iax_call_data *iax_call = iax_packet -> call_data;
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (offset >= tvb_reported_length(tvb)) {
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, ", empty frame");
|
2004-06-25 06:31:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-08-16 12:36:22 +00:00
|
|
|
sub_tvb = tvb_new_subset_remaining(tvb, offset);
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* XXX shouldn't pass through out-of-order packets. */
|
|
|
|
|
2012-11-26 21:19:44 +00:00
|
|
|
if (check_col(pinfo->cinfo, COL_INFO)) {
|
|
|
|
if (!video && iax_call && iax_call -> dataformat != 0) {
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", data, format %s",
|
|
|
|
val_to_str(iax_call -> dataformat,
|
|
|
|
iax_dataformats, "unknown (0x%02x)"));
|
2006-06-23 12:04:00 +00:00
|
|
|
#if 0
|
2012-11-26 21:19:44 +00:00
|
|
|
if (out_of_order)
|
|
|
|
col_append_str(pinfo->cinfo, COL_INFO, " (out-of-order packet)");
|
2006-06-23 12:04:00 +00:00
|
|
|
#endif
|
2004-06-25 06:31:47 +00:00
|
|
|
} else {
|
2012-11-26 21:19:44 +00:00
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, ", %s",
|
|
|
|
val_to_str_ext(codec, &codec_types_ext, "unknown (0x%02x)"));
|
2004-01-27 01:35:25 +00:00
|
|
|
}
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
nbytes = tvb_reported_length(sub_tvb);
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_tree_add_text(iax2_tree, sub_tvb, 0, -1,
|
|
|
|
"IAX2 payload (%u byte%s)", nbytes,
|
|
|
|
plurality(nbytes, "", "s"));
|
2009-09-06 14:25:47 +00:00
|
|
|
|
|
|
|
iax2_info->payload_len = nbytes;
|
2009-03-11 06:43:46 +00:00
|
|
|
iax2_info->payload_data = tvb_get_ptr(sub_tvb, 0, -1);
|
2005-10-11 19:44:59 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* pass the rest of the block to a subdissector */
|
2012-11-26 21:19:44 +00:00
|
|
|
if (iax_packet->call_data)
|
|
|
|
desegment_iax(sub_tvb, pinfo, iax2_tree, tree, video, iax_packet);
|
2005-10-11 19:44:59 +00:00
|
|
|
else
|
2012-11-26 21:19:44 +00:00
|
|
|
process_iax_pdu(sub_tvb, pinfo, tree, video, iax_packet);
|
2004-06-25 06:31:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Init routines
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* called at the start of a capture. We should clear out our static, per-capture
|
|
|
|
* data.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void
|
|
|
|
iax_init_protocol(void)
|
|
|
|
{
|
|
|
|
iax_init_hash();
|
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
void
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_register_iax2(void)
|
2004-01-27 01:35:25 +00:00
|
|
|
{
|
2004-06-25 06:31:47 +00:00
|
|
|
/* A header field is something you can search/filter on.
|
2009-09-06 14:25:47 +00:00
|
|
|
*
|
2004-06-25 06:31:47 +00:00
|
|
|
* We create a structure to register our fields. It consists of an
|
|
|
|
* array of hf_register_info structures, each of which are of the format
|
|
|
|
* {&(field id), {name, abbrev, type, display, strings, bitmask, blurb, HFILL}}.
|
|
|
|
*/
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
static hf_register_info hf[] = {
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_packet_type,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Packet type", "iax2.packet_type",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(iax_packet_types), 0,
|
2010-05-25 05:48:36 +00:00
|
|
|
"Full/minivoice/minivideo/trunk packet",
|
2004-06-25 06:31:47 +00:00
|
|
|
HFILL}},
|
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_callno,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Call identifier", "iax2.call",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0,
|
|
|
|
"This is the identifier Wireshark assigns to identify this call."
|
|
|
|
" It does not correspond to any real field in the protocol",
|
|
|
|
HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_scallno,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Source call", "iax2.src_call",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x7FFF,
|
2004-06-25 06:31:47 +00:00
|
|
|
"src_call holds the number of this call at the packet source pbx",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
/* FIXME could this be turned into a FRAMENUM field? */
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_dcallno,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Destination call", "iax2.dst_call",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x7FFF,
|
2004-06-25 06:31:47 +00:00
|
|
|
"dst_call holds the number of this call at the packet destination",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_retransmission,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Retransmission", "iax2.retransmission",
|
|
|
|
FT_BOOLEAN, 16, NULL, 0x8000,
|
|
|
|
"retransmission is set if this packet is a retransmission of an earlier failed packet",
|
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_ts,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Timestamp", "iax2.timestamp",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
"timestamp is the time, in ms after the start of this call, at which this packet was transmitted",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_minits,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Timestamp", "iax2.timestamp",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
"timestamp is the time, in ms after the start of this call, at which this packet was transmitted",
|
2004-06-25 06:31:47 +00:00
|
|
|
HFILL}},
|
|
|
|
|
|
|
|
{&hf_iax2_minividts,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Timestamp", "iax2.timestamp",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x7FFF,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
"timestamp is the time, in ms after the start of this call, at which this packet was transmitted",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_absts,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Absolute Time", "iax2.abstime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
|
2010-12-06 01:34:58 +00:00
|
|
|
"The absolute time of this packet (calculated by adding the IAX timestamp to the start time of this call)",
|
2005-08-03 20:37:28 +00:00
|
|
|
HFILL}},
|
|
|
|
|
|
|
|
{&hf_iax2_lateness,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Lateness", "iax2.lateness",
|
|
|
|
FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
|
2005-08-03 20:37:28 +00:00
|
|
|
"The lateness of this packet compared to its timestamp",
|
|
|
|
HFILL}},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_iax2_minividmarker,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Marker", "iax2.video.marker",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x8000,
|
2004-06-25 06:31:47 +00:00
|
|
|
"RTP end-of-frame marker",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_oseqno,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Outbound seq.no.", "iax2.oseqno",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"oseqno is the sequence no of this packet. The first packet has oseqno==0,"
|
|
|
|
" and subsequent packets increment the oseqno by 1",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_iseqno,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Inbound seq.no.", "iax2.iseqno",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2006-01-05 13:01:08 +00:00
|
|
|
"iseqno is the sequence no of the last successfully received packet",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_type,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Type", "iax2.type",
|
|
|
|
FT_UINT8, BASE_DEC | BASE_EXT_STRING, &iax_frame_types_ext, 0x0,
|
2004-06-25 06:31:47 +00:00
|
|
|
"For full IAX2 frames, type is the type of frame",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Unknown subclass", "iax2.subclass",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
2005-08-03 20:37:28 +00:00
|
|
|
"Subclass of unknown type of full IAX2 frame",
|
|
|
|
HFILL}},
|
|
|
|
|
|
|
|
{&hf_iax2_dtmf_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"DTMF subclass (digit)", "iax2.dtmf.subclass",
|
|
|
|
FT_STRINGZ, BASE_NONE, NULL, 0x0,
|
2005-08-03 20:37:28 +00:00
|
|
|
"DTMF subclass gives the DTMF digit",
|
2004-01-27 01:35:25 +00:00
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_cmd_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Control subclass", "iax2.control.subclass",
|
|
|
|
FT_UINT8, BASE_DEC | BASE_EXT_STRING, &iax_cmd_subclasses_ext, 0x0,
|
|
|
|
"This gives the command number for a Control packet.",
|
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
{&hf_iax2_iax_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"IAX subclass", "iax2.iax.subclass",
|
|
|
|
FT_UINT8, BASE_DEC | BASE_EXT_STRING, &iax_iax_subclasses_ext, 0x0,
|
|
|
|
"IAX subclass gives the command number for IAX signaling packets",
|
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_voice_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Voice Subclass (compressed codec no)", "iax2.voice.subclass",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_voice_codec,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"CODEC", "iax2.voice.codec",
|
|
|
|
FT_UINT32, BASE_HEX | BASE_EXT_STRING, &codec_types_ext, 0x0,
|
|
|
|
"CODEC gives the codec used to encode audio data",
|
|
|
|
HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_video_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Video Subclass (compressed codec no)", "iax2.video.subclass",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0xBF,
|
|
|
|
NULL, HFILL}},
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_iax2_marker,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Marker", "iax2.video.marker",
|
|
|
|
FT_BOOLEAN, 8, NULL, 0x40,
|
2004-06-25 06:31:47 +00:00
|
|
|
"RTP end-of-frame marker",
|
|
|
|
HFILL}},
|
|
|
|
|
|
|
|
{&hf_iax2_video_codec,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"CODEC", "iax2.video.codec",
|
|
|
|
FT_UINT32, BASE_HEX | BASE_EXT_STRING, &codec_types_ext, 0,
|
|
|
|
"The codec used to encode video data",
|
|
|
|
HFILL}},
|
2007-06-29 19:00:46 +00:00
|
|
|
|
|
|
|
{&hf_iax2_modem_csub,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Modem subclass", "iax2.modem.subclass",
|
|
|
|
FT_UINT8, BASE_DEC, VALS(iax_modem_subclasses), 0x0,
|
|
|
|
"Modem subclass gives the type of modem",
|
|
|
|
HFILL}},
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2010-05-25 05:48:36 +00:00
|
|
|
{&hf_iax2_trunk_ts,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Timestamp", "iax2.timestamp",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"timestamp is the time, in ms after the start of Command data this call,"
|
|
|
|
" at which this trunk packet was transmitted",
|
2010-05-25 05:48:36 +00:00
|
|
|
HFILL}},
|
|
|
|
|
|
|
|
{&hf_iax2_trunk_metacmd,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Meta command", "iax2.trunk.metacmd",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x7F,
|
|
|
|
"Meta command indicates whether or not the Meta Frame is a trunk.",
|
|
|
|
HFILL}},
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
{&hf_iax2_trunk_cmddata,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Command data", "iax2.trunk.cmddata",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"Flags for options that apply to a trunked call",
|
|
|
|
HFILL}},
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
{&hf_iax2_trunk_cmddata_ts,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Trunk timestamps", "iax2.trunk.cmddata.ts",
|
|
|
|
FT_BOOLEAN, 8, NULL, IAX2_TRUNK_TS,
|
|
|
|
"True: calls do each include their own timestamp",
|
|
|
|
HFILL}},
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
{&hf_iax2_trunk_call_len,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Data length", "iax2.trunk.call.len",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
"Trunk call data length in octets",
|
|
|
|
HFILL}},
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
{&hf_iax2_trunk_call_scallno,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Source call number", "iax2.trunk.call.scallno",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x7FFF,
|
|
|
|
"Trunk call source call number",
|
|
|
|
HFILL}},
|
2010-05-25 05:48:36 +00:00
|
|
|
|
|
|
|
{&hf_iax2_trunk_call_ts,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Timestamp", "iax2.trunk.call.ts",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-25 05:48:36 +00:00
|
|
|
"timestamp is the time, in ms after the start of this call, at which this packet was transmitted",
|
|
|
|
HFILL}},
|
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
{&hf_iax2_trunk_call_data,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Data", "iax2.trunk.call.payload",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
2011-08-16 19:20:25 +00:00
|
|
|
"Payload carried by this trunked packet.",
|
|
|
|
HFILL}},
|
|
|
|
|
2010-05-25 05:48:36 +00:00
|
|
|
{&hf_iax2_trunk_ncalls,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Number of calls", "iax2.trunk.ncalls",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
2010-05-25 05:48:36 +00:00
|
|
|
"Number of calls in this trunk packet",
|
|
|
|
HFILL}},
|
2011-08-16 19:20:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/*
|
|
|
|
* Decoding for the ies
|
|
|
|
*/
|
|
|
|
|
|
|
|
{&hf_IAX_IE_APPARENTADDR_SINFAMILY,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Family", "iax2.iax.app_addr.sinfamily",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_IAX_IE_APPARENTADDR_SINPORT,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Port", "iax2.iax.app_addr.sinport",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_IAX_IE_APPARENTADDR_SINADDR,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Address", "iax2.iax.app_addr.sinaddr",
|
|
|
|
FT_IPv4, BASE_NONE, NULL, 0,
|
|
|
|
NULL, HFILL }},
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLED_NUMBER],
|
2004-06-25 06:31:47 +00:00
|
|
|
{"Number/extension being called", "iax2.iax.called_number",
|
2004-01-27 01:35:25 +00:00
|
|
|
FT_STRING,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
BASE_NONE, NULL, 0x0, NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLING_NUMBER],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Calling number", "iax2.iax.calling_number",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLING_ANI],
|
2004-06-25 06:31:47 +00:00
|
|
|
{"Calling number ANI for billing", "iax2.iax.calling_ani",
|
2012-11-26 21:19:44 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLING_NAME],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Name of caller", "iax2.iax.calling_name",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLED_CONTEXT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Context for number", "iax2.iax.called_context",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_USERNAME],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Username (peer or user) for authentication", "iax2.iax.username",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_PASSWORD],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Password for authentication", "iax2.iax.password",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CAPABILITY],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Actual codec capability", "iax2.iax.capability",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_FORMAT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Desired codec format", "iax2.iax.format",
|
|
|
|
FT_UINT32, BASE_HEX | BASE_EXT_STRING, &codec_types_ext, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_LANGUAGE],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Desired language", "iax2.iax.language",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_VERSION],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Protocol version", "iax2.iax.version",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_ADSICPE],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"CPE ADSI capability", "iax2.iax.cpe_adsi",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_DNID],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Originally dialed DNID", "iax2.iax.dnid",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_AUTHMETHODS],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Authentication method(s)", "iax2.iax.auth.methods",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CHALLENGE],
|
2004-06-25 06:31:47 +00:00
|
|
|
{"Challenge data for MD5/RSA", "iax2.iax.auth.challenge",
|
2012-11-26 21:19:44 +00:00
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_MD5_RESULT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"MD5 challenge result", "iax2.iax.auth.md5",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RSA_RESULT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"RSA challenge result", "iax2.iax.auth.rsa",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_REFRESH],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"When to refresh registration", "iax2.iax.refresh",
|
|
|
|
FT_INT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_DPSTATUS],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Dialplan status", "iax2.iax.dialplan_status",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLNO],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Call number of peer", "iax2.iax.call_no",
|
|
|
|
FT_UINT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CAUSE],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Cause", "iax2.iax.cause",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_IAX_UNKNOWN],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Unknown IAX command", "iax2.iax.iax_unknown",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_MSGCOUNT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"How many messages waiting", "iax2.iax.msg_count",
|
|
|
|
FT_INT16, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_AUTOANSWER],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Request auto-answering", "iax2.iax.autoanswer",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_MUSICONHOLD],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Request musiconhold with QUELCH", "iax2.iax.moh",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_TRANSFERID],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Transfer Request Identifier", "iax2.iax.transferid",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RDNIS],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Referring DNIS", "iax2.iax.rdnis",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_PROVISIONING],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Provisioning info", "iax2.iax.provisioning",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_AESPROVISIONING],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"AES Provisioning info", "iax2.iax.aesprovisioning",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_DATETIME],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Date/Time", "iax2.iax.datetime.raw",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-08-03 20:37:28 +00:00
|
|
|
|
|
|
|
{&hf_iax2_ie_datetime,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Date/Time", "iax2.iax.datetime",
|
|
|
|
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_DEVICETYPE],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Device type", "iax2.iax.devicetype",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_SERVICEIDENT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Service identifier", "iax2.iax.serviceident",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_FIRMWAREVER],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Firmware version", "iax2.iax.firmwarever",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_FWBLOCKDESC],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Firmware block description", "iax2.iax.fwblockdesc",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_FWBLOCKDATA],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Firmware block of data", "iax2.iax.fwblockdata",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_PROVVER],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Provisioning version", "iax2.iax.provver",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLINGPRES],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Calling presentation", "iax2.iax.callingpres",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLINGTON],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Calling type of number", "iax2.iax.callington",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CALLINGTNS],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Calling transit network select", "iax2.iax.callingtns",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_SAMPLINGRATE],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Supported sampling rates", "iax2.iax.samplingrate",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CAUSECODE],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Hangup cause", "iax2.iax.causecode",
|
2012-11-27 00:11:43 +00:00
|
|
|
FT_UINT8, BASE_HEX | BASE_EXT_STRING, &iax_causecodes_ext, 0x0,
|
2012-11-26 21:19:44 +00:00
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_ENCRYPTION],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Encryption format", "iax2.iax.encryption",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_ENCKEY],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Encryption key", "iax2.iax.enckey",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_CODEC_PREFS],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Codec negotiation", "iax2.iax.codecprefs",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RR_JITTER],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Received jitter (as in RFC1889)", "iax2.iax.rrjitter",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RR_LOSS],
|
2005-04-04 05:10:45 +00:00
|
|
|
{"Received loss (high byte loss pct, low 24 bits loss count, as in rfc1889)", "iax2.iax.rrloss",
|
2012-11-26 21:19:44 +00:00
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RR_PKTS],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Total frames received", "iax2.iax.rrpkts",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RR_DELAY],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Max playout delay in ms for received frames", "iax2.iax.rrdelay",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RR_DROPPED],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Dropped frames (presumably by jitterbuffer)", "iax2.iax.rrdropped",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_RR_OOO],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Frame received out of order", "iax2.iax.rrooo",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
NULL, HFILL}},
|
2005-04-04 05:10:45 +00:00
|
|
|
|
2005-08-03 20:37:28 +00:00
|
|
|
{&hf_iax2_ies[IAX_IE_DATAFORMAT],
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Data call format", "iax2.iax.dataformat",
|
|
|
|
FT_UINT32, BASE_HEX, VALS(iax_dataformats), 0x0,
|
|
|
|
NULL, HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_IAX_IE_UNKNOWN_BYTE,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Unknown", "iax2.iax.unknownbyte",
|
|
|
|
FT_UINT8, BASE_HEX, NULL, 0x0,
|
|
|
|
"Raw data for unknown IEs", HFILL}},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_IAX_IE_UNKNOWN_I16,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Unknown", "iax2.iax.unknownshort",
|
|
|
|
FT_UINT16, BASE_HEX, NULL, 0x0,
|
|
|
|
"Raw data for unknown IEs", HFILL}},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_IAX_IE_UNKNOWN_I32,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Unknown", "iax2.iax.unknownlong",
|
|
|
|
FT_UINT32, BASE_HEX, NULL, 0x0,
|
|
|
|
"Raw data for unknown IEs", HFILL}},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_IAX_IE_UNKNOWN_BYTES,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Unknown", "iax2.iax.unknownstring",
|
|
|
|
FT_STRING, BASE_NONE, NULL, 0x0,
|
|
|
|
"Raw data for unknown IEs", HFILL}},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* capabilities */
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_iax2_cap_g723_1,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"G.723.1 compression", "iax2.cap.g723_1",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_G723_1,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_gsm,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"GSM compression", "iax2.cap.gsm",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_GSM,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_ulaw,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Raw mu-law data (G.711)", "iax2.cap.ulaw",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_ULAW,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_alaw,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Raw A-law data (G.711)", "iax2.cap.alaw",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_ALAW,
|
|
|
|
NULL, HFILL } },
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2011-12-09 23:14:14 +00:00
|
|
|
{&hf_iax2_cap_g726_aal2,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"G.726 compression (AAL2 packing)", "iax2.cap.g726_aal2",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_G726_AAL2,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_adpcm,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"ADPCM", "iax2.cap.adpcm",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_ADPCM,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_iax2_cap_slinear,
|
2009-09-06 14:25:47 +00:00
|
|
|
{"Raw 16-bit Signed Linear (8000 Hz) PCM", "iax2.cap.slinear",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_SLINEAR,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_lpc10,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"LPC10, 180 samples/frame",
|
|
|
|
"iax2.cap.lpc10", FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),
|
|
|
|
AST_FORMAT_LPC10, NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_g729a,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"G.729a Audio", "iax2.cap.g729a",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_G729A,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_speex,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"SPEEX Audio", "iax2.cap.speex",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_SPEEX,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_ilbc,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"iLBC Free compressed Audio", "iax2.cap.ilbc",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_ILBC,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
2011-12-09 23:14:14 +00:00
|
|
|
{&hf_iax2_cap_g726,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"ADPCM (G.726, 32kbps, RFC3551 codeword packing)", "iax2.cap.g726",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_G726,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_cap_g722,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"G.722 wideband audio", "iax2.cap.g722",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_G722,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_cap_siren7,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"G.722.1 (also known as Siren7, 32kbps assumed)", "iax2.cap.siren7",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_SIREN7,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_cap_siren14,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"G.722.1 Annex C (also known as Siren14, 48kbps assumed)", "iax2.cap.siren14",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_SIREN14,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_cap_slinear16,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Raw 16-bit Signed Linear (16000 Hz) PCM", "iax2.cap.slinear16",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_SLINEAR16,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
{&hf_iax2_cap_jpeg,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"JPEG images", "iax2.cap.jpeg",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_JPEG,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_png,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"PNG images", "iax2.cap.png",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_PNG,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_h261,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"H.261 video", "iax2.cap.h261",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_H261,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2004-06-25 06:31:47 +00:00
|
|
|
|
|
|
|
{&hf_iax2_cap_h263,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"H.263 video", "iax2.cap.h263",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_H263,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2005-10-02 20:59:54 +00:00
|
|
|
|
2011-12-09 23:14:14 +00:00
|
|
|
{&hf_iax2_cap_h263_plus,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"H.263+ video", "iax2.cap.h263_plus",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_H263_PLUS,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_cap_h264,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"H.264 video", "iax2.cap.h264",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_H264,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_cap_mpeg4,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"MPEG4 video", "iax2.cap.mpeg4",
|
|
|
|
FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), AST_FORMAT_MP4_VIDEO,
|
2011-12-09 23:14:14 +00:00
|
|
|
NULL, HFILL }},
|
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
/* reassembly stuff */
|
|
|
|
{&hf_iax2_fragments,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"IAX2 Fragments", "iax2.fragments",
|
|
|
|
FT_NONE, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2005-10-02 20:59:54 +00:00
|
|
|
|
|
|
|
{&hf_iax2_fragment,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"IAX2 Fragment data", "iax2.fragment",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }},
|
2005-10-02 20:59:54 +00:00
|
|
|
|
|
|
|
{&hf_iax2_fragment_overlap,
|
2012-11-26 21:19:44 +00:00
|
|
|
{"Fragment overlap", "iax2.fragment.overlap",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Fragment overlaps with other fragments", HFILL }},
|
2005-10-02 20:59:54 +00:00
|
|
|
|
|
|
|
{&hf_iax2_fragment_overlap_conflict,
|
|
|
|
{"Conflicting data in fragment overlap", "iax2.fragment.overlap.conflict",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Overlapping fragments contained conflicting data", HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_fragment_multiple_tails,
|
|
|
|
{"Multiple tail fragments found", "iax2.fragment.multipletails",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Several tails were found when defragmenting the packet", HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_fragment_too_long_fragment,
|
|
|
|
{"Fragment too long", "iax2.fragment.toolongfragment",
|
|
|
|
FT_BOOLEAN, BASE_NONE, NULL, 0x0,
|
|
|
|
"Fragment contained data past end of packet", HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_fragment_error,
|
|
|
|
{"Defragmentation error", "iax2.fragment.error",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
|
|
|
"Defragmentation error due to illegal fragments", HFILL }},
|
|
|
|
|
2011-01-30 21:01:07 +00:00
|
|
|
{&hf_iax2_fragment_count,
|
|
|
|
{"Fragment count", "iax2.fragment.count",
|
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
NULL, HFILL }},
|
|
|
|
|
2005-10-02 20:59:54 +00:00
|
|
|
{&hf_iax2_reassembled_in,
|
|
|
|
{"IAX2 fragment, reassembled in frame", "iax2.reassembled_in",
|
|
|
|
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
|
2010-02-02 16:01:52 +00:00
|
|
|
"This IAX2 packet is reassembled in this frame", HFILL }},
|
|
|
|
|
|
|
|
{&hf_iax2_reassembled_length,
|
2010-02-06 18:20:21 +00:00
|
|
|
{"Reassembled IAX2 length", "iax2.reassembled.length",
|
2010-02-02 16:01:52 +00:00
|
|
|
FT_UINT32, BASE_DEC, NULL, 0x0,
|
|
|
|
"The total length of the reassembled payload", HFILL }}
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_iax2,
|
2004-06-25 06:31:47 +00:00
|
|
|
&ett_iax2_full_mini_subtree,
|
|
|
|
&ett_iax2_type,
|
|
|
|
&ett_iax2_ie,
|
2004-02-13 19:15:38 +00:00
|
|
|
&ett_iax2_codecs,
|
2005-10-02 20:59:54 +00:00
|
|
|
&ett_iax2_ies_apparent_addr,
|
|
|
|
&ett_iax2_fragment,
|
2010-05-25 05:48:36 +00:00
|
|
|
&ett_iax2_fragments,
|
|
|
|
&ett_iax2_trunk_cmddata,
|
|
|
|
&ett_iax2_trunk_call
|
2004-01-27 01:35:25 +00:00
|
|
|
};
|
|
|
|
|
2011-08-16 19:20:25 +00:00
|
|
|
/* initialize the hf_iax2_ies[] array to -1 */
|
2012-11-26 21:19:44 +00:00
|
|
|
memset(hf_iax2_ies, 0xff, sizeof(hf_iax2_ies));
|
2005-08-03 20:37:28 +00:00
|
|
|
|
2004-01-27 01:35:25 +00:00
|
|
|
proto_iax2 =
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_register_protocol("Inter-Asterisk eXchange v2", "IAX2", "iax2");
|
|
|
|
proto_register_field_array(proto_iax2, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
register_dissector("iax2", dissect_iax2, proto_iax2);
|
|
|
|
|
|
|
|
iax2_codec_dissector_table = register_dissector_table(
|
2012-11-26 21:19:44 +00:00
|
|
|
"iax2.codec", "IAX codec number", FT_UINT32, BASE_HEX);
|
2004-06-25 06:31:47 +00:00
|
|
|
iax2_dataformat_dissector_table = register_dissector_table(
|
2012-11-26 21:19:44 +00:00
|
|
|
"iax2.dataformat", "IAX dataformat number", FT_UINT32, BASE_HEX);
|
2009-09-06 14:25:47 +00:00
|
|
|
|
2004-06-25 06:31:47 +00:00
|
|
|
/* register our init routine to be called at the start of a capture,
|
|
|
|
to clear out our hash tables etc */
|
|
|
|
register_init_routine(&iax_init_protocol);
|
2009-03-11 06:43:46 +00:00
|
|
|
iax2_tap = register_tap("IAX2");
|
2004-01-27 01:35:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-11-26 21:19:44 +00:00
|
|
|
proto_reg_handoff_iax2(void)
|
2004-01-27 01:35:25 +00:00
|
|
|
{
|
2012-11-26 21:19:44 +00:00
|
|
|
dissector_handle_t v110_handle;
|
2010-04-28 16:09:25 +00:00
|
|
|
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("udp.port", IAX2_PORT, find_dissector("iax2"));
|
2009-11-04 16:40:52 +00:00
|
|
|
v110_handle = find_dissector("v110");
|
2012-11-26 21:19:44 +00:00
|
|
|
if (v110_handle)
|
2011-09-21 18:55:03 +00:00
|
|
|
dissector_add_uint("iax2.dataformat", AST_DATAFORMAT_V110, v110_handle);
|
2004-06-25 06:31:47 +00:00
|
|
|
data_handle = find_dissector("data");
|
|
|
|
}
|
2004-01-27 01:35:25 +00:00
|
|
|
|
2009-09-06 14:25:47 +00:00
|
|
|
/*
|
2009-10-12 20:57:01 +00:00
|
|
|
* Editor modelines
|
2004-06-25 06:31:47 +00:00
|
|
|
*
|
|
|
|
* Local Variables:
|
|
|
|
* c-basic-offset: 2
|
2010-04-28 16:09:25 +00:00
|
|
|
* tab-width: 8
|
2009-10-12 20:57:01 +00:00
|
|
|
* indent-tabs-mode: nil
|
2004-06-25 06:31:47 +00:00
|
|
|
* End:
|
2005-10-02 20:59:54 +00:00
|
|
|
*
|
2011-09-21 17:49:11 +00:00
|
|
|
* ex: set shiftwidth=2 tabstop=8 expandtab:
|
2010-04-28 16:09:25 +00:00
|
|
|
* :indentSize=2:tabSize=8:noTabs=true:
|
2004-06-25 06:31:47 +00:00
|
|
|
*/
|