[U-Boot] [PATCH] net: introduce packet capture support
rfried.dev at gmail.com
Fri Jun 14 07:29:12 UTC 2019
On Fri, Jun 14, 2019 at 10:12 AM Bin Meng <bmeng.cn at gmail.com> wrote:
> Hi Ramon,
> On Fri, Jun 14, 2019 at 2:18 PM Ramon Fried <rfried.dev at gmail.com> wrote:
> > Add support for capturing ethernet packets and storing
> > them in memory in PCAP(2.4) format, later to be analyzed by
> > any PCAP viewer software (IE. Wireshark)
> > This feature greatly assist debugging network issues such
> > as detecting dropped packets, packet corruption etc.
> > Signed-off-by: Ramon Fried <rfried.dev at gmail.com>
> > ---
> > include/net.h | 29 ++++++++++++++++++
> > net/Kconfig | 22 ++++++++++++++
> > net/Makefile | 1 +
> > net/net.c | 11 +++++++
> > net/pcap.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > 5 files changed, 146 insertions(+)
> > create mode 100644 net/pcap.c
> Nice to have such a feature. But how do we export the PCAP contents in
> RAM to a file and transfer it to host for analysis by WireShark?
> Should we support storing PCAP to a file on a file system in U-Boot?
When testing the feature under Qemu, I just dumped the memory from qemu.
This is just one option, if networking actually works, you could tftp send
it to the host, or perhaps even write it to block storage.
I only assume (didn't check) that there is a command that can dump memory
to file system.
More information about the U-Boot