aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nordic_ble.c
AgeCommit message (Collapse)AuthorFilesLines
2020-04-14Bluetooth: nordic: Calculate packet time for LE Coded PHY packetsJoakim Andersson1-3/+28
Calculate the packet time of an LE Coded PHY using both S8 and S2 coding. The First part of the packet is always sent in S8 coding. And the CI flag tells which coding rate is used for FEC block 2. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc634531f Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36788 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-14Bluetooth: Add support for dissecting packet format on LE Coded PHYJoakim Andersson1-4/+0
Add support for dissecting packet format on LE Coded PHY. This only includes one additional field, the Coding Indicator (CI) which provides information about the symbol rate of the FEC Block 2 of the pdu. The TERM1 and TERM2 bytes are like the preamble assumed not included in the PDU, these blocks are just bit-sequences for the radio and contains no important information. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc634531d Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36787 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-13Bluetooth: nordic: Add support for protocol version 3Joakim Andersson1-73/+270
Add protocol for the nRF Sniffer for BLE version 3 of the UART protocol. These changes provides support for giving different packet IDs for advertising physical channel and data physical channel. The flags for advertising physical changes are intepreted differently, the direction, encryption and MIC valid flags are always zero and are therefore marked as reserved for future use instead. The time_delta field is changed to be a firmware timestamp instead. This is to allow better timestamping of the packets as the timestamp earlies was provided by the extcap python code, which does not provide accurate timestamps. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc634531c Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36786 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-13Bluetooth: nordic: Document that the payload excludes the preambleJoakim Andersson1-1/+1
Document that the payload of the BLE_EVENT packet is excluding the preamble that is sent on air. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc634531b Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36785 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-04-13Bluetooth: Provide BTLE physical channel pdu type from capture context.Joakim Andersson1-0/+2
Add BTLE physical channel pdu type from capture context. The dissector uses the access address to determine if the packet is either an Advertising physical channel PDU or a Data physical channel PDU. This assupmtion is not valid for Periodic Advertising where the AUX_SYNC_IND advertising packet will be sent with a non-advertising access address. There is also the new Isochronous physical channel PDU which can be both broadcasted or connection-oriented. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc6345318 Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36782 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-04-13Bluetooth: nordic: Document RSSI sample result in the nordic_ble dissectorJoakim Andersson1-3/+9
Document the RSSI sample result in the nordic_ble dissector. This value is directly from the RSSISAMPLE register which is a positive number. It must be converted to negative value. Change to using INT8 because the RSSISAMPLE is only 7 bits value, and will always be a positive number. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc634531a Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36784 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-04-12Bluetooth: Add channel to bluetooth dissector contextJoakim Andersson1-1/+4
Add channel index to the bluetooth dissector context. Change-Id: I7f0ad74b3e30ffecade59b6d0c5965bfc6345312 Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no> Reviewed-on: https://code.wireshark.org/review/36777 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-2/+2
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-2/+2
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-08-21nordic_ble: Set PHY display type to BASE_DECStig Bjørlykke1-1/+1
Change-Id: I4a2e2142bbaf08e11a735d125a201c8651cdc857 Reviewed-on: https://code.wireshark.org/review/29217 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-03-13nordic_ble: Fix delta time start-to-start calculationStig Bjørlykke1-80/+199
The on-air time for a packet was calculated wrong because it was using the wrong number of on-air bytes. This has been corrected. Calculating delta time start-to-start for BLE 4.2 requires support for on-air packet size up to 255 bytes (LE Data Length Extensions). For this the payload length size in the header has changed to two bytes. Calculating delta time start-to-start for BLE 5.0 needs physical layer data rate (LE 1M PHY or LE 2M PHY). For this the flags was extended with PHY values. Removed superfluous min and max length checks. Change-Id: I40bef14f0c19ee77a402efc76e5d01826e63e603 Reviewed-on: https://code.wireshark.org/review/26457 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07dissectors: more SPDX license convertions.Dario Lombardo1-13/+1
Change-Id: I96e1f1cdbaaf49d65705ecacc903f73cf0e47d7c Reviewed-on: https://code.wireshark.org/review/26334 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2017-08-26wiretap: Add WTAP_ENCAP_NORDIC_BLEStig Bjørlykke1-0/+2
Use this for nordic_ble dissection. Change-Id: I5323cbd8c244c4e3b645825c60d040e1ae8f3b81 Reviewed-on: https://code.wireshark.org/review/23219 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-08-24nordic_ble: Fix calculating delta time start to startStig Bjørlykke1-9/+23
The calculation must be based on the length of the previous packet, not the last packet selected in the list. Also mark this entry as generated. Change-Id: I2e0a30ce28f5824f73ffe2d90d3043ff309292dc Reviewed-on: https://code.wireshark.org/review/23191 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>
2017-08-19nordic_ble: Preserve legacy version supportStig Bjørlykke1-4/+6
Change-Id: I8354955f802ba47158b78358084cd4211c1c6d79 Reviewed-on: https://code.wireshark.org/review/23137 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-08-19nordic_ble: Add packet format descriptionStig Bjørlykke1-4/+95
Also move "Length of packet" to correct position. Change-Id: I2efd5087396a8904eb16bcc3191cc9ea3beac2e9 Reviewed-on: https://code.wireshark.org/review/23135 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-14nordic_ble: Add legacy version supportStig Bjørlykke1-32/+63
Added back legacy version (<= 0.9.7) support after restructuring for dissector completeness. Change-Id: I5355bf8faa1b9fd8ee9056254048fe5c314b6efb Reviewed-on: https://code.wireshark.org/review/19271 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-14nordic_ble: Improved dissector codeStig Bjørlykke1-501/+210
- Added header fields in a new subtree. - Restructured to use fewer functions and to use offset counting instead of offset defines. - Removed support for legacy version 0.9.7. - Removed unused code. Change-Id: I9eb6c8b3b450ddb95fb0f4bdd9f9717dafa687b0 Reviewed-on: https://code.wireshark.org/review/19260 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>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-11/+6
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67, convert dissectors that use "udp.port". More cleanup done on dissectors that use both TCP and UDP dissector tables, so that less preference callbacks exist. Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3 Reviewed-on: https://code.wireshark.org/review/18120 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-09nordic_ble: Capitalize short nameStig Bjørlykke1-1/+1
Change-Id: I2130b012f28b23342679f33e1e19a4e5e0943090 Reviewed-on: https://code.wireshark.org/review/17607 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-08-10Remove unneeded include.Guy Harris1-1/+0
Change-Id: I9c55152ca43cd2c25916fe0ed4e41dee9d2377a8 Reviewed-on: https://code.wireshark.org/review/16987 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-09nordic_ble: Add a subtree for flagsStig Bjørlykke1-7/+8
Change-Id: Ifb829280ca02a20a4466e7059a76a5bf3cbe4107 Reviewed-on: https://code.wireshark.org/review/16985 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>
2016-08-08nordic-ble: Capitalize header field names.Stig Bjørlykke1-15/+15
Change-Id: Ib114b2bad01f768eb7eba4115441d58aadc1b34e Reviewed-on: https://code.wireshark.org/review/16959 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-08-04[BTLE-Nordic] Set pinfo->p2p_dir as seen from "Master".AndersBroman1-3/+2
Change-Id: I12ad3a9b092e35a3418a11ec4d17cce157f320b6 Reviewed-on: https://code.wireshark.org/review/16882 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-02[BTLE] Change address from unknown_0x... to master or slave.AndersBroman1-0/+2
Change-Id: I571a2f6f96c37e608201092e7ea7f53862b8d2ad Reviewed-on: https://code.wireshark.org/review/16844 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-08-02[BLE] Make the Nordic BLE dissector fill in the btle_context_t struct.AndersBroman1-22/+25
Change-Id: I14e62126d022dde10dcce2d7e974def0dc664b20 Reviewed-on: https://code.wireshark.org/review/16840 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-22Get rid of all references to new_create_dissector_handle().Guy Harris1-4/+0
It went away a long time ago; use create_dissector_handle(). Change-Id: I28e90821033621bc7a5572243ff5871b4e67d60d Reviewed-on: https://code.wireshark.org/review/16592 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-22Add Nordic semiconductors dissector to read files produced by their BTLEAndersBroman1-0/+743
sniffer. Code downloaded from https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer and cleaned up and modified to comple with current Wireshark version. Bug 12637 Change-Id: Ic73122f35039b4245d6219b825a28c10f22f36ad Reviewed-on: https://code.wireshark.org/review/16569 Reviewed-by: Anders Broman <a.broman58@gmail.com>