Improve protocol robustness and invoke user callbacks.
[radsecproxy.git] / lib / debug.h
1 /* See the file COPYING for licensing information.  */
2
3 #define hd(p, l) { int i;               \
4     for (i = 1; i <= l; i++) {          \
5       printf ("%02x ", p[i-1]);         \
6       if (i % 8 == 0) printf (" ");     \
7       if (i % 16 == 0) printf ("\n"); } \
8     printf ("\n"); }
9
10 #if defined (__cplusplus)
11 extern "C" {
12 #endif
13
14 struct rs_packet;
15 struct rs_attr;
16 void rs_dump_packet (const struct rs_packet *pkt);
17 void rs_dump_attr (const struct rs_attr *attr);
18 int _rs_debug (const char *fmt, ...);
19
20 #if defined (DEBUG)
21 #define rs_debug(x) _rs_debug x
22 #else
23 #define rs_debug(x) do {;} while (0)
24 #endif
25
26 #if defined (__cplusplus)
27 }
28 #endif