1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2010-2014 Intel Corporation 3 */ 4 5 #ifndef _RTE_HEXDUMP_H_ 6 #define _RTE_HEXDUMP_H_ 7 8 /** 9 * @file 10 * Simple API to dump out memory in a special hex format. 11 */ 12 13 #include <stdio.h> 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 /** 20 * Dump out memory in a special hex dump format. 21 * 22 * @param f 23 * A pointer to a file for output. 24 * @param title 25 * If not NULL this string is printed as a header to the output. 26 * @param buf 27 * This is the buffer address to print out. 28 * @param len 29 * The number of bytes to dump out. 30 */ 31 void 32 rte_hexdump(FILE *f, const char *title, const void *buf, unsigned int len); 33 34 /** 35 * Dump out memory in a hex format with colons between bytes. 36 * 37 * @param f 38 * A pointer to a file for output. 39 * @param title 40 * If not NULL this string is printed as a header to the output. 41 * @param buf 42 * This is the buffer address to print out. 43 * @param len 44 * The number of bytes to dump out. 45 */ 46 void 47 rte_memdump(FILE *f, const char *title, const void *buf, unsigned int len); 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif /* _RTE_HEXDUMP_H_ */ 54