renamed the CLIENT structure to RADCLIENT, as CLIENT conflicts
authoraland <aland>
Mon, 28 Feb 2000 16:04:20 +0000 (16:04 +0000)
committeraland <aland>
Mon, 28 Feb 2000 16:04:20 +0000 (16:04 +0000)
with an RPC structure in many systems header files.

src/include/conffile.h
src/include/radiusd.h
src/main/conffile.c
src/main/files.c
src/main/proxy.c
src/main/radiusd.c

index 15ab185..39010d5 100644 (file)
@@ -31,10 +31,6 @@ void         cf_section_free(CONF_SECTION *cp);
 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);
index 940d60f..99ef8fc 100644 (file)
@@ -40,7 +40,7 @@ typedef struct auth_req {
        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;
@@ -52,13 +52,13 @@ typedef struct auth_req {
        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;
@@ -162,10 +162,10 @@ struct passwd     *rad_getpwnam(const char *);
 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 *);
index 02a6a95..4ead46d 100644 (file)
@@ -26,7 +26,7 @@
 #define xstrdup strdup
 
 CONF_SECTION   *config;
-extern CLIENT  *clients;
+extern RADCLIENT  *clients;
 extern REALM   *realms;
 extern void realm_free(REALM *cl);
 
@@ -424,12 +424,12 @@ static int generate_realms()
 }
 
 /*
- *     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;
@@ -446,8 +446,8 @@ static void clients_free(CLIENT *cl)
 static int generate_clients() 
 {
        CONF_SECTION    *cs;
-       CLIENT                  *c;
-       char                    *hostnm, *secret, *shortnm;
+       RADCLIENT       *c;
+       char            *hostnm, *secret, *shortnm;
 
        clients_free(clients);
        clients = NULL;
@@ -476,7 +476,7 @@ static int generate_clients()
                        /*
                         * 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;
index f51ea57..ef01a2f 100644 (file)
@@ -29,7 +29,7 @@ static const char rcsid[] = "$Id$";
 #include       "radiusd.h"
 #include       "modules.h"
 
-CLIENT                 *clients;
+RADCLIENT                      *clients;
 #ifndef WITH_NEW_CONFIG
 static
 #endif
@@ -281,11 +281,11 @@ static void debug_pair_list(PAIR_LIST *pl)
 #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;
@@ -301,7 +301,7 @@ static void clients_free(CLIENT *cl)
 int read_clients_file(const char *file)
 {
        FILE    *fp;
-       CLIENT  *c;
+       RADCLIENT       *c;
        char    buffer[256];
        char    hostnm[256];
        char    secret[256];
@@ -361,7 +361,7 @@ int read_clients_file(const char *file)
                /*
                 *      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;
@@ -387,11 +387,11 @@ int read_clients_file(const char *file)
 
 
 /*
- *     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)
@@ -406,7 +406,7 @@ CLIENT *client_find(uint32_t ipaddr)
  */
 char *client_name(uint32_t ipaddr)
 {
-       CLIENT *cl;
+       RADCLIENT *cl;
 
        if ((cl = client_find(ipaddr)) != NULL) {
                if (cl->shortname[0])
index 794a64e..178adcf 100644 (file)
@@ -173,7 +173,7 @@ int proxy_send(REQUEST *request)
        VALUE_PAIR              *passpair;
        VALUE_PAIR              *delaypair;
        VALUE_PAIR              *vp, *vps;
-       CLIENT                  *client;
+       RADCLIENT               *client;
        REALM                   *realm;
        char                    *realmname;
        int                     replicating;
@@ -544,7 +544,7 @@ int proxy_receive(REQUEST *request)
  */
 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;
@@ -572,7 +572,7 @@ struct timeval *proxy_setuptimeout(struct timeval *tv)
 
 void proxy_retry(void)
 {
-       time_t now = time(0);
+       time_t now = time(NULL);
        REQUEST *p;
 
        for (p = proxy_requests; p; p = p->next) {
index dc2c76f..27b48d2 100644 (file)
@@ -151,7 +151,7 @@ static void reread_config(int reload)
 
 int main(int argc, char **argv)
 {
-       CLIENT                  *cl;
+       RADCLIENT               *cl;
        REQUEST                 *request;
        RADIUS_PACKET           *packet;
 #ifdef RADIUS_PID