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 * @return
31 *		None.
32 */
33 
34 extern void
35 rte_hexdump(FILE *f, const char * title, const void * buf, unsigned int len);
36 
37 /**
38 * Dump out memory in a hex format with colons between bytes.
39 *
40 * @param f
41 *		A pointer to a file for output
42 * @param title
43 *		If not NULL this string is printed as a header to the output.
44 * @param buf
45 *		This is the buffer address to print out.
46 * @param len
47 *		The number of bytes to dump out
48 * @return
49 *		None.
50 */
51 
52 void
53 rte_memdump(FILE *f, const char * title, const void * buf, unsigned int len);
54 
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif /* _RTE_HEXDUMP_H_ */
61