bastibl / gr-foo

Some GNU Radio blocks that I use.
GNU General Public License v3.0
106 stars 56 forks source link

wireshark: add support for an IEEE 802.15.4 TAP Header #37

Closed mrene closed 2 months ago

mrene commented 2 months ago

This adds a new ZIGBEE_TAP link type to the wireshark connector block, prefixing an 802.15.4 TAP header to each captured frame.

It'll set the FCS to a 16-bit CRC to be compatible with the current ZIGBEE link type. Optionally, if a "channel" key exists in the pdu's dict, it will append the corresponding channel TLV.

Example tshark decode

``` Frame 1: 92 bytes on wire (736 bits), 92 bytes captured (736 bits) Encapsulation type: IEEE 802.15.4 Wireless with TAP pseudo-header (206) Arrival Time: Aug 16, 2024 21:48:01.551103000 EDT UTC Arrival Time: Aug 17, 2024 01:48:01.551103000 UTC Epoch Arrival Time: 1723859281.551103000 [Time shift for this packet: 0.000000000 seconds] [Time delta from previous captured frame: 0.000000000 seconds] [Time delta from previous displayed frame: 0.000000000 seconds] [Time since reference or first frame: 0.000000000 seconds] Frame Number: 1 Frame Length: 92 bytes (736 bits) Capture Length: 92 bytes (736 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: wpan-tap:6lowpan:ipv6:udp:mle] IEEE 802.15.4 TAP Header Version: 0 Reserved: 0 Length: 20 FCS type: ITU-T CRC16 (1) TLV Type: FCS type (0) TLV Length: 1 FCS Type: ITU-T CRC16 (1) Padding: 000000 Channel assignment: Page: Default (0), Number: 15 TLV Type: Channel assignment (3) TLV Length: 3 Channel: 15 Page: Default (0) Padding: 00 [Data Length: 72] IEEE 802.15.4 Data, Dst: Broadcast, Src: e6:69:73:e4:54:b5:c6:8b Frame Control Field: 0xd841, Frame Type: Data, PAN ID Compression, Destination Addressing Mode: Short/16-bit, Frame Version: IEEE Std 802.15.4-2006, Source Addressing Mode: Long/64-bit .... .... .... .001 = Frame Type: Data (0x1) .... .... .... 0... = Security Enabled: False .... .... ...0 .... = Frame Pending: False .... .... ..0. .... = Acknowledge Request: False .... .... .1.. .... = PAN ID Compression: True .... .... 0... .... = Reserved: False .... ...0 .... .... = Sequence Number Suppression: False .... ..0. .... .... = Information Elements Present: False .... 10.. .... .... = Destination Addressing Mode: Short/16-bit (0x2) ..01 .... .... .... = Frame Version: IEEE Std 802.15.4-2006 (1) 11.. .... .... .... = Source Addressing Mode: Long/64-bit (0x3) Sequence Number: 139 Destination PAN: 0x6413 Destination: 0xffff Extended Source: e6:69:73:e4:54:b5:c6:8b (e6:69:73:e4:54:b5:c6:8b) FCS: 0x1a57 (Correct) 6LoWPAN, Src: fe80::e469:73e4:54b5:c68b, Dest: ff02::1 IPHC Header 011. .... = Pattern: IP header compression (0x03) ...1 1... .... .... = Traffic class and flow label: Version, traffic class, and flow label compressed (0x3) .... .1.. .... .... = Next header: Compressed .... ..11 .... .... = Hop limit: 255 (0x3) .... .... 0... .... = Context identifier extension: False .... .... .0.. .... = Source address compression: Stateless .... .... ..11 .... = Source address mode: Compressed (0x0003) .... .... .... 1... = Multicast address compression: True .... .... .... .0.. = Destination address compression: Stateless .... .... .... ..11 = Destination address mode: 8-bits inline (0x0003) [Source context: fe80::] [Destination context: fe80::] [Source: fe80::e469:73e4:54b5:c68b] Destination: ff02::1 UDP header compression 1111 0... = Pattern: UDP compression header (0x1e) .... .0.. = Checksum: Inline .... ..00 = Ports: Inline (0) Source port: 19788 Destination port: 19788 UDP checksum: 0x0ae8 Internet Protocol Version 6, Src: fe80::e469:73e4:54b5:c68b, Dst: ff02::1 0110 .... = Version: 6 .... 0000 0000 .... .... .... .... .... = Traffic Class: 0x00 (DSCP: CS0, ECN: Not-ECT) .... 0000 00.. .... .... .... .... .... = Differentiated Services Codepoint: Default (0) .... .... ..00 .... .... .... .... .... = Explicit Congestion Notification: Not ECN-Capable Transport (0) .... 0000 0000 0000 0000 0000 = Flow Label: 0x00000 Payload Length: 53 Next Header: UDP (17) Hop Limit: 255 Source Address: fe80::e469:73e4:54b5:c68b Destination Address: ff02::1 ```

bastibl commented 2 months ago

Great, thanks for the PR! Is there a some public fork that sets these values?