blob: 10318ef0a9e36ce0237fcadd3468ed8397a2ba9b [file] [log] [blame]
Ramon Friedf6e296f2019-07-18 21:43:31 +03001PCAP:
2
Michal Simek50fa1182023-05-17 09:17:16 +02003U-Boot supports live Ethernet packet capture in PCAP(2.4) format.
Ramon Friedf6e296f2019-07-18 21:43:31 +03004This is enabled by CONFIG_CMD_PCAP.
5
6The capture is stored on physical memory, and should be copied to
7a machine capable of parsing and displaying PCAP files (IE. wireshark)
8If networking works properly one can copy the capture file from physical memory
9using tftpput, or save it to local storage with (sf write, mmc write, fatwrite, etc)
10
11the pcap capturing requires maximum buffer size.
12when the buffer is full an error message will be displayed and then packets
13will silently drop.
14the actual capture file size is populate in the environment variable "pcapsize".
15
16Usage example:
17
18# Initialize pcap capture to physical address (0x100000) with maximum size of
19# 100000 bytes.
20
21# Start capture
22pcap start
23
24# Initialize network activity
25env set ipaddr 10.0.2.15; env set serverip 10.0.2.2; tftp uImage64
26
27# Stop capture
28pcap stop
29
30# pcap init 0x100000 100000
31PCAP capture initialized: addr: 0xffffffff80100000 max length: 100000
32
33# pcap start
34# env set ipaddr 10.0.2.15; env set serverip 10.0.2.2; tftp uImage64
35eth0@10000000: PHY present at 0
36eth0@10000000: link up, 1000Mbps full-duplex (lpa: 0x7c00)
37Using eth0@10000000 device
38TFTP from server 10.0.2.2; our IP address is 10.0.2.15
39Filename 'uImage64'.
40Load address: 0xffffffff88000000
41Loading: #################################################################
42 #################################################################
43 #################################################################
44 #################################################################
45!!! Buffer is full, consider increasing buffer size !!!
46 #################################################################
47 #################################################################
48 #################################################################
49 #################################################################
50 #################################################################
51 #
52 18.2 MiB/s
53done
54Bytes transferred = 8359376 (7f8dd0 hex)
55PCAP status:
56 Initialized addr: 0xffffffff80100000 max length: 100000
57 Status: Active. file size: 99991
58 Incoming packets: 66 Outgoing packets: 67
59
60# pcap stop
61# tftpput 0xffffffff80100000 $pcapsize 10.0.2.2:capture.pcap