diff options
author | Petri Savolainen <petri.savolainen@linaro.org> | 2017-10-24 14:32:01 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2017-10-27 21:57:50 +0300 |
commit | c04eff910a7b18f47365f90fadb6133474e9cae5 (patch) | |
tree | bf82dc6aabeb2c3c873d8dc9c1335aa3d064969d | |
parent | 201a96f9bbcbabd904362ba05a179c72689a578e (diff) |
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 <petri.savolainen@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | include/odp/api/spec/packet.h | 17 |
1 files 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,15 +1561,28 @@ 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 * * The operation may consume considerable number of cpu cycles depending on |