with an RPC structure in many systems header files.
void cf_section_free_all(CONF_SECTION *cp);
/* JLN -- Newly added */
-
-CLIENT *client_find(uint32_t ipno);
-REALM *realm_find(const char *realm);
-char *client_name(uint32_t ipaddr);
CONF_PAIR *cf_pair_find(CONF_SECTION *section, const char *name);
CONF_PAIR *cf_pair_find_next(CONF_SECTION *section, CONF_PAIR *pair, const char *name);
time_t timestamp;
/* Could almost keep a const char * here instead of a _copy_ of the
- * secret... but what if the CLIENT structure is freed because it was
+ * secret... but what if the RADCLIENT structure is freed because it was
* taken out of the config file and SIGHUPed? */
char proxysecret[32];
int proxy_is_replicate;
struct auth_req *next;
} REQUEST;
-typedef struct client {
+typedef struct radclient {
uint32_t ipaddr;
char longname[256];
u_char secret[32];
char shortname[32];
- struct client *next;
-} CLIENT;
+ struct radclient *next;
+} RADCLIENT;
typedef struct nas {
uint32_t ipaddr;
void (*reset_signal(int signo, void (*func)(int)))(int);
void request_free(REQUEST *request);
RADIUS_PACKET * build_reply(int code, REQUEST *request,
- VALUE_PAIR *vps, const char *user_msg);
+ VALUE_PAIR *vps, const char *user_msg);
/* files.c */
-CLIENT *client_find(uint32_t ipno);
+RADCLIENT *client_find(uint32_t ipno);
char *client_name(uint32_t ipno);
int read_clients_file(const char *);
REALM *realm_find(const char *);
#define xstrdup strdup
CONF_SECTION *config;
-extern CLIENT *clients;
+extern RADCLIENT *clients;
extern REALM *realms;
extern void realm_free(REALM *cl);
}
/*
- * Free a CLIENT list.
+ * Free a RADCLIENT list.
*/
-static void clients_free(CLIENT *cl)
+static void clients_free(RADCLIENT *cl)
{
- CLIENT *next;
+ RADCLIENT *next;
while(cl) {
next = cl->next;
static int generate_clients()
{
CONF_SECTION *cs;
- CLIENT *c;
- char *hostnm, *secret, *shortnm;
+ RADCLIENT *c;
+ char *hostnm, *secret, *shortnm;
clients_free(clients);
clients = NULL;
/*
* The size is fine.. Let's create the buffer
*/
- if ((c = malloc(sizeof(CLIENT))) == NULL) {
+ if ((c = malloc(sizeof(RADCLIENT))) == NULL) {
log(L_CONS|L_ERR, "[%s]: out of memory while doint client",
hostnm);
return -1;
#include "radiusd.h"
#include "modules.h"
-CLIENT *clients;
+RADCLIENT *clients;
#ifndef WITH_NEW_CONFIG
static
#endif
#endif
/*
- * Free a CLIENT list.
+ * Free a RADCLIENT list.
*/
-static void clients_free(CLIENT *cl)
+static void clients_free(RADCLIENT *cl)
{
- CLIENT *next;
+ RADCLIENT *next;
while(cl) {
next = cl->next;
int read_clients_file(const char *file)
{
FILE *fp;
- CLIENT *c;
+ RADCLIENT *c;
char buffer[256];
char hostnm[256];
char secret[256];
/*
* It should be OK now, let's create the buffer.
*/
- if ((c = malloc(sizeof(CLIENT))) == NULL) {
+ if ((c = malloc(sizeof(RADCLIENT))) == NULL) {
log(L_CONS|L_ERR, "%s[%d]: out of memory",
file, lineno);
return -1;
/*
- * Find a client in the CLIENTS list.
+ * Find a client in the RADCLIENTS list.
*/
-CLIENT *client_find(uint32_t ipaddr)
+RADCLIENT *client_find(uint32_t ipaddr)
{
- CLIENT *cl;
+ RADCLIENT *cl;
for(cl = clients; cl; cl = cl->next)
if (ipaddr == cl->ipaddr)
*/
char *client_name(uint32_t ipaddr)
{
- CLIENT *cl;
+ RADCLIENT *cl;
if ((cl = client_find(ipaddr)) != NULL) {
if (cl->shortname[0])
VALUE_PAIR *passpair;
VALUE_PAIR *delaypair;
VALUE_PAIR *vp, *vps;
- CLIENT *client;
+ RADCLIENT *client;
REALM *realm;
char *realmname;
int replicating;
*/
struct timeval *proxy_setuptimeout(struct timeval *tv)
{
- time_t now = time(0);
+ time_t now = time(NULL);
time_t difference, smallest;
int foundone = 0;
REQUEST *p;
void proxy_retry(void)
{
- time_t now = time(0);
+ time_t now = time(NULL);
REQUEST *p;
for (p = proxy_requests; p; p = p->next) {
int main(int argc, char **argv)
{
- CLIENT *cl;
+ RADCLIENT *cl;
REQUEST *request;
RADIUS_PACKET *packet;
#ifdef RADIUS_PID