From 798962cedd7e30f95e9a3a6126276b77086a6d08 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 7 Oct 2023 21:53:12 -0400 Subject: net: Add option for tracing packets Add an option to trace all packets send/received. This can be helpful when debugging protocol issues, as the packets can then be imported into wireshark [1] and analyzed further. [1] https://www.wireshark.org/docs/wsug_html_chunked/ChIOImportSection.html Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- net/net.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'net') diff --git a/net/net.c b/net/net.c index 8357f08410..0fb2d25077 100644 --- a/net/net.c +++ b/net/net.c @@ -1201,6 +1201,9 @@ void net_process_received_packet(uchar *in_packet, int len) ushort cti = 0, vlanid = VLAN_NONE, myvlanid, mynvlanid; debug_cond(DEBUG_NET_PKT, "packet received\n"); + if (DEBUG_NET_PKT_TRACE) + print_hex_dump_bytes("rx: ", DUMP_PREFIX_OFFSET, in_packet, + len); #if defined(CONFIG_CMD_PCAP) pcap_post(in_packet, len, false); -- cgit v1.2.3