* Logging macros
*/
#undef DEBUG
-#define DEBUG(fmt, ...) if (do_output && (fr_debug_flag > 0)) fprintf(fr_log_fp, fmt "\n", ## __VA_ARGS__)
+#define DEBUG(fmt, ...) if (do_output && (rc_debug_flag > 0)) fprintf(fr_log_fp, fmt "\n", ## __VA_ARGS__)
#undef DEBUG2
-#define DEBUG2(fmt, ...) if (do_output && (fr_debug_flag > 1)) fprintf(fr_log_fp, fmt "\n", ## __VA_ARGS__)
+#define DEBUG2(fmt, ...) if (do_output && (rc_debug_flag > 1)) fprintf(fr_log_fp, fmt "\n", ## __VA_ARGS__)
#define ERROR(fmt, ...) if (do_output) fr_perror("radclient: " fmt, ## __VA_ARGS__)
-#define RDEBUG_ENABLED() (do_output && (fr_debug_flag > 0))
-#define RDEBUG_ENABLED2() (do_output && (fr_debug_flag > 1))
+#define RDEBUG_ENABLED() (do_output && (rc_debug_flag > 0))
+#define RDEBUG_ENABLED2() (do_output && (rc_debug_flag > 1))
#define REDEBUG(fmt, ...) if (do_output) fr_perror("(%" PRIu64 ") " fmt , request->num, ## __VA_ARGS__)
-#define RDEBUG(fmt, ...) if (do_output && (fr_debug_flag > 0)) fprintf(fr_log_fp, "(%" PRIu64 ") " fmt "\n", request->num, ## __VA_ARGS__)
-#define RDEBUG2(fmt, ...) if (do_output && (fr_debug_flag > 1)) fprintf(fr_log_fp, "(%" PRIu64 ") " fmt "\n", request->num, ## __VA_ARGS__)
+#define RDEBUG(fmt, ...) if (do_output && (rc_debug_flag > 0)) fprintf(fr_log_fp, "(%" PRIu64 ") " fmt "\n", request->num, ## __VA_ARGS__)
+#define RDEBUG2(fmt, ...) if (do_output && (rc_debug_flag > 1)) fprintf(fr_log_fp, "(%" PRIu64 ") " fmt "\n", request->num, ## __VA_ARGS__)
typedef struct rc_stats {
uint64_t accepted; //!< Requests to which we received a accept
static rc_request_t *request_head = NULL;
static rc_request_t *rc_request_tail = NULL;
+static int rc_debug_flag;
+
char const *radclient_version = "radclient version " RADIUSD_VERSION_STRING
#ifdef RADIUSD_VERSION_COMMIT
" (git #" STRINGIFY(RADIUSD_VERSION_COMMIT) ")"
rc_request_t *this;
int force_af = AF_UNSPEC;
- fr_debug_flag = 2;
+ /*
+ * It's easier having two sets of flags to set the
+ * verbosity of library calls and the verbosity of
+ * radclient.
+ */
+ rc_debug_flag = 1;
+ fr_debug_flag = 0;
fr_log_fp = stdout;
#ifndef NDEBUG
do_output = false;
fr_log_fp = NULL; /* no output from you, either! */
break;
+
case 'r':
if (!isdigit((int) *optarg))
usage();
break;
case 'x':
fr_debug_flag++;
+ rc_debug_flag++;
break;
case 'h':
default: