File tree Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Expand file tree Collapse file tree 4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -85,3 +85,13 @@ $ zigpy ota dump-firmware 10047227-1.2-TRADFRI-cv-cct-unified-2.3.050.ota.ota.si
85
85
| grep 'Ember Version'
86
86
Ember Version: 6.3.1.1
87
87
```
88
+
89
+
90
+ # PCAP
91
+ Re-calculate the FCS on a packet capture due to a bug in current EmberZNet SDK releases:
92
+ ``` console
93
+ $ # Fix an existing capture
94
+ $ zigpy pcap fix-fcs input.pcap fixed.pcap
95
+ $ # Fix a capture from stdin and send it to stdout
96
+ $ bellows -d /dev/cu.GoControl_zigbee dump -w /dev/stdout | zigpy pcap fix-fcs - - | wireshark -k -S -i -
97
+ ```
Original file line number Diff line number Diff line change 21
21
"zigpy" ,
22
22
"click" ,
23
23
"coloredlogs" ,
24
+ "scapy" ,
24
25
],
25
26
extras_require = {
26
27
# [all] pulls in all radio libraries
Original file line number Diff line number Diff line change 1
1
import zigpy_cli .ota # noqa: F401
2
+ import zigpy_cli .pcap # noqa: F401
2
3
import zigpy_cli .radio # noqa: F401
3
4
from zigpy_cli .cli import cli # noqa: F401
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+
5
+ import click
6
+ from scapy .utils import PcapReader , PcapWriter
7
+ from scapy .config import conf as scapy_conf
8
+ from scapy .layers .dot15d4 import Dot15d4 # NOQA: F401
9
+
10
+ from zigpy_cli .cli import cli
11
+
12
+ scapy_conf .dot15d4_protocol = "zigbee"
13
+
14
+ LOGGER = logging .getLogger (__name__ )
15
+
16
+
17
+ @cli .group ()
18
+ def pcap ():
19
+ pass
20
+
21
+
22
+ @pcap .command ()
23
+ @click .argument ("input" , type = click .File ("rb" ))
24
+ @click .argument ("output" , type = click .File ("wb" ))
25
+ def fix_fcs (input , output ):
26
+ reader = PcapReader (input .raw )
27
+ writer = PcapWriter (output .raw )
28
+
29
+ for packet in reader :
30
+ packet .fcs = None
31
+ writer .write (packet )
You can’t perform that action at this time.
0 commit comments