diff options
author | Anders Broman <anders.broman@ericsson.com> | 2006-02-07 19:29:51 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2006-02-07 19:29:51 +0000 |
commit | b7cff15f97835b20ed607c96330a487afc530b65 (patch) | |
tree | a100d7dbca53f0cf44cb72154c0007e2098cce17 /epan/dissectors/packet-g723.c | |
parent | 4df342823aee170ecc008fd0495278a721c0d555 (diff) | |
download | wireshark-b7cff15f97835b20ed607c96330a487afc530b65.tar.gz |
Packet-bssap.c - Dissect BCD coded IE:s
Packet-g723.c - B0 and B1 should be treated together.
packet-tipc.c - Change desgementation code to handle more than 2 segments.
svn path=/trunk/; revision=17204
Diffstat (limited to 'epan/dissectors/packet-g723.c')
-rw-r--r-- | epan/dissectors/packet-g723.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/epan/dissectors/packet-g723.c b/epan/dissectors/packet-g723.c index 6bbdf2be31..b01dab3f59 100644 --- a/epan/dissectors/packet-g723.c +++ b/epan/dissectors/packet-g723.c @@ -40,21 +40,30 @@ /* Initialize the protocol and registered fields */ -static int proto_g723 = -1; -static int hf_g723_rate_flag = -1; -static int hf_g723_vad_flag = -1; -static int hf_g723_lpc_B5_B0 = -1; +static int proto_g723 = -1; +static int hf_g723_frame_size_and_codec = -1; +static int hf_g723_lpc_B5_B0 = -1; /* Initialize the subtree pointers */ static int ett_g723 = -1; -static const true_false_string g723_rate_flag_vals = { - "Low rate(5.3kb/s)", - "High rate(6.3kb/s)" -}; -static const true_false_string g723_vad_flag_vals = { - "Non-speech", - "Speech" + +/* RFC 3551 + The least significant two bits of the first + octet in the frame determine the frame size and codec type: + bits content octets/frame + 00 high-rate speech (6.3 kb/s) 24 + 01 low-rate speech (5.3 kb/s) 20 + 10 SID frame 4 + 11 reserved + + */ +static const value_string g723_frame_size_and_codec_type_value[] = { + {0, "High-rate speech (6.3 kb/s)"}, + {1, "Low-rate speech (5.3 kb/s)"}, /* Not coded */ + {2, "SID frame"}, + {3, "Reserved"}, + { 0, NULL } }; @@ -78,17 +87,11 @@ dissect_g723(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) g723_tree = proto_item_add_subtree(ti, ett_g723); octet = tvb_get_guint8(tvb,offset); - proto_tree_add_item(g723_tree, hf_g723_rate_flag, tvb, offset, 1, FALSE); - proto_tree_add_item(g723_tree, hf_g723_vad_flag, tvb, offset, 1, FALSE); + proto_tree_add_item(g723_tree, hf_g723_frame_size_and_codec, tvb, offset, 1, FALSE); proto_tree_add_item(g723_tree, hf_g723_lpc_B5_B0, tvb, offset, 1, FALSE); if ((offset & 0x1) == 1 ) /* Low rate */ return; - - - - - }/* if tree */ } @@ -121,16 +124,11 @@ proto_register_g723(void) /* Setup list of header fields See Section 1.6.1 for details*/ static hf_register_info hf[] = { - { &hf_g723_rate_flag, - { "RATEFLAG_B0", "g723.rate.flag", - FT_BOOLEAN, 8, TFS(&g723_rate_flag_vals), 0x01, + { &hf_g723_frame_size_and_codec, + { "Frame size and codec type", "g723.frame_size_and_codec", + FT_UINT8, BASE_HEX, VALS(g723_frame_size_and_codec_type_value), 0x03, "RATEFLAG_B0", HFILL } }, - { &hf_g723_vad_flag, - { "VADFLAG_B0", "g723.vad.flag", - FT_BOOLEAN, 8, TFS(&g723_vad_flag_vals), 0x02, - "VADFLAG_B0", HFILL } - }, { &hf_g723_lpc_B5_B0, { "LPC_B5...LPC_B0", "g723.lpc.b5b0", FT_UINT8, BASE_HEX, NULL, 0xfc, |