A new dissector for IEEE 1722.1.

From me: some code cleanup, including:
 - Get rid of some unnecessary local variable initializations.
 - Put all of 1722.1 under one subtree.
 - Just put if(tree)s in the top-level function rather than scattered throughout.
 - Remove a couple "set but not used" warnings (a couple are #if'd out).
 - Don't use deprecated functions.

svn path=/trunk/; revision=41282
This commit is contained in:
Jeff Morriss 2012-03-02 03:30:30 +00:00
parent f2c1c108f5
commit 1ff7c5d916
5 changed files with 6079 additions and 8 deletions

View File

@ -20,6 +20,14 @@ Gilbert Ramirez <gram[AT]alumni.rice.edu> {
Miscellaneous enhancements and fixes
}
Thomas Bottom <tom.bottom[AT]labxtechnologies.com> {
IEEE 1722.1 support
}
Chris Pane <chris.pane[AT]labxtechnologies.com> {
IEEE 1722.1 support
}
Hannes R. Boehm <hannes[AT]boehm.org> {
http://hannes.boehm.org/

View File

@ -679,6 +679,7 @@ set(DISSECTOR_SRC
dissectors/packet-idp.c
dissectors/packet-iec104.c
dissectors/packet-ieee1722.c
dissectors/packet-ieee17221.c
dissectors/packet-ieee80211.c
dissectors/packet-ieee80211-prism.c
dissectors/packet-ieee80211-radio.c

View File

@ -598,6 +598,7 @@ DISSECTOR_SRC = \
packet-idp.c \
packet-iec104.c \
packet-ieee1722.c \
packet-ieee17221.c \
packet-ieee80211.c \
packet-ieee80211-prism.c \
packet-ieee80211-radio.c \

View File

@ -4,6 +4,8 @@
* Dave Olsen <dave.olsen@harman.com>
* Levi Pearson <levi.pearson@harman.com>
*
* Copyright 2011, Thomas Bottom <tom.bottom@labxtechnologies.com>
*
* $Id$
*
* Wireshark - Network traffic analyzer
@ -116,15 +118,19 @@ static int ett_1722 = -1;
static int ett_1722_audio = -1;
static int ett_1722_sample = -1;
static void dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static dissector_table_t avb_dissector_table;
static void
dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *ti = NULL;
proto_tree *ieee1722_tree = NULL;
proto_tree *audio_tree = NULL;
proto_tree *sample_tree = NULL;
gint offset = 0;
guint16 datalen = 0;
guint8 dbs = 0;
proto_item *ti;
proto_tree *ieee1722_tree;
proto_tree *audio_tree;
proto_tree *sample_tree;
gint offset;
guint16 datalen;
guint8 dbs;
guint8 subtype;
int i, j;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE1722");
@ -149,6 +155,13 @@ static void dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(ieee1722_tree, hf_1722_gvfield, tvb, IEEE_1722_VERSION_OFFSET, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(ieee1722_tree, hf_1722_tvfield, tvb, IEEE_1722_VERSION_OFFSET, 1, ENC_BIG_ENDIAN);
/* Version field ends the common AVTPDU. Now parse the specfic packet type */
subtype = tvb_get_guint8(tvb, IEEE_1722_CD_OFFSET);
subtype &= 0x7F;
/* call subtype dissectors for 1722.1 */
if (dissector_try_uint(avb_dissector_table, subtype, tvb, pinfo, tree)) return;
/* Add the rest of the packet fields */
proto_tree_add_item(ieee1722_tree, hf_1722_seqnum, tvb,
IEEE_1722_SEQ_NUM_OFFSET, 1, ENC_BIG_ENDIAN);
@ -373,6 +386,10 @@ void proto_register_1722(void)
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_1722, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Sub-dissector for 1772.1 */
avb_dissector_table = register_dissector_table("ieee1722.subtype",
"AVBTP Subtype", FT_UINT8, BASE_HEX);
}
void proto_reg_handoff_1722(void)

File diff suppressed because it is too large Load Diff