#include "conf.h"
#include "missing.h"
-#include <sys/time.h>
-
#if HAVE_PTHREAD_H
#include <pthread.h>
-typedef pthread_t child_pid_t ;
+typedef pthread_t child_pid_t;
#define child_kill pthread_kill
#else
typedef pid_t child_pid_t;
#define child_kill kill
#endif
-#define NO_SUCH_CHILD_PID (0)
+#define NO_SUCH_CHILD_PID (child_pid_t) (0)
+
+#ifndef NDEBUG
+#define REQUEST_MAGIC (0xdeadbeef)
+#endif
typedef struct auth_req {
+#ifndef NDEBUG
+ uint32_t magic; /* for debugging only */
+#endif
RADIUS_PACKET *packet;
RADIUS_PACKET *proxy;
RADIUS_PACKET *reply;
#define L_CONS 128
#ifndef FALSE
-# define FALSE 0
+#define FALSE 0
#endif
#ifndef TRUE
-# define TRUE 1
+/*
+ * This definition of true as NOT false is definitive. :) Making
+ * it '1' can cause problems on stupid platforms. See articles
+ * on C portability for more information.
+ */
+#define TRUE (!FALSE)
#endif
/* for paircompare_register */
*/
extern const char *progname;
extern int debug_flag;
-extern const char *radacct_dir;
-extern const char *radlog_dir;
-extern const char *radius_dir;
+extern char *radacct_dir;
+extern char *radlog_dir;
+extern const char *radlib_dir;
+extern char *radius_dir;
extern const char *radius_libdir;
extern uint32_t expiration_seconds;
-extern int radius_pid;
extern int use_dbm;
extern int log_stripped_names;
-extern int cache_passwd;
extern uint32_t myip;
extern int log_auth_detail;
extern int log_auth;
extern int acct_port;
extern int proxy_port;
extern int proxyfd;
+extern int proxy_retry_count;
+extern int proxy_retry_delay;
/*
* Function prototypes.
void debug_pair(FILE *, VALUE_PAIR *);
int log_err (char *);
void sig_cleanup(int);
-void remove_from_request_list(REQUEST *);
int rad_respond(REQUEST *, RAD_REQUEST_FUNP fun);
/* util.c */
/* proxy.c */
int proxy_receive(REQUEST *request);
int proxy_send(REQUEST *request);
-struct timeval *proxy_setuptimeout(struct timeval *);
-void proxy_retry(void);
/* auth.c */
char *auth_name(char *buf, size_t buflen, REQUEST *request, int do_cli);