summaryrefslogtreecommitdiff
path: root/lib/debug.h
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-02-19 18:55:51 +0100
committerLinus Nordberg <linus@nordu.net>2011-02-19 18:55:51 +0100
commite0749025f259754aa031d997457a308686136909 (patch)
treea0c9c98e09c6089c780f06053e9abbaec4a24438 /lib/debug.h
parent020e7688d91f2db00d1b573c8496119ede15e773 (diff)
Improve protocol robustness and invoke user callbacks.
All aborts are removed, as well as all asserts which aren't programming errors. When an invalid packet is received, the connection is closed, as per draft-ietf-radext-tcp-transport-08 (2.6.4). Use new rs_debug() macro rather than fprintf() for debug printouts. Coding style overhaul.
Diffstat (limited to 'lib/debug.h')
-rw-r--r--lib/debug.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/debug.h b/lib/debug.h
index 3156c24..4a899b2 100644
--- a/lib/debug.h
+++ b/lib/debug.h
@@ -11,13 +11,16 @@
extern "C" {
#endif
+struct rs_packet;
+struct rs_attr;
void rs_dump_packet (const struct rs_packet *pkt);
void rs_dump_attr (const struct rs_attr *attr);
+int _rs_debug (const char *fmt, ...);
-#if defined DEBUG
-int rs_debug (const char *fmt, ...);
+#if defined (DEBUG)
+#define rs_debug(x) _rs_debug x
#else
-#define rs_debug (void)
+#define rs_debug(x) do {;} while (0)
#endif
#if defined (__cplusplus)