aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_acl.c
AgeCommit message (Collapse)AuthorFilesLines
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-5/+5
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-31Fix typo itam->itemMichał Łabędzki1-4/+4
Change-Id: Ia8286b2625abb878899b5023618c7974331df939 Reviewed-on: https://code.wireshark.org/review/30443 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-03-15Epan+Qt: Invalidate cached column strings.Gerald Combs1-3/+3
Add col_data_changed, which checks to see if we have updated column info. Add col_append_frame_number, which adds a frame number and sets col_data_changed. Call col_append_frame_number instead of col_append_fstr from some dissectors. Add PacketListRecord::invalidateAllRecords, which invalidates any cached record data. Add PacketListModel::invalidateAllColumnStrings which calls invalidateAllRecords and signals that our data has changed. Call invalidateAllColumnStrings when we have new name resolution or column information. Bug: 11414 Bug: 11468 Change-Id: I2671594a722f4f9436fe1df84d43489a148e0cee Reviewed-on: https://code.wireshark.org/review/26373 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-06bluetooth: Group Bluetooth dissector preferencesStig Bjørlykke1-1/+1
Change-Id: Ib5360fcbfd8f6b2aee6b33ec7d9dc77362feb50e Reviewed-on: https://code.wireshark.org/review/25162 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-09-29btle: Ignore retransmitted frames in reassemblyStig Bjørlykke1-0/+1
Change NESN/SN check to detect retransmit pr. connection. Frames with same SN in one direction is retransmit. Ignore retransmit frames when doing reassembly (btle and l2cap). Also ignore frames with incorrect CRC when doing reassembly. This fix is related to g95e09a60. Change-Id: I6386b42758ec3abada07ec1964d3e1b7ba7400e4 Reviewed-on: https://code.wireshark.org/review/23771 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-10Rename tvb_new_subset() to tvb_new_subset_length_caplen().Guy Harris1-1/+1
This emphasizes that there is no such thing as *the* routine to construct a subset tvbuff; you need to choose one of tvb_new_subset_remaining() (if you want a new tvbuff that contains everything past a certain point in an existing tvbuff), tvb_new_subset_length() (if you want a subset that contains everything past a certain point, for some number of bytes, in an existing tvbuff), and tvb_new_subset_length_caplen() (for all other cases). Many of the calls to tvb_new_subset_length_caplen() should really be calling one of the other routines; that's the next step. (This also makes it easier to find the calls that need fixing.) Change-Id: Ieb3d676d8cda535451c119487d7cd3b559221f2b Reviewed-on: https://code.wireshark.org/review/19597 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-13bthci_acl: Set src/dst addresses before reassembly.Stig Bjørlykke1-8/+7
Set all addresses before we do reassembly because sub-dissectors may set their own addresses, and we don't want to override them again. This fixes "Follow TCP Stream" and shows the correct IP addresses in the Source and Destination columns when transporting IP packets. Allocate the addresses in pinfo pool to avoid possible stack buffer overflow. Bug: 13230 Change-Id: I3b81ccb02b38331add4773d9bb3d5e0f6dcf025e Reviewed-on: https://code.wireshark.org/review/19201 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-11-04bthci_acl: Always show data itemStig Bjørlykke1-4/+13
Always add the Data (Fragment) item, also for the last frame. Also add link to "Reassembled in #" for all except the last frame. The reassembly logic should be rewritten to use reassemble.h functions to be able to show the fragments frame list, fragment count and reassembled length items. Change-Id: Ib0e17711e182178d0b7ea0fd6903a9144adb757d Reviewed-on: https://code.wireshark.org/review/18659 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-09-22BTHCI ACL: ensure to initialize the full bthci_acl_data_t structurePascal Quantin1-0/+1
Change-Id: Ie1a020bf5dddde3f9476a6fdf307da9effb4bf8c Ping-Bug: 12939 Reviewed-on: https://code.wireshark.org/review/17870 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-1/+1
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-25Move the proto data stuff out of frame_data.[ch].Guy Harris1-0/+1
It's not tied to the frame_data structure any more, so it belongs by itself. Clean up some #includes while we're at it; in particular, frame_data.h doesn't use anything related to tvbuffs, so don't have it gratuitiously include tvbuff.h. Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c Reviewed-on: https://code.wireshark.org/review/13518 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24Add the packet number to the packet_info structure, and use it.Guy Harris1-18/+18
That removes most of the uses of the frame number field in the frame_data structure. Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22 Reviewed-on: https://code.wireshark.org/review/13509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-20Bluetooth: Fix remaining lengthsMichal Labedzki1-2/+11
ACL and L2CAP payload contain its length field. Of course it may be broken for many reasons, so there is need to check it and show expert info warning. Bug: 11677 Change-Id: I1988faec9faef70c95161513049ec16ceb8fcf45 Reviewed-on: https://code.wireshark.org/review/11982 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-6/+6
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-02Bluetooth: Simplify to "UnknownDirection" in Info column when direction is ↵Michal Labedzki1-2/+1
unknown Change-Id: Ibad679c0b6c95d65389ce087f65b8f31cf3acd68 Reviewed-on: https://code.wireshark.org/review/6903 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-1/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-18Bluetooth: Add generic Bluetooth dissectorMichal Labedzki1-16/+125
Bluetooth dissector is used to add ability to filter all bluetooth payload from capture files (there are many transport like: hci_h4, hci_h1, hci_usb, hci_mon, btle). Also it is used to placeholder for all data tree used to store additional informations like bd_addrs, names, etc. Finally it is used to be one point for Bluetooth Endpoints/Conversation filtering what is enabled now. Also add Master/Slave Role and Connection Mode tracking. Change-Id: I67048080fb8ee16fa0f4ec429c1257de81ddd737 Reviewed-on: https://code.wireshark.org/review/5771 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-09-19Bluetooth: ACL/AVDTP: Fix ACL session handlingMichal Labedzki1-7/+22
In case like reusing "connection handle" number in next connection (2 -> 3 -> 2 again) AVDTP dissector does not properly dissected packets (it should be Signal, but dissect as Media). Add expert error to all packets that are not in ACL connection. This will show invalid packages (send after dissconnect), however incomplete (mostly beginning) connection will be marked too, but I think it have more pros than cons. Change-Id: I29cf706600cb12c8b93d0188dd2fba18dd5eba88 Reviewed-on: https://code.wireshark.org/review/4167 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-18Bluetooth: Fix some Clang Analyzer warningsMichal Labedzki1-0/+2
Logic error Dereference of null pointer epan/dissectors/packet-bthci_acl.c 379 Logic error Dereference of null pointer epan/dissectors/packet-bthci_acl.c 390 Logic error Dereference of null pointer epan/dissectors/packet-btsdp.c 3673 Logic error Dereference of null pointer epan/dissectors/packet-btsdp.c 1439 Logic error Dereference of null pointer epan/dissectors/packet-btsdp.c 1662 Thanks for Alexis La Goutte for pointing that. Change-Id: Ia646b33de9e368d32983efddfaa41edf7896d7fd Reviewed-on: https://code.wireshark.org/review/4165 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22Bluetooth: Complete sessionsMichal Labedzki1-5/+43
Some interfaces support multiple Bluetooth adapters with events like add/remove. We must support that to distinquish adapters streams in case that new adapter has the same id that old one. Next one is create session for "Connection Handle", so next layer will now when it is connected and disconnected. This is also used to distinguish streams. Change-Id: I9e062c8e4cc9c033b75f1a596e8351a215169843 Reviewed-on: https://code.wireshark.org/review/2548 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-03-06Bluetooth: Avoid using find_dissector()Michal Labedzki1-4/+2
Also remove SVN $Id$ lines. Change-Id: I4f2925e6ad8dcfe4a62d879a2cef44447f8ae916 Reviewed-on: https://code.wireshark.org/review/476 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-06Bluetooth: Make Source/Destination BD_ADDRs and names filterableMichal Labedzki1-127/+139
Source/Destination BD_ADDRs and name are filterable. Also simplify code around wmem trees, and enable commented "data" field in unreassembled case and fix btl2cap offsets (discovered by enabling "data" field). Change-Id: Ic28c9bf19bcd6281b652be538b221da74df4bb76 Reviewed-on: https://code.wireshark.org/review/471 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-02eject the packet if data is NULL without doing anything else.Chris Maynard1-3/+5
svn path=/trunk/; revision=53733
2013-11-02Bluetooth: Use dissector data instead of pinfo->private_data. Bug 7893 ↵Michael Mann1-20/+17
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7893) From Michal Labedzki svn path=/trunk/; revision=53051
2013-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-2/+2
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster. - same for replace col_append_fstr and col_append_str - remove col_clear() when it's redundant: + before a col_set/col_add if the dissector can't throw an exception. - replace col_append() after a col_clear() with faster col_add... or col_set https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344 svn path=/trunk/; revision=52948
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-09-12Convert a few more dissectors to wmemPascal Quantin1-1/+1
svn path=/trunk/; revision=51991
2013-06-30Actually initialize the localhost ethernet address before settingJeff Morriss1-2/+7
dl_src/dl_dst to it. Fixes uninitialized-read warnings from Valgrind on the capture in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8827 svn path=/trunk/; revision=50268
2013-06-20From Michal Labedzki viaEvan Huus1-14/+14
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8824 Convert bluetooth emem trees to wmem trees. Add modelines and fix indentation. Correct typo in wmem_tree.h that still referred to emem. svn path=/trunk/; revision=50076
2013-03-30From Michal Labedzki via ↵Evan Huus1-0/+13
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8509 Unify bluetooth direction handling (sent vs rcvd). svn path=/trunk/; revision=48661
2013-03-30From Michal Labedzki via ↵Evan Huus1-0/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8509 Round 3 of Bluetooth SDP updates. Update the list of company IDs and fix service recognition. svn path=/trunk/; revision=48660
2013-03-19From Michal Labedzki via ↵Pascal Quantin1-3/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 : Remove C++ incompatibilities from Bluetooth dissectors and switch to wmem API svn path=/trunk/; revision=48414
2013-03-18From beroset:Anders Broman1-13/+13
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48396
2013-02-21Fix AVCTP, AVRCP, HCI AVL and L2CP for multiple interfaces/adaptersMichael Mann1-11/+58
From Michal Labedzki, bug 8367 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8367) svn path=/trunk/; revision=47809
2013-02-11From: Michal Labedzki:Anders Broman1-4/+7
Bluetooth: Improve support of MAP, PBAP, BPP and BIP in OBEX Add support for recognize profiles using OBEX (by "Target"), then add all Application Parameters specific for MAP, PBAP, BPP, BIP. Also fix one FIXME, so now dissecting by OBEX does not cause malformed frames while jumping over dissected packets. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8304 svn path=/trunk/; revision=47632
2013-01-31Comment out unused hf[] entries & etc.Bill Meier1-1/+3
(found by checkhf) svn path=/trunk/; revision=47389
2012-12-26From Michal Labedzki: To ensure that names are correct copy NULL too This ↵Anders Broman1-14/+14
fixes unknown characters sometimes show in src/dst columns, etc. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7639 svn path=/trunk/; revision=46789
2012-12-02Create a wmem pool in pinfo and use it for some address allocations.Evan Huus1-2/+3
A (better?) fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8030 See also thread starting at: http://www.wireshark.org/lists/wireshark-dev/201212/msg00001.html svn path=/trunk/; revision=46331
2012-12-02Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8030 :Jeff Morriss1-2/+2
Don't store an AT_STRINGZ address in ep_ allocated memory: that memory is freed before the addresses may be used. Use se_ memory instead (no, that's not really ideal either). It would appear that several other dissectors have the same problem. svn path=/trunk/; revision=46320
2012-11-30From Michal Labedzki:Anders Broman1-44/+42
Couple of coding style changes and fixes for: warning: declaration of ‘k_frame_number’ shadows a previous local warning: assignment discards qualifiers from pointer target type Part of: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5032 svn path=/trunk/; revision=46304
2012-11-29Another couple size_t-to-int warning fixes (I hope).Jeff Morriss1-4/+4
svn path=/trunk/; revision=46288
2012-11-29(Try to) fix some size_t-to-int warnings.Jeff Morriss1-10/+10
svn path=/trunk/; revision=46286
2012-11-29From Michal Labedzki:Anders Broman1-11/+147
Bluetooth: Add support for source/destination addresses Within resolving devices names. Also make header file more generic, packet-hci_h4.h renamed to packet-bluetooth-hci.h. Part of: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5032 svn path=/trunk/; revision=46278
2012-10-09From Michal Labedzki:Anders Broman1-1/+12
[PATCH 15] Bluetooth: Add modelines https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7639 svn path=/trunk/; revision=45422
2012-09-21From Michal Labedzki:Anders Broman1-5/+3
Bluetooth: Cleanup headers Remove redundant headers and sort existing to chosen convention. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7639 svn path=/trunk/; revision=45039
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017