From e0749025f259754aa031d997457a308686136909 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Sat, 19 Feb 2011 18:55:51 +0100 Subject: 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. --- lib/debug.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/debug.h') 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) -- cgit v1.1