diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 03:35:29 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-01-16 03:35:29 +0000 |
commit | f36e2be2874db3eb3917e2b9299509725d483ce3 (patch) | |
tree | 9659b266111b939e5e8ec48e927fd36978e40e88 /epan/dissectors/packet-btobex.c | |
parent | 067a0761790aabf2d6a829c59dbdac4c2d0fccdf (diff) | |
download | wireshark-f36e2be2874db3eb3917e2b9299509725d483ce3.tar.gz wireshark-f36e2be2874db3eb3917e2b9299509725d483ce3.tar.bz2 wireshark-f36e2be2874db3eb3917e2b9299509725d483ce3.zip |
Use tvb_memeql() and tvb_memcpy().
Use tvb_ip_to_str() and tvb_ip6_to_str().
There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().
Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the
return string is NULL terminated.
svn path=/trunk/; revision=35546
Diffstat (limited to 'epan/dissectors/packet-btobex.c')
-rw-r--r-- | epan/dissectors/packet-btobex.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c index 2c807916ac..0c6d285161 100644 --- a/epan/dissectors/packet-btobex.c +++ b/epan/dissectors/packet-btobex.c @@ -312,7 +312,6 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo) proto_item *handle_item; gint item_length = -1; guint8 hdr_id, i; - const guint8 *ptr; if(tvb_length_remaining(tvb, offset)>0) { hdrs = proto_tree_add_text(tree, tvb, offset, item_length, "Headers"); @@ -376,9 +375,8 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo) handle_item = proto_tree_add_item(hdr_tree, hf_hdr_val_byte_seq, tvb, offset, item_length - 3, FALSE); if( ((hdr_id == 0x46) || (hdr_id == 0x4a)) && (item_length == 19) ) { /* target or who */ - ptr = tvb_get_ptr(tvb, offset, item_length - 3); for( i=0; target_vals[i].strptr != NULL; i++) { - if( memcmp(ptr, target_vals[i].value, 16) == 0 ) { + if( tvb_memeql(tvb, offset, target_vals[i].value, 16) == 0 ) { proto_item_append_text(handle_item, ": %s", target_vals[i].strptr); proto_item_append_text(hdr_tree, " (%s)", target_vals[i].strptr); col_append_fstr(pinfo->cinfo, COL_INFO, " - %s", target_vals[i].strptr); @@ -394,8 +392,8 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo) } else if(is_ascii_str(tvb_get_ptr(tvb, offset,item_length - 3), item_length - 3)) { - proto_item_append_text(hdr_tree, " (\"%s\")", tvb_get_ptr(tvb, offset,item_length - 3)); - col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_ptr(tvb, offset,item_length - 3)); + proto_item_append_text(hdr_tree, " (\"%s\")", tvb_get_ephemeral_string(tvb, offset,item_length - 3)); + col_append_fstr(pinfo->cinfo, COL_INFO, " \"%s\"", tvb_get_ephemeral_string(tvb, offset,item_length - 3)); } offset += item_length - 3; @@ -724,7 +722,7 @@ proto_reg_handoff_btobex(void) btobex_handle = find_dissector("btobex"); - /* register in rfcomm and l2cap the profiles/services this dissector should handle */ + /* register in rfcomm and l2cap the profiles/services this dissector should handle */ dissector_add_uint("btrfcomm.service", BTSDP_OPP_SERVICE_UUID, btobex_handle); dissector_add_uint("btrfcomm.service", BTSDP_FTP_SERVICE_UUID, btobex_handle); dissector_add_uint("btrfcomm.service", BTSDP_BPP_SERVICE_UUID, btobex_handle); @@ -754,7 +752,7 @@ proto_reg_handoff_btobex(void) dissector_add_uint("btl2cap.service", BTSDP_MAP_SERVICE_UUID, btobex_handle); dissector_add_uint("btl2cap.service", BTSDP_MAP_ACCESS_SRV_SERVICE_UUID, btobex_handle); dissector_add_uint("btl2cap.service", BTSDP_MAP_NOIYFY_SRV_SERVICE_UUID, btobex_handle); - + xml_handle = find_dissector("xml"); data_handle = find_dissector("data"); } |