diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2014-06-16 22:24:22 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2014-06-16 20:28:21 +0000 |
commit | 87aed585485847496361a2e137b6a50f7ac74fd0 (patch) | |
tree | fe156859317270a7485a73db1ba060e1870e326c | |
parent | b2b7a6b08056a3d7beefa83cb900507ecc2bed37 (diff) |
Register DMP as new-style dissector
Change-Id: I0491c9c5e817e31011e64aebc9010437581ba718
Reviewed-on: https://code.wireshark.org/review/2269
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r-- | epan/dissectors/packet-dmp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index 7c106d2db6..be629bbf7c 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -3895,8 +3895,8 @@ static gint dissect_dmp_extensions (tvbuff_t *tvb, packet_info *pinfo _U_, return offset; } -static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo, - proto_tree *tree) +static int dissect_dmp (tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree, void *data _U_) { proto_tree *dmp_tree = NULL, *checksum_tree = NULL; proto_item *ti = NULL, *en = NULL; @@ -3918,7 +3918,7 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo, if (dmp.version > DMP_VERSION_2) { /* Unsupported DMP Version, no point to continue */ col_add_fstr (pinfo->cinfo, COL_INFO, "Unsupported Version: %d", dmp.version); - return; + return 0; } if (dmp.extensions) { @@ -3959,6 +3959,7 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo, offset, 2, TRUE); PROTO_ITEM_SET_GENERATED (en); } + offset += 2; } if (use_seq_ack_analysis) { @@ -4030,6 +4031,8 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo, proto_item_append_text (ti, ", Version: %d%s, %s", dmp.version, (dmp.prot_id == PROT_NAT ? " (national)" : ""), msg_type_to_str()); + + return offset; } static void dmp_init_routine (void) @@ -4929,7 +4932,7 @@ void proto_register_dmp (void) proto_dmp = proto_register_protocol (PNAME, PSNAME, PFNAME); - dmp_handle = register_dissector(PFNAME, dissect_dmp, proto_dmp); + dmp_handle = new_register_dissector(PFNAME, dissect_dmp, proto_dmp); proto_register_field_array (proto_dmp, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); |