From c04eff910a7b18f47365f90fadb6133474e9cae5 Mon Sep 17 00:00:00 2001 From: Petri Savolainen Date: Tue, 24 Oct 2017 14:32:01 +0300 Subject: api: packet: print packet data Added debug print function which includes packet payload bytes. Printing starts from offset, so it's easy to e.g. limit print to IPv4 header bytes only: odp_packet_print_data(pkt, l3_offset(pkt), 20) Signed-off-by: Petri Savolainen Reviewed-by: Bill Fischofer Reviewed-by: Ilias Apalodimas Reviewed-by: Balasubramanian Manoharan Signed-off-by: Maxim Uvarov --- include/odp/api/spec/packet.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/odp/api/spec/packet.h b/include/odp/api/spec/packet.h index 62ecf70e1..3fc460641 100644 --- a/include/odp/api/spec/packet.h +++ b/include/odp/api/spec/packet.h @@ -1561,14 +1561,27 @@ void odp_packet_shaper_len_adjust_set(odp_packet_t pkt, int8_t adj); */ /** - * Print packet to the console + * Print packet debug information * - * Print all packet debug information to the console. + * Print all packet debug information to the ODP log. * * @param pkt Packet handle */ void odp_packet_print(odp_packet_t pkt); +/** + * Print packet data + * + * Print packet debug information with packet data to the ODP log. Operation + * prints 'len' bytes of packet data starting from 'offset' byte. Offset plus + * length must not exceed packet length (odp_packet_len()). + * + * @param pkt Packet handle + * @param offset Byte offset into the packet + * @param len Number of bytes to print + */ +void odp_packet_print_data(odp_packet_t pkt, uint32_t offset, uint32_t len); + /** * Perform full packet validity check * -- cgit v1.2.3