2005-01-08 15:49:37 +00:00
|
|
|
/* packet-amr.c
|
2005-01-08 20:54:23 +00:00
|
|
|
* Routines for AMR dissection
|
2008-01-07 19:16:26 +00:00
|
|
|
* Copyright 2005-2008, Anders Broman <anders.broman[at]ericsson.com>
|
2005-01-08 15:49:37 +00:00
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-01-08 15:49:37 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
2005-01-08 20:54:23 +00:00
|
|
|
*
|
2005-01-08 15:49:37 +00:00
|
|
|
* References:
|
2006-11-01 22:58:41 +00:00
|
|
|
* RFC 3267 http://www.ietf.org/rfc/rfc3267.txt?number=3267
|
2007-06-08 05:04:54 +00:00
|
|
|
* 3GPP TS 26.101 for AMR-NB, 3GPP TS 26.201 for AMR-WB
|
2005-01-08 15:49:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2005-09-19 19:11:50 +00:00
|
|
|
#include <epan/proto.h>
|
2007-06-08 05:04:54 +00:00
|
|
|
#include <epan/expert.h>
|
2009-04-06 16:53:41 +00:00
|
|
|
#include <epan/oids.h>
|
2008-01-07 19:16:26 +00:00
|
|
|
#include <epan/asn1.h>
|
2005-09-19 19:11:50 +00:00
|
|
|
|
2009-08-21 20:25:24 +00:00
|
|
|
#include <epan/prefs.h>
|
2005-01-08 15:49:37 +00:00
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
#define AMR_NB_SID 8
|
|
|
|
#define AMR_WB_SID 9
|
2005-09-19 19:11:50 +00:00
|
|
|
#define AMR_NO_TRANS 15
|
2005-01-08 15:49:37 +00:00
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
#define AMR_NB 0
|
|
|
|
#define AMR_WB 1
|
|
|
|
|
2005-01-08 15:49:37 +00:00
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_amr = -1;
|
2007-06-08 05:04:54 +00:00
|
|
|
static int hf_amr_nb_cmr = -1;
|
|
|
|
static int hf_amr_wb_cmr = -1;
|
2005-01-08 15:49:37 +00:00
|
|
|
static int hf_amr_reserved = -1;
|
|
|
|
static int hf_amr_toc_f = -1;
|
2007-06-08 05:04:54 +00:00
|
|
|
static int hf_amr_nb_toc_ft = -1;
|
|
|
|
static int hf_amr_wb_toc_ft = -1;
|
2005-01-08 15:49:37 +00:00
|
|
|
static int hf_amr_toc_q = -1;
|
2005-09-19 19:11:50 +00:00
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
static int hf_amr_nb_if1_ft = -1;
|
|
|
|
static int hf_amr_wb_if1_ft = -1;
|
2005-09-19 19:11:50 +00:00
|
|
|
static int hf_amr_if1_fqi = -1;
|
2007-06-08 05:04:54 +00:00
|
|
|
static int hf_amr_nb_if1_mode_req = -1;
|
|
|
|
static int hf_amr_wb_if1_mode_req = -1;
|
2005-09-19 19:11:50 +00:00
|
|
|
static int hf_amr_if1_sti = -1;
|
2007-06-08 05:04:54 +00:00
|
|
|
static int hf_amr_nb_if1_mode_ind = -1;
|
|
|
|
static int hf_amr_wb_if1_mode_ind = -1;
|
|
|
|
static int hf_amr_nb_if1_sti_mode_ind = -1;
|
|
|
|
static int hf_amr_wb_if1_sti_mode_ind = -1;
|
|
|
|
static int hf_amr_if2_sti = -1;
|
|
|
|
static int hf_amr_nb_if2_sti_mode_ind = -1;
|
|
|
|
static int hf_amr_wb_if2_sti_mode_ind = -1;
|
2005-09-19 19:11:50 +00:00
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
static int hf_amr_nb_if2_ft = -1;
|
|
|
|
static int hf_amr_wb_if2_ft = -1;
|
2006-11-01 22:58:41 +00:00
|
|
|
|
2005-01-08 15:49:37 +00:00
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static int ett_amr = -1;
|
|
|
|
static int ett_amr_toc = -1;
|
|
|
|
|
|
|
|
/* The dynamic payload type which will be dissected as AMR */
|
|
|
|
|
2008-09-22 16:26:41 +00:00
|
|
|
static guint temp_dynamic_payload_type = 0;
|
2008-09-19 20:42:01 +00:00
|
|
|
static gint amr_encoding_type = 0;
|
2010-03-16 09:12:24 +00:00
|
|
|
static gint pref_amr_mode = AMR_NB;
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2005-01-08 15:49:37 +00:00
|
|
|
|
|
|
|
/* Currently only octet aligned works */
|
2005-10-05 15:44:04 +00:00
|
|
|
/* static gboolean octet_aligned = TRUE; */
|
2005-01-08 15:49:37 +00:00
|
|
|
|
2005-09-19 19:11:50 +00:00
|
|
|
static const value_string amr_encoding_type_value[] = {
|
2008-09-19 20:42:01 +00:00
|
|
|
{0, "RFC 3267"},
|
|
|
|
{1, "RFC 3267 bandwidth-efficient mode"},
|
|
|
|
{2, "AMR IF 1"},
|
|
|
|
{3, "AMR IF 2"},
|
2005-09-19 19:11:50 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
|
|
|
|
/* Table 1a of 3GPP TS 26.201*/
|
|
|
|
static const value_string amr_nb_codec_mode_vals[] = {
|
|
|
|
{0, "AMR 4,75 kbit/s"},
|
|
|
|
{1, "AMR 5,15 kbit/s"},
|
|
|
|
{2, "AMR 5,90 kbit/s"},
|
|
|
|
{3, "AMR 6,70 kbit/s (PDC-EFR)"},
|
|
|
|
{4, "AMR 7,40 kbit/s (TDMA-EFR)"},
|
|
|
|
{5, "AMR 7,95 kbit/s"},
|
|
|
|
{6, "AMR 10,2 kbit/s"},
|
|
|
|
{7, "AMR 12,2 kbit/s (GSM-EFR)"},
|
|
|
|
{AMR_NB_SID, "AMR SID (Comfort Noise Frame)"},
|
2008-12-22 11:27:55 +00:00
|
|
|
{9, "GSM-EFR SID"},
|
|
|
|
{10, "TDMA-EFR SID "},
|
|
|
|
{11, "PDC-EFR SID"},
|
|
|
|
{12, "Illegal Frametype - for future use"},
|
|
|
|
{13, "Illegal Frametype - for future use"},
|
|
|
|
{14, "Illegal Frametype - for future use"},
|
2007-06-08 05:04:54 +00:00
|
|
|
{AMR_NO_TRANS, "No Data (No transmission/No reception)"},
|
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const value_string amr_wb_codec_mode_vals[] = {
|
2008-12-22 11:27:55 +00:00
|
|
|
{0, "AMR-WB 6.60 kbit/s"},
|
|
|
|
{1, "AMR-WB 8.85 kbit/s"},
|
|
|
|
{2, "AMR-WB 12.65 kbit/s"},
|
|
|
|
{3, "AMR-WB 14.25 kbit/s"},
|
|
|
|
{4, "AMR-WB 15.85 kbit/s"},
|
|
|
|
{5, "AMR-WB 18.25 kbit/s"},
|
|
|
|
{6, "AMR-WB 19.85 kbit/s"},
|
|
|
|
{7, "AMR-WB 23.05 kbit/s"},
|
|
|
|
{8, "AMR-WB 23.85 kbit/s"},
|
2007-06-08 05:04:54 +00:00
|
|
|
{AMR_WB_SID, "AMR-WB SID (Comfort Noise Frame)"},
|
2008-12-22 11:27:55 +00:00
|
|
|
{10, "Illegal Frametype"},
|
|
|
|
{11, "Illegal Frametype"},
|
|
|
|
{12, "Illegal Frametype"},
|
|
|
|
{13, "Illegal Frametype"},
|
|
|
|
{14, "Speech lost"},
|
2007-06-08 05:04:54 +00:00
|
|
|
{AMR_NO_TRANS, "No Data (No transmission/No reception)"},
|
2005-09-19 19:11:50 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
/* Ref 3GPP TS 26.101 table 1a for AMR-NB*/
|
|
|
|
|
|
|
|
/* From RFC3267 chapter 4.3.1
|
|
|
|
CMR (4 bits): Indicates a codec mode request sent to the speech
|
|
|
|
encoder at the site of the receiver of this payload. The value of
|
|
|
|
the CMR field is set to the frame type index of the corresponding
|
|
|
|
speech mode being requested. The frame type index may be 0-7 for
|
|
|
|
AMR, as defined in Table 1a in [2], or 0-8 for AMR-WB, as defined
|
|
|
|
in Table 1a in [3GPP TS 26.201]. CMR value 15 indicates that no
|
|
|
|
mode request is present, and other values are for future use.
|
|
|
|
*/
|
|
|
|
static const value_string amr_nb_codec_mode_request_vals[] = {
|
2008-09-19 20:42:01 +00:00
|
|
|
{0, "AMR 4,75 kbit/s"},
|
|
|
|
{1, "AMR 5,15 kbit/s"},
|
|
|
|
{2, "AMR 5,90 kbit/s"},
|
|
|
|
{3, "AMR 6,70 kbit/s (PDC-EFR)"},
|
|
|
|
{4, "AMR 7,40 kbit/s (TDMA-EFR)"},
|
|
|
|
{5, "AMR 7,95 kbit/s"},
|
|
|
|
{6, "AMR 10,2 kbit/s"},
|
|
|
|
{7, "AMR 12,2 kbit/s (GSM-EFR)"},
|
2008-12-22 11:27:55 +00:00
|
|
|
{8, "Illegal Frametype - For future use"},
|
|
|
|
{8, "Illegal Frametype - For future use"},
|
|
|
|
{10, "Illegal Frametype - For future use"},
|
|
|
|
{11, "Illegal Frametype - For future use"},
|
|
|
|
{12, "Illegal Frametype - For future use"},
|
|
|
|
{13, "Illegal Frametype - For future use"},
|
|
|
|
{14, "Illegal Frametype - For future use"},
|
|
|
|
{15, "No mode request"},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Ref 3GPP TS 26.201 table 1a for AMR-WB*/
|
|
|
|
static const value_string amr_wb_codec_mode_request_vals[] = {
|
2008-09-19 20:42:01 +00:00
|
|
|
{0, "AMR-WB 6.60 kbit/s"},
|
|
|
|
{1, "AMR-WB 8.85 kbit/s"},
|
|
|
|
{2, "AMR-WB 12.65 kbit/s"},
|
|
|
|
{3, "AMR-WB 14.25 kbit/s"},
|
|
|
|
{4, "AMR-WB 15.85 kbit/s"},
|
|
|
|
{5, "AMR-WB 18.25 kbit/s"},
|
|
|
|
{6, "AMR-WB 19.85 kbit/s"},
|
|
|
|
{7, "AMR-WB 23.05 kbit/s"},
|
|
|
|
{8, "AMR-WB 23.85 kbit/s"},
|
|
|
|
{9, "Illegal Frametype - For future use"},
|
|
|
|
{10, "Illegal Frametype - For future use"},
|
|
|
|
{11, "Illegal Frametype - For future use"},
|
|
|
|
{12, "Illegal Frametype - For future use"},
|
|
|
|
{13, "Illegal Frametype - For future use"},
|
2008-12-22 11:27:55 +00:00
|
|
|
{14, "Illegal Frametype - For future use"},
|
2008-09-19 20:42:01 +00:00
|
|
|
{15, "No mode request"},
|
2005-01-08 15:49:37 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string toc_f_bit_vals = {
|
|
|
|
"Followed by another speech frame",
|
|
|
|
"Last frame in this payload"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const true_false_string toc_q_bit_vals = {
|
|
|
|
"Ok",
|
|
|
|
"Severely damaged frame"
|
|
|
|
};
|
|
|
|
|
2005-09-19 19:11:50 +00:00
|
|
|
static const true_false_string amr_sti_vals = {
|
|
|
|
"SID_UPDATE",
|
|
|
|
"SID_FIRST"
|
|
|
|
};
|
2007-06-08 05:04:54 +00:00
|
|
|
|
|
|
|
/* See 3GPP TS 26.101 chapter 4 for AMR-NB IF1 */
|
2005-09-19 19:11:50 +00:00
|
|
|
static void
|
2007-06-08 05:04:54 +00:00
|
|
|
dissect_amr_nb_if1(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree){
|
2008-09-19 20:42:01 +00:00
|
|
|
int offset = 0;
|
2005-09-19 19:11:50 +00:00
|
|
|
guint8 octet;
|
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if1_ft, tvb, offset, 1, FALSE);
|
2005-09-19 19:11:50 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_if1_fqi, tvb, offset, 1, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
octet = (tvb_get_guint8(tvb,offset) & 0xf0) >> 4;
|
|
|
|
if (octet == AMR_NB_SID){
|
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if1_mode_req, tvb, offset+1, 1, FALSE);
|
|
|
|
if (tvb_get_guint8(tvb,offset+1) & 0x1f)
|
2008-09-19 20:42:01 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset+1, 1, "Error:Spare bits not 0");
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset+2, 5, "Speech data");
|
2005-09-19 19:11:50 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_if1_sti, tvb, offset+7, 1, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if1_sti_mode_ind, tvb, offset+7, 1, FALSE);
|
2005-09-19 19:11:50 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if1_mode_ind, tvb, offset, 1, FALSE);
|
2005-09-19 19:11:50 +00:00
|
|
|
offset++;
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if1_mode_req, tvb, offset, 1, FALSE);
|
|
|
|
if (tvb_get_guint8(tvb,offset) & 0x1f)
|
|
|
|
proto_tree_add_text(tree, tvb, offset, 1, "Error:Spare bits not 0");
|
2005-09-19 19:11:50 +00:00
|
|
|
offset++;
|
|
|
|
proto_tree_add_text(tree, tvb, offset, -1, "Speech data");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
/* See 3GPP TS 26.201 for AMR-WB */
|
2005-09-19 19:11:50 +00:00
|
|
|
static void
|
2007-06-08 05:04:54 +00:00
|
|
|
dissect_amr_wb_if1(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree){
|
2008-09-19 20:42:01 +00:00
|
|
|
int offset = 0;
|
2005-09-19 19:11:50 +00:00
|
|
|
guint8 octet;
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if1_ft, tvb, offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_amr_if1_fqi, tvb, offset, 1, FALSE);
|
|
|
|
if (tvb_get_guint8(tvb,offset) & 0x03)
|
2008-09-19 20:42:01 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset, 1, "Error:Spare bits not 0");
|
2007-06-08 05:04:54 +00:00
|
|
|
octet = (tvb_get_guint8(tvb,offset) & 0xf0) >> 4;
|
|
|
|
if (octet == AMR_WB_SID){
|
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if1_mode_req, tvb, offset+1, 1, FALSE);
|
|
|
|
proto_tree_add_text(tree, tvb, offset+2, 4, "Speech data");
|
|
|
|
proto_tree_add_item(tree, hf_amr_if1_sti, tvb, offset+7, 1, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if1_sti_mode_ind, tvb, offset+7, 1, FALSE);
|
|
|
|
return;
|
|
|
|
}
|
2005-09-19 19:11:50 +00:00
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
offset++;
|
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if1_mode_ind, tvb, offset, 1, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if1_mode_req, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
|
|
|
proto_tree_add_text(tree, tvb, offset, -1, "Speech data");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_amr_nb_if2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
|
2008-09-19 20:42:01 +00:00
|
|
|
int offset = 0;
|
2007-06-08 05:04:54 +00:00
|
|
|
guint8 octet;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if2_ft, tvb, offset, 1, FALSE);
|
2005-09-19 19:11:50 +00:00
|
|
|
octet = tvb_get_guint8(tvb,offset) & 0x0f;
|
2007-06-08 05:04:54 +00:00
|
|
|
|
|
|
|
if (octet == AMR_NB_SID) {
|
2005-09-19 19:11:50 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset+1, 3, "Speech data");
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_item(tree, hf_amr_if2_sti, tvb, offset+4, 1, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_amr_nb_if2_sti_mode_ind, tvb, offset+5, 1, FALSE);
|
2005-09-19 19:11:50 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (octet == AMR_NO_TRANS)
|
|
|
|
return;
|
|
|
|
proto_tree_add_text(tree, tvb, offset+1, -1, "Speech data");
|
|
|
|
|
2005-10-05 15:44:04 +00:00
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
2008-09-19 20:42:01 +00:00
|
|
|
val_to_str(octet, amr_nb_codec_mode_request_vals, "Unknown (%d)" ));
|
2005-09-19 19:11:50 +00:00
|
|
|
}
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2006-11-01 22:58:41 +00:00
|
|
|
static void
|
2007-06-08 05:04:54 +00:00
|
|
|
dissect_amr_wb_if2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
|
2008-09-19 20:42:01 +00:00
|
|
|
int offset = 0;
|
2007-06-08 05:04:54 +00:00
|
|
|
guint8 octet;
|
|
|
|
|
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if2_ft, tvb, offset, 1, FALSE);
|
|
|
|
octet = (tvb_get_guint8(tvb,offset) & 0xf0) >> 4;
|
|
|
|
|
|
|
|
if (octet == AMR_WB_SID) {
|
|
|
|
proto_tree_add_text(tree, tvb, offset+1, 4, "Speech data");
|
|
|
|
proto_tree_add_item(tree, hf_amr_if2_sti, tvb, offset+5, 1, FALSE);
|
|
|
|
proto_tree_add_item(tree, hf_amr_wb_if2_sti_mode_ind, tvb, offset+5, 1, FALSE);
|
2006-11-01 22:58:41 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-06-08 05:04:54 +00:00
|
|
|
if (octet == AMR_NO_TRANS)
|
2006-11-01 22:58:41 +00:00
|
|
|
return;
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_text(tree, tvb, offset+1, -1, "Speech data");
|
|
|
|
|
|
|
|
if(check_col(pinfo->cinfo, COL_INFO))
|
|
|
|
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
|
2008-09-19 20:42:01 +00:00
|
|
|
val_to_str(octet, amr_wb_codec_mode_request_vals, "Unknown (%d)" ));
|
2007-06-08 05:04:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-03-16 09:12:24 +00:00
|
|
|
dissect_amr_be(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint amr_mode){
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_item *item;
|
|
|
|
int ft;
|
2008-12-22 11:27:55 +00:00
|
|
|
int bit_offset = 0;
|
2007-06-08 05:04:54 +00:00
|
|
|
int bitcount; /*bitcounter, MSB = bit 0, over bytes*/
|
2008-09-19 20:42:01 +00:00
|
|
|
int bits_used_for_frames = 0;
|
2007-06-08 05:04:54 +00:00
|
|
|
int bytes_needed_for_frames;
|
2008-12-22 11:27:55 +00:00
|
|
|
guint8 f_bit, q_bit;
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2008-09-19 20:42:01 +00:00
|
|
|
/* Number of bits per frame for AMR-NB, see Table 1 RFC3267*/
|
2007-06-08 05:04:54 +00:00
|
|
|
/* Values taken for GSM-EFR SID, TDMA-EFR SID and PDC-EFR SID from 3GPP 26.101 Table A.1b */
|
|
|
|
|
|
|
|
/* Frame type 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */
|
|
|
|
unsigned char Framebits_NB[] = {95,103,118,134,148,159,204,244,39,43,38,37, 0, 0, 0, 0};
|
|
|
|
|
|
|
|
/* Number of bits per frame for AMR-WB, see 3GPP TS 26.201 Table 2*/
|
|
|
|
/* Frame type 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 */
|
|
|
|
unsigned int Framebits_WB[] = {132,177,253,285,317,365,397,461,477,40,0, 0, 0, 0, 0, 0,};
|
|
|
|
|
|
|
|
|
|
|
|
/* Chapter 4.3 */
|
2008-12-22 11:27:55 +00:00
|
|
|
|
2008-09-19 20:42:01 +00:00
|
|
|
bitcount = 3;
|
2007-06-08 05:04:54 +00:00
|
|
|
if (amr_mode==AMR_NB)
|
2008-12-22 11:27:55 +00:00
|
|
|
item = proto_tree_add_bits_item(tree, hf_amr_nb_cmr, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-12-22 11:27:55 +00:00
|
|
|
item = proto_tree_add_bits_item(tree, hf_amr_wb_cmr, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2008-12-22 11:27:55 +00:00
|
|
|
bit_offset+=4;
|
|
|
|
/* In bandwidth-efficient mode, a ToC entry takes the following format:
|
|
|
|
*
|
|
|
|
* 0 1 2 3 4 5
|
|
|
|
* +-+-+-+-+-+-+
|
|
|
|
* |F| FT |Q|
|
|
|
|
* +-+-+-+-+-+-+
|
|
|
|
*
|
|
|
|
* F (1 bit): If set to 1, indicates that this frame is followed by
|
|
|
|
* another speech frame in this payload; if set to 0, indicates that
|
|
|
|
* this frame is the last frame in this payload.
|
|
|
|
*
|
|
|
|
* FT (4 bits): Frame type index, indicating either the AMR or AMR-WB
|
|
|
|
* speech coding mode or comfort noise (SID) mode of the
|
|
|
|
* corresponding frame carried in this payload.
|
|
|
|
*/
|
2007-06-08 05:04:54 +00:00
|
|
|
do {
|
|
|
|
/* Check F bit */
|
2008-09-19 20:42:01 +00:00
|
|
|
bitcount += 1;
|
2008-12-22 11:27:55 +00:00
|
|
|
f_bit = tvb_get_bits8(tvb, bit_offset, 1);
|
|
|
|
proto_tree_add_bits_item(tree, hf_amr_toc_f, tvb, bit_offset, 1, FALSE);
|
|
|
|
bit_offset++;
|
|
|
|
ft = tvb_get_bits8(tvb, bit_offset, 4);
|
2007-06-08 05:04:54 +00:00
|
|
|
if (amr_mode==AMR_NB)
|
2008-12-22 11:27:55 +00:00
|
|
|
item = proto_tree_add_bits_item(tree, hf_amr_nb_toc_ft, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-12-22 11:27:55 +00:00
|
|
|
item = proto_tree_add_bits_item(tree, hf_amr_wb_toc_ft, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2008-12-22 11:27:55 +00:00
|
|
|
bit_offset+=4;
|
2008-09-19 20:42:01 +00:00
|
|
|
bitcount += 4;
|
2007-06-08 05:04:54 +00:00
|
|
|
if (amr_mode==AMR_NB)
|
2008-09-19 20:42:01 +00:00
|
|
|
bits_used_for_frames +=Framebits_NB[ft];
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-09-19 20:42:01 +00:00
|
|
|
bits_used_for_frames +=Framebits_WB[ft];
|
2007-06-08 05:04:54 +00:00
|
|
|
/* Check Q bit */
|
2008-12-22 11:27:55 +00:00
|
|
|
q_bit = tvb_get_bits8(tvb, bit_offset, 1);
|
|
|
|
proto_tree_add_bits_item(tree, hf_amr_toc_q, tvb, bit_offset, 1, FALSE);
|
|
|
|
bit_offset++;
|
2008-09-19 20:42:01 +00:00
|
|
|
bitcount += 1;
|
2008-12-22 11:27:55 +00:00
|
|
|
if (q_bit==1)
|
2008-09-19 20:42:01 +00:00
|
|
|
proto_item_append_text(item, " / Frame OK");
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-09-19 20:42:01 +00:00
|
|
|
proto_item_append_text(item, " / Frame damaged");
|
2008-12-22 11:27:55 +00:00
|
|
|
} while ((f_bit==1) && (tvb_reported_length_remaining(tvb, bitcount/8)>2));
|
2007-06-08 05:04:54 +00:00
|
|
|
|
|
|
|
if (bits_used_for_frames>0)
|
2008-09-19 20:42:01 +00:00
|
|
|
bytes_needed_for_frames = 1 + (bitcount+bits_used_for_frames)/8-bitcount/8;
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-09-19 20:42:01 +00:00
|
|
|
bytes_needed_for_frames = 0;
|
2007-06-08 05:04:54 +00:00
|
|
|
|
|
|
|
/* Check if we have enough data available for our frames */
|
|
|
|
if (tvb_reported_length_remaining(tvb, bitcount/8)<bytes_needed_for_frames) {
|
2008-09-19 20:42:01 +00:00
|
|
|
item = proto_tree_add_text(tree, tvb, bitcount/8, bytes_needed_for_frames, "Error:");
|
|
|
|
proto_item_append_text(item, " %d Bytes available, %d would be needed!",
|
|
|
|
tvb_reported_length_remaining(tvb, bitcount/8),
|
|
|
|
bytes_needed_for_frames);
|
|
|
|
expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Not enough data for the frames according to TOC");
|
2007-06-08 05:04:54 +00:00
|
|
|
}
|
|
|
|
else {
|
2008-09-19 20:42:01 +00:00
|
|
|
item = proto_tree_add_text(tree, tvb, bitcount/8, bytes_needed_for_frames, "Frame Data");
|
|
|
|
proto_item_append_text(item, " (%d Bytes)",bytes_needed_for_frames);
|
2007-06-08 05:04:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bitcount+=bits_used_for_frames;
|
|
|
|
|
|
|
|
if (tvb_reported_length_remaining(tvb, (bitcount+8)/8)>0) {
|
2008-09-19 20:42:01 +00:00
|
|
|
item = proto_tree_add_text(tree, tvb, bitcount/8, tvb_reported_length_remaining(tvb, bitcount/8), "Error:");
|
|
|
|
proto_item_append_text(item, " %d Bytes remaining - should be 0!",tvb_reported_length_remaining(tvb, (bitcount+8)/8));
|
2008-12-18 19:08:49 +00:00
|
|
|
expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Superfluous data remaining");
|
2008-09-19 20:42:01 +00:00
|
|
|
|
|
|
|
/* Now check the paddings */
|
|
|
|
if (bitcount%8 != 0) {
|
|
|
|
if ( (1 << (8 -(bitcount%8)-1)) & tvb_get_guint8(tvb,bitcount/8) )
|
|
|
|
item = proto_tree_add_text(tree, tvb, bitcount/8, 1, "Padding bits correct");
|
|
|
|
else {
|
|
|
|
item = proto_tree_add_text(tree, tvb, bitcount/8, 1, "Padding bits error");
|
|
|
|
expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR, "Padding bits error - MUST be 0");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2007-06-08 05:04:54 +00:00
|
|
|
}
|
2006-11-01 22:58:41 +00:00
|
|
|
|
|
|
|
}
|
2005-01-08 15:49:37 +00:00
|
|
|
/* Code to actually dissect the packets */
|
|
|
|
static void
|
2010-03-16 09:12:24 +00:00
|
|
|
dissect_amr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint amr_mode)
|
2005-01-08 15:49:37 +00:00
|
|
|
{
|
|
|
|
int offset = 0;
|
2008-12-22 11:27:55 +00:00
|
|
|
int bit_offset = 0;
|
2005-01-08 15:49:37 +00:00
|
|
|
int toc_offset = 0;
|
2005-09-19 19:11:50 +00:00
|
|
|
guint8 octet;
|
|
|
|
proto_item *item;
|
2006-05-27 18:25:08 +00:00
|
|
|
gboolean first_time;
|
2005-01-08 15:49:37 +00:00
|
|
|
|
|
|
|
/* Set up structures needed to add the protocol subtree and manage it */
|
|
|
|
proto_item *ti,*toc_item;
|
|
|
|
proto_tree *amr_tree, *toc_tree;
|
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
|
2005-09-19 19:11:50 +00:00
|
|
|
ti = proto_tree_add_item(tree, proto_amr, tvb, 0, -1, FALSE);
|
2005-01-08 15:49:37 +00:00
|
|
|
amr_tree = proto_item_add_subtree(ti, ett_amr);
|
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
proto_tree_add_text(amr_tree, tvb, offset, -1, "Payload decoded as %s",
|
|
|
|
val_to_str(amr_encoding_type, amr_encoding_type_value, "Unknown value - Error"));
|
2005-09-19 19:11:50 +00:00
|
|
|
|
|
|
|
switch (amr_encoding_type){
|
2006-11-01 22:58:41 +00:00
|
|
|
case 0: /* RFC 3267 Byte aligned */
|
2005-09-19 19:11:50 +00:00
|
|
|
break;
|
2006-11-01 22:58:41 +00:00
|
|
|
case 1: /* RFC 3267 Bandwidth-efficient */
|
2010-03-16 09:12:24 +00:00
|
|
|
dissect_amr_be(tvb, pinfo, amr_tree, amr_mode);
|
2006-11-01 22:58:41 +00:00
|
|
|
return;
|
2005-09-19 19:11:50 +00:00
|
|
|
case 2: /* AMR IF1 */
|
2007-06-08 05:04:54 +00:00
|
|
|
if (amr_mode==AMR_NB)
|
|
|
|
dissect_amr_nb_if1(tvb, pinfo, amr_tree);
|
|
|
|
else
|
|
|
|
dissect_amr_wb_if1(tvb, pinfo, amr_tree);
|
2005-09-19 19:11:50 +00:00
|
|
|
return;
|
|
|
|
case 3: /* AMR IF2 */
|
2007-06-08 05:04:54 +00:00
|
|
|
if (amr_mode==AMR_NB)
|
|
|
|
dissect_amr_nb_if2(tvb, pinfo, amr_tree);
|
|
|
|
else
|
|
|
|
dissect_amr_wb_if2(tvb, pinfo, amr_tree);
|
2005-09-19 19:11:50 +00:00
|
|
|
return;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2007-06-08 05:04:54 +00:00
|
|
|
|
|
|
|
if (amr_mode==AMR_NB)
|
2008-12-22 11:27:55 +00:00
|
|
|
proto_tree_add_bits_item(amr_tree, hf_amr_nb_cmr, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-12-22 11:27:55 +00:00
|
|
|
proto_tree_add_bits_item(amr_tree, hf_amr_wb_cmr, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2008-12-22 11:27:55 +00:00
|
|
|
bit_offset+=4;
|
2005-09-19 19:11:50 +00:00
|
|
|
octet = tvb_get_guint8(tvb,offset) & 0x0f;
|
|
|
|
if ( octet != 0 ){
|
|
|
|
item = proto_tree_add_text(amr_tree, tvb, offset, -1, "Reserved != 0, wrongly encoded or not octet aligned. Decoding as bandwidth-efficient mode");
|
|
|
|
PROTO_ITEM_SET_GENERATED(item);
|
|
|
|
return;
|
2006-11-01 22:58:41 +00:00
|
|
|
|
2005-09-19 19:11:50 +00:00
|
|
|
}
|
2005-01-08 15:49:37 +00:00
|
|
|
|
|
|
|
proto_tree_add_item(amr_tree, hf_amr_reserved, tvb, offset, 1, FALSE);
|
|
|
|
offset++;
|
2008-12-22 11:27:55 +00:00
|
|
|
bit_offset+=4;
|
2005-01-08 15:49:37 +00:00
|
|
|
toc_offset = offset;
|
2006-11-01 22:58:41 +00:00
|
|
|
/*
|
|
|
|
* A ToC entry takes the following format in octet-aligned mode:
|
|
|
|
*
|
|
|
|
* 0 1 2 3 4 5 6 7
|
|
|
|
* +-+-+-+-+-+-+-+-+
|
|
|
|
* |F| FT |Q|P|P|
|
|
|
|
* +-+-+-+-+-+-+-+-+
|
2005-01-08 15:49:37 +00:00
|
|
|
*
|
2006-11-01 22:58:41 +00:00
|
|
|
* F (1 bit): see definition in Section 4.3.2.
|
|
|
|
*
|
|
|
|
* FT (4 bits unsigned integer): see definition in Section 4.3.2.
|
|
|
|
*
|
|
|
|
* Q (1 bit): see definition in Section 4.3.2.
|
|
|
|
*
|
|
|
|
* P bits: padding bits, MUST be set to zero.
|
2005-01-08 15:49:37 +00:00
|
|
|
*/
|
|
|
|
octet = tvb_get_guint8(tvb,offset);
|
|
|
|
toc_item = proto_tree_add_text(amr_tree, tvb, offset, -1, "Payload Table of Contents");
|
|
|
|
toc_tree = proto_item_add_subtree(toc_item, ett_amr_toc);
|
2006-05-27 18:25:08 +00:00
|
|
|
|
|
|
|
first_time = TRUE;
|
|
|
|
while ((( octet& 0x80 ) == 0x80)||(first_time == TRUE)){
|
|
|
|
first_time = FALSE;
|
2005-01-08 15:49:37 +00:00
|
|
|
octet = tvb_get_guint8(tvb,offset);
|
2008-12-22 11:27:55 +00:00
|
|
|
|
|
|
|
proto_tree_add_bits_item(amr_tree, hf_amr_toc_f, tvb, bit_offset, 1, FALSE);
|
|
|
|
bit_offset++;
|
2007-06-08 05:04:54 +00:00
|
|
|
if (amr_mode==AMR_NB)
|
2008-12-22 11:27:55 +00:00
|
|
|
proto_tree_add_bits_item(amr_tree, hf_amr_nb_toc_ft, tvb, bit_offset, 4, FALSE);
|
2007-06-08 05:04:54 +00:00
|
|
|
else
|
2008-12-22 11:27:55 +00:00
|
|
|
proto_tree_add_bits_item(amr_tree, hf_amr_wb_toc_ft, tvb, bit_offset, 4, FALSE);
|
|
|
|
bit_offset+=4;
|
|
|
|
proto_tree_add_bits_item(amr_tree, hf_amr_toc_q, tvb, bit_offset, 1, FALSE);
|
|
|
|
bit_offset++;
|
|
|
|
/* 2 pading bits */
|
|
|
|
bit_offset+=2;
|
2005-01-08 15:49:37 +00:00
|
|
|
offset++;
|
|
|
|
}
|
|
|
|
|
|
|
|
}/* if tree */
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-03-16 09:12:24 +00:00
|
|
|
/* Code to actually dissect the packets */
|
|
|
|
static void
|
|
|
|
dissect_amr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Make entries in Protocol column and Info column on summary display */
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMR");
|
|
|
|
|
|
|
|
dissect_amr_common(tvb, pinfo, tree, pref_amr_mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_amr_wb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Make entries in Protocol column and Info column on summary display */
|
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AMR-WB");
|
|
|
|
dissect_amr_common(tvb, pinfo, tree, AMR_WB);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-07 19:16:26 +00:00
|
|
|
typedef struct _amr_capability_t {
|
|
|
|
const gchar *id;
|
|
|
|
const gchar *name;
|
|
|
|
new_dissector_t content_pdu;
|
|
|
|
} amr_capability_t;
|
|
|
|
|
|
|
|
static amr_capability_t amr_capability_tab[] = {
|
|
|
|
/* ITU-T H.241 (05/2006), 8.3 H.264 capabilities */
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1", "H.245 - GSM AMR Capability Identifier", NULL },
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1/collapsing/0", "maxAl-sduAudioFrames", NULL },
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1/collapsing/1", "bitRate", NULL },
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1/collapsing/2", "gsmAmrComfortNoise", NULL },
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1/collapsing/3", "gsmEfrComfortNoise", NULL },
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1/collapsing/4", "is-641ComfortNoise", NULL },
|
|
|
|
{ "GenericCapability/0.0.8.245.1.1.1/collapsing/5", "pdcEFRComfortNoise", NULL },
|
2009-04-06 16:53:41 +00:00
|
|
|
/* ITU-T Rec. G.722.2/Annex F (11/2002) */
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/0", "maxAl-sduFrames", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/1", "bitRate", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/2", "octetAlign", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/3", "modeSet", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/4", "modeChangePeriod", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/5", "modeChangeNeighbour", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/6", "crc", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/7", "robustSorting", NULL },
|
|
|
|
{ "GenericCapability/0.0.7.7222.1.0/collapsing/8", "interleaving", NULL },
|
2008-01-07 19:16:26 +00:00
|
|
|
{ NULL, NULL, NULL },
|
|
|
|
};
|
|
|
|
|
|
|
|
static amr_capability_t *find_cap(const gchar *id) {
|
2008-09-19 20:42:01 +00:00
|
|
|
amr_capability_t *ftr = NULL;
|
|
|
|
amr_capability_t *f;
|
2008-01-07 19:16:26 +00:00
|
|
|
|
2008-09-19 20:42:01 +00:00
|
|
|
for (f=amr_capability_tab; f->id; f++) {
|
|
|
|
if (!strcmp(id, f->id)) { ftr = f; break; }
|
|
|
|
}
|
|
|
|
return ftr;
|
2008-01-07 19:16:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dissect_amr_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
2008-09-19 20:42:01 +00:00
|
|
|
asn1_ctx_t *actx;
|
|
|
|
amr_capability_t *ftr = NULL;
|
|
|
|
|
|
|
|
actx = get_asn1_ctx(pinfo->private_data);
|
|
|
|
DISSECTOR_ASSERT(actx);
|
|
|
|
if (tree) {
|
|
|
|
ftr = find_cap(pinfo->match_string);
|
|
|
|
if (ftr) {
|
|
|
|
proto_item_append_text(actx->created_item, " - %s", ftr->name);
|
|
|
|
proto_item_append_text(proto_item_get_parent(proto_tree_get_parent(tree)), ": %s", ftr->name);
|
|
|
|
} else {
|
|
|
|
proto_item_append_text(actx->created_item, " - unknown(%s)", pinfo->match_string);
|
|
|
|
}
|
|
|
|
}
|
2008-01-07 19:16:26 +00:00
|
|
|
}
|
2005-01-08 15:49:37 +00:00
|
|
|
|
2006-05-21 04:49:01 +00:00
|
|
|
/* Register the protocol with Wireshark */
|
2005-01-08 15:49:37 +00:00
|
|
|
/* If this dissector uses sub-dissector registration add a registration routine.
|
|
|
|
This format is required because a script is used to find these routines and
|
|
|
|
create the code that calls these routines.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
proto_reg_handoff_amr(void)
|
|
|
|
{
|
2008-09-19 20:42:01 +00:00
|
|
|
static dissector_handle_t amr_handle;
|
2010-03-16 09:12:24 +00:00
|
|
|
static dissector_handle_t amr_wb_handle;
|
2008-09-22 16:26:41 +00:00
|
|
|
static guint dynamic_payload_type;
|
2008-09-19 20:42:01 +00:00
|
|
|
static gboolean amr_prefs_initialized = FALSE;
|
2005-01-08 15:49:37 +00:00
|
|
|
|
|
|
|
if (!amr_prefs_initialized) {
|
2008-09-22 16:26:41 +00:00
|
|
|
dissector_handle_t amr_name_handle;
|
|
|
|
amr_capability_t *ftr;
|
|
|
|
|
2008-09-19 20:42:01 +00:00
|
|
|
amr_handle = find_dissector("amr");
|
2010-03-16 09:12:24 +00:00
|
|
|
amr_wb_handle = find_dissector("amr-wb");
|
2008-09-19 20:42:01 +00:00
|
|
|
dissector_add_string("rtp_dyn_payload_type","AMR", amr_handle);
|
2010-03-16 09:12:24 +00:00
|
|
|
dissector_add_string("rtp_dyn_payload_type","AMR-WB", amr_wb_handle);
|
2008-09-22 16:26:41 +00:00
|
|
|
|
2008-09-19 20:42:01 +00:00
|
|
|
/*
|
|
|
|
* Register H.245 Generic parameter name(s)
|
|
|
|
*/
|
2008-09-22 16:26:41 +00:00
|
|
|
amr_name_handle = create_dissector_handle(dissect_amr_name, proto_amr);
|
2008-09-19 20:42:01 +00:00
|
|
|
for (ftr=amr_capability_tab; ftr->id; ftr++) {
|
|
|
|
if (ftr->name)
|
|
|
|
dissector_add_string("h245.gef.name", ftr->id, amr_name_handle);
|
|
|
|
if (ftr->content_pdu)
|
|
|
|
dissector_add_string("h245.gef.content", ftr->id, new_create_dissector_handle(ftr->content_pdu, proto_amr));
|
|
|
|
}
|
|
|
|
/* Activate the next line for testing with the randpkt tool
|
|
|
|
dissector_add("udp.port", 55555, amr_handle);
|
|
|
|
*/
|
2005-01-08 15:49:37 +00:00
|
|
|
amr_prefs_initialized = TRUE;
|
2008-09-19 20:42:01 +00:00
|
|
|
} else {
|
2008-09-22 16:26:41 +00:00
|
|
|
if ( dynamic_payload_type > 95 )
|
|
|
|
dissector_delete("rtp.pt", dynamic_payload_type, amr_handle);
|
2005-01-08 15:49:37 +00:00
|
|
|
}
|
|
|
|
|
2008-09-22 16:26:41 +00:00
|
|
|
dynamic_payload_type = temp_dynamic_payload_type;
|
|
|
|
|
|
|
|
if ( dynamic_payload_type > 95 ){
|
|
|
|
dissector_add("rtp.pt", dynamic_payload_type, amr_handle);
|
2005-01-08 15:49:37 +00:00
|
|
|
}
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2005-01-08 15:49:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* this format is require because a script is used to build the C function
|
|
|
|
that calls all the protocol registration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_amr(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
module_t *amr_module;
|
|
|
|
|
2008-09-19 20:42:01 +00:00
|
|
|
/* Setup list of header fields See Section 1.6.1 for details*/
|
2005-01-08 15:49:37 +00:00
|
|
|
static hf_register_info hf[] = {
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_cmr,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "CMR", "amr.nb.cmr",
|
2008-12-22 11:27:55 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_request_vals), 0x0,
|
2007-06-08 05:04:54 +00:00
|
|
|
"codec mode request", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_amr_wb_cmr,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "CMR", "amr.wb.cmr",
|
2008-12-22 11:27:55 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_request_vals), 0x0,
|
2005-01-08 15:49:37 +00:00
|
|
|
"codec mode request", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_amr_reserved,
|
|
|
|
{ "Reserved", "amr.reserved",
|
|
|
|
FT_UINT8, BASE_DEC, NULL, 0x0f,
|
|
|
|
"Reserved bits", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_amr_toc_f,
|
|
|
|
{ "F bit", "amr.toc.f",
|
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
|
|
|
FT_BOOLEAN, BASE_NONE, TFS(&toc_f_bit_vals), 0x0,
|
|
|
|
NULL, HFILL }
|
2005-01-08 15:49:37 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_toc_ft,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "FT bits", "amr.nb.toc.ft",
|
2008-12-22 11:27:55 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_request_vals), 0x0,
|
2007-06-08 05:04:54 +00:00
|
|
|
"Frame type index", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_amr_wb_toc_ft,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "FT bits", "amr.wb.toc.ft",
|
2008-12-22 11:27:55 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_request_vals), 0x0,
|
2006-11-01 22:58:41 +00:00
|
|
|
"Frame type index", HFILL }
|
2005-01-08 15:49:37 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_toc_q,
|
|
|
|
{ "Q bit", "amr.toc.q",
|
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
|
|
|
FT_BOOLEAN, BASE_NONE, TFS(&toc_q_bit_vals), 0x0,
|
2005-01-08 15:49:37 +00:00
|
|
|
"Frame quality indicator bit", HFILL }
|
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_if1_ft,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Frame Type", "amr.nb.if1.ft",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_vals), 0xf0,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_wb_if1_ft,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Frame Type", "amr.wb.if1.ft",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_vals), 0xf0,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_if1_mode_req,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type request", "amr.nb.if1.modereq",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_request_vals), 0xe0,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_wb_if1_mode_req,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type request", "amr.wb.if1.modereq",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_request_vals), 0x0f,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_if1_sti,
|
|
|
|
{ "SID Type Indicator", "amr.if1.sti",
|
|
|
|
FT_BOOLEAN, 8, TFS(&amr_sti_vals), 0x10,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_if1_sti_mode_ind,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type indication", "amr.nb.if1.stimodeind",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_vals), 0x0e,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_wb_if1_sti_mode_ind,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type indication", "amr.wb.if1.stimodeind",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_vals), 0x0f,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_if1_mode_ind,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type indication", "amr.nb.if1.modeind",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_vals), 0x07,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_wb_if1_mode_ind,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type indication", "amr.wb.if1.modeind",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_vals), 0xf0,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_nb_if2_ft,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Frame Type", "amr.nb.if2.ft",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_vals), 0x0f,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_wb_if2_ft,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Frame Type", "amr.wb.if2.ft",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_vals), 0xf0,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_if2_sti,
|
|
|
|
{ "SID Type Indicator", "amr.if2.sti",
|
2005-09-19 19:11:50 +00:00
|
|
|
FT_BOOLEAN, 8, TFS(&amr_sti_vals), 0x80,
|
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-09-19 19:11:50 +00:00
|
|
|
},
|
2007-06-08 05:04:54 +00:00
|
|
|
{ &hf_amr_nb_if2_sti_mode_ind,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type indication", "amr.nb.if2.stimodeind",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_nb_codec_mode_vals), 0x07,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
|
|
|
{ &hf_amr_wb_if2_sti_mode_ind,
|
2007-08-24 05:59:08 +00:00
|
|
|
{ "Mode Type indication", "amr.wb.if2.stimodeind",
|
2007-06-08 05:04:54 +00:00
|
|
|
FT_UINT8, BASE_DEC, VALS(amr_wb_codec_mode_vals), 0x78,
|
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 }
|
2007-06-08 05:04:54 +00:00
|
|
|
},
|
2005-09-19 19:11:50 +00:00
|
|
|
{ &hf_amr_if1_fqi,
|
|
|
|
{ "FQI", "amr.fqi",
|
|
|
|
FT_BOOLEAN, 8, TFS(&toc_q_bit_vals), 0x08,
|
|
|
|
"Frame quality indicator bit", HFILL }
|
|
|
|
},
|
2005-01-08 15:49:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Setup protocol subtree array */
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_amr,
|
|
|
|
&ett_amr_toc,
|
|
|
|
};
|
2008-09-19 20:42:01 +00:00
|
|
|
static enum_val_t encoding_types[] = {
|
|
|
|
{"RFC 3267 Byte aligned", "RFC 3267 octet aligned", 0},
|
|
|
|
{"RFC 3267 Bandwidth-efficient", "RFC 3267 BW-efficient", 1},
|
|
|
|
{"AMR IF1", "AMR IF1", 2},
|
|
|
|
{"AMR IF2", "AMR IF2", 3},
|
|
|
|
{NULL, NULL, -1}
|
|
|
|
};
|
|
|
|
|
|
|
|
static enum_val_t modes[] = {
|
|
|
|
{"AMR-NB", "Narrowband AMR", AMR_NB},
|
|
|
|
{"AMR-WB", "Wideband AMR", AMR_WB},
|
|
|
|
{NULL, NULL, -1}
|
|
|
|
};
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2005-01-08 15:49:37 +00:00
|
|
|
/* Register the protocol name and description */
|
|
|
|
proto_amr = proto_register_protocol("Adaptive Multi-Rate","AMR", "amr");
|
|
|
|
|
|
|
|
/* Required function calls to register the header fields and subtrees used */
|
|
|
|
proto_register_field_array(proto_amr, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
/* Register a configuration option for port */
|
|
|
|
|
|
|
|
amr_module = prefs_register_protocol(proto_amr, proto_reg_handoff_amr);
|
|
|
|
|
|
|
|
prefs_register_uint_preference(amr_module, "dynamic.payload.type",
|
2008-09-19 20:42:01 +00:00
|
|
|
"AMR dynamic payload type",
|
|
|
|
"The dynamic payload type which will be interpreted as AMR"
|
|
|
|
"; The value must be greater than 95",
|
|
|
|
10,
|
2008-09-22 16:26:41 +00:00
|
|
|
&temp_dynamic_payload_type);
|
2008-09-19 20:42:01 +00:00
|
|
|
|
|
|
|
prefs_register_enum_preference(amr_module, "encoding.version",
|
|
|
|
"Type of AMR encoding of the payload",
|
|
|
|
"Type of AMR encoding of the payload",
|
|
|
|
&amr_encoding_type, encoding_types, FALSE);
|
|
|
|
|
|
|
|
prefs_register_enum_preference(amr_module, "mode",
|
|
|
|
"The AMR mode",
|
|
|
|
"The AMR mode",
|
2010-03-16 09:12:24 +00:00
|
|
|
&pref_amr_mode, modes, AMR_NB);
|
2006-06-27 19:16:38 +00:00
|
|
|
|
|
|
|
register_dissector("amr", dissect_amr, proto_amr);
|
2010-03-16 09:12:24 +00:00
|
|
|
register_dissector("amr-wb", dissect_amr_wb, proto_amr);
|
2007-06-08 05:04:54 +00:00
|
|
|
register_dissector("amr_if1_nb", dissect_amr_nb_if1, proto_amr);
|
|
|
|
register_dissector("amr_if1_wb", dissect_amr_wb_if1, proto_amr);
|
|
|
|
register_dissector("amr_if2_nb", dissect_amr_nb_if2, proto_amr);
|
|
|
|
register_dissector("amr_if2_wb", dissect_amr_wb_if2, proto_amr);
|
2009-04-06 16:53:41 +00:00
|
|
|
|
|
|
|
oid_add_from_string("G.722.2 (AMR-WB) audio capability","0.0.7.7222.1.0");
|
2007-06-08 05:04:54 +00:00
|
|
|
|
2005-01-08 15:49:37 +00:00
|
|
|
|
2007-06-08 05:04:54 +00:00
|
|
|
}
|