]> git.ozlabs.org Git - ppp.git/commitdiff
Whitespace tidying.
authorDavid F. Skoll <dfs@roaringpenguin.com>
Wed, 27 Feb 2002 15:51:20 +0000 (15:51 +0000)
committerDavid F. Skoll <dfs@roaringpenguin.com>
Wed, 27 Feb 2002 15:51:20 +0000 (15:51 +0000)
16 files changed:
pppd/plugins/radius/radiusclient/include/includes.h
pppd/plugins/radius/radiusclient/include/messages.h
pppd/plugins/radius/radiusclient/include/pathnames.h
pppd/plugins/radius/radiusclient/include/radiusclient.h
pppd/plugins/radius/radiusclient/lib/clientid.c
pppd/plugins/radius/radiusclient/lib/config.c
pppd/plugins/radius/radiusclient/lib/env.c
pppd/plugins/radius/radiusclient/lib/ip_util.c
pppd/plugins/radius/radiusclient/lib/lock.c
pppd/plugins/radius/radiusclient/lib/log.c
pppd/plugins/radius/radiusclient/lib/md5.c
pppd/plugins/radius/radiusclient/lib/memcmp.c
pppd/plugins/radius/radiusclient/lib/strcasecmp.c
pppd/plugins/radius/radiusclient/lib/strdup.c
pppd/plugins/radius/radiusclient/lib/strerror.c
pppd/plugins/radius/radiusclient/lib/util.c

index 40179197bef09f854d501940b00a57449852f0f9..856d9a8b40cb46084ab3f7d875d3d7f8061d6128 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: includes.h,v 1.1 2002/01/22 16:03:01 dfs Exp $
+ * $Id: includes.h,v 1.2 2002/02/27 15:51:19 dfs Exp $
  *
  * Copyright (C) 1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -137,7 +137,7 @@ int sigprocmask (int, sigset_t *, sigset_t *);
  * prefer srandom/random over srand/rand as there generator has a
  * better distribution of the numbers on certain systems.
  * on Linux both generators are identical.
  * prefer srandom/random over srand/rand as there generator has a
  * better distribution of the numbers on certain systems.
  * on Linux both generators are identical.
- */ 
+ */
 #ifndef HAVE_RANDOM
 # ifdef HAVE_RAND
 # define srandom        srand
 #ifndef HAVE_RANDOM
 # ifdef HAVE_RAND
 # define srandom        srand
index 23c4f67e5187bd6c85789b5794a7fa667c260804..d20ce291c35d776cee4dfaaa7d0177aac3f2bb89 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: messages.h,v 1.1 2002/01/22 16:03:01 dfs Exp $
+ * $Id: messages.h,v 1.2 2002/02/27 15:51:19 dfs Exp $
  *
  * Copyright (C) 1995,1996 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1995,1996 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -50,4 +50,4 @@
 
 #define SC_STATUS_FAILED       "RADIUS: Status failure\r\n"
 
 
 #define SC_STATUS_FAILED       "RADIUS: Status failure\r\n"
 
-#endif /* MESSAGES_H */
\ No newline at end of file
+#endif /* MESSAGES_H */
index 2e6d21932004946b05bec25d96b33facd069979c..ffe8c6caf41cee9bf25fde17c8f36e8b3142edce 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: pathnames.h,v 1.1 2002/01/22 16:03:01 dfs Exp $
+ * $Id: pathnames.h,v 1.2 2002/02/27 15:51:19 dfs Exp $
  *
  * Copyright (C) 1995,1996 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1995,1996 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -25,4 +25,4 @@
 #define _PATH_ETC_RADIUSCLIENT_CONF       "/etc/radiusclient.conf"
 #endif
 
 #define _PATH_ETC_RADIUSCLIENT_CONF       "/etc/radiusclient.conf"
 #endif
 
-#endif /* PATHNAMES_H */
\ No newline at end of file
+#endif /* PATHNAMES_H */
index f5183fcf07dc25dca3e924898dbfb28605fe8457..cff68227bf6d7a6dbd6dc79a80cedabf006af73a 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: radiusclient.h,v 1.1 2002/01/22 16:03:01 dfs Exp $
+ * $Id: radiusclient.h,v 1.2 2002/02/27 15:51:19 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997,1998 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1995,1996,1997,1998 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -39,7 +39,7 @@
 #endif
 
 typedef unsigned long UINT4;
 #endif
 
 typedef unsigned long UINT4;
-typedef long         INT4;
+typedef long         INT4;
 
 #define AUTH_VECTOR_LEN                16
 #define AUTH_PASS_LEN          (3 * 16) /* multiple of 16 */
 
 #define AUTH_VECTOR_LEN                16
 #define AUTH_PASS_LEN          (3 * 16) /* multiple of 16 */
@@ -67,7 +67,7 @@ typedef long        INT4;
 typedef struct server {
        int max;
        char *name[SERVER_MAX];
 typedef struct server {
        int max;
        char *name[SERVER_MAX];
-       unsigned short port[SERVER_MAX];        
+       unsigned short port[SERVER_MAX];
 } SERVER;
 
 typedef struct pw_auth_hdr
 } SERVER;
 
 typedef struct pw_auth_hdr
@@ -260,7 +260,7 @@ typedef struct pw_auth_hdr
 #define PW_CALLBACK             16
 #define PW_USER_ERROR           17
 #define PW_HOST_REQUEST         18
 #define PW_CALLBACK             16
 #define PW_USER_ERROR           17
 #define PW_HOST_REQUEST         18
+
 /*     NAS PORT TYPES    */
 
 #define PW_ASYNC               0
 /*     NAS PORT TYPES    */
 
 #define PW_ASYNC               0
@@ -285,7 +285,7 @@ typedef struct dict_attr
        char              name[NAME_LENGTH + 1];        /* attribute name */
        int               value;                        /* attribute index */
        int               type;                         /* string, int, etc. */
        char              name[NAME_LENGTH + 1];        /* attribute name */
        int               value;                        /* attribute index */
        int               type;                         /* string, int, etc. */
-        int               vendorcode;                   /* vendor code */
+       int               vendorcode;                   /* vendor code */
        struct dict_attr *next;
 } DICT_ATTR;
 
        struct dict_attr *next;
 } DICT_ATTR;
 
@@ -309,7 +309,7 @@ typedef struct value_pair
 {
        char               name[NAME_LENGTH + 1];
        int                attribute;
 {
        char               name[NAME_LENGTH + 1];
        int                attribute;
-        int                vendorcode;
+       int                vendorcode;
        int                type;
        UINT4              lvalue;
        char               strvalue[AUTH_STRING_LEN + 1];
        int                type;
        UINT4              lvalue;
        char               strvalue[AUTH_STRING_LEN + 1];
@@ -319,7 +319,7 @@ typedef struct value_pair
 /* don't change this, as it has to be the same as in the Merit radiusd code */
 #define MGMT_POLL_SECRET       "Hardlyasecret"
 
 /* don't change this, as it has to be the same as in the Merit radiusd code */
 #define MGMT_POLL_SECRET       "Hardlyasecret"
 
-/*     Define return codes from "SendServer" utility */
+/*     Define return codes from "SendServer" utility */
 
 #define BADRESP_RC     -2
 #define ERROR_RC       -1
 
 #define BADRESP_RC     -2
 #define ERROR_RC       -1
index e86cac0e7513696d1ab23861846a2125b4dd36ad..f15084bda564e89c2ff428f5adf5e9daf4cee40b 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * $Id: clientid.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: clientid.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -20,7 +20,7 @@ struct map2id_s {
        struct map2id_s *next;
 };
 
        struct map2id_s *next;
 };
 
-static struct map2id_s *map2id_list = NULL; 
+static struct map2id_s *map2id_list = NULL;
 
 /*
  * Function: rc_read_mapfile
 
 /*
  * Function: rc_read_mapfile
@@ -29,7 +29,7 @@ static struct map2id_s *map2id_list = NULL;
  *
  * Arguments: the file name of the map file
  *
  *
  * Arguments: the file name of the map file
  *
- * Returns: zero on success, negative integer on failure 
+ * Returns: zero on success, negative integer on failure
  */
 
 int rc_read_mapfile(char *filename)
  */
 
 int rc_read_mapfile(char *filename)
@@ -40,51 +40,51 @@ int rc_read_mapfile(char *filename)
        struct map2id_s *p;
        int lnr = 0;
 
        struct map2id_s *p;
        int lnr = 0;
 
-        if ((mapfd = fopen(filename,"r")) == NULL)
-        {
-               rc_log(LOG_ERR,"rc_read_mapfile: can't read %s: %s", filename, strerror(errno));                                                        
+       if ((mapfd = fopen(filename,"r")) == NULL)
+       {
+               rc_log(LOG_ERR,"rc_read_mapfile: can't read %s: %s", filename, strerror(errno));
                return (-1);
        }
                return (-1);
        }
-       
+
 #define SKIP(p) while(*p && isspace(*p)) p++;
 
 #define SKIP(p) while(*p && isspace(*p)) p++;
 
-        while (fgets(buffer, sizeof(buffer), mapfd) != NULL)
-        {
-               lnr++;
-        
+       while (fgets(buffer, sizeof(buffer), mapfd) != NULL)
+       {
+               lnr++;
+
                q = buffer;
                q = buffer;
-               
-                SKIP(q);
-                                                
-                if ((*q == '\n') || (*q == '#') || (*q == '\0'))
+
+               SKIP(q);
+
+               if ((*q == '\n') || (*q == '#') || (*q == '\0'))
                        continue;
 
                if (( c = strchr(q, ' ')) || (c = strchr(q,'\t'))) {
 
                        *c = '\0'; c++;
                        SKIP(c);
                        continue;
 
                if (( c = strchr(q, ' ')) || (c = strchr(q,'\t'))) {
 
                        *c = '\0'; c++;
                        SKIP(c);
-                       
+
                        name = q;
                        id = c;
                        name = q;
                        id = c;
-                       
+
                        if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) {
                                rc_log(LOG_CRIT,"rc_read_mapfile: out of memory");
                                return (-1);
                        }
                        if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) {
                                rc_log(LOG_CRIT,"rc_read_mapfile: out of memory");
                                return (-1);
                        }
-                       
+
                        p->name = strdup(name);
                        p->id = atoi(id);
                        p->next = map2id_list;
                        p->name = strdup(name);
                        p->id = atoi(id);
                        p->next = map2id_list;
-                       map2id_list = p;                        
-               
+                       map2id_list = p;
+
                } else {
                } else {
-                       
-                       rc_log(LOG_ERR, "rc_read_mapfile: malformed line in %s, line %d", filename, lnr);  
+
+                       rc_log(LOG_ERR, "rc_read_mapfile: malformed line in %s, line %d", filename, lnr);
                        return (-1);
 
                }
        }
                        return (-1);
 
                }
        }
-       
+
 #undef SKIP
 
        fclose(mapfd);
 #undef SKIP
 
        fclose(mapfd);
@@ -110,13 +110,13 @@ UINT4 rc_map2id(char *name)
        *ttyname = '\0';
        if (*name != '/')
                strcpy(ttyname, "/dev/");
        *ttyname = '\0';
        if (*name != '/')
                strcpy(ttyname, "/dev/");
-               
+
        strncat(ttyname, name, sizeof(ttyname));
        strncat(ttyname, name, sizeof(ttyname));
-       
+
        for(p = map2id_list; p; p = p->next)
                if (!strcmp(ttyname, p->name)) return p->id;
 
        rc_log(LOG_WARNING,"rc_map2id: can't find tty %s in map database", ttyname);
        for(p = map2id_list; p; p = p->next)
                if (!strcmp(ttyname, p->name)) return p->id;
 
        rc_log(LOG_WARNING,"rc_map2id: can't find tty %s in map database", ttyname);
-       
+
        return 0;
 }
        return 0;
 }
index 0b78c862074f49862eb126bd64639857886ffec3..724edbec463efd62140b2e476cf417818fa282b5 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: config.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: config.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -28,7 +28,7 @@ static int test_config(char *);
  *
  * Returns: pointer to option on success, NULL otherwise
  */
  *
  * Returns: pointer to option on success, NULL otherwise
  */
+
 static OPTION *find_option(char *optname, unsigned int type)
 {
        int i;
 static OPTION *find_option(char *optname, unsigned int type)
 {
        int i;
@@ -37,7 +37,7 @@ static OPTION *find_option(char *optname, unsigned int type)
        for (i = 0; i < num_options; i++) {
                if (!strcmp(config_options[i].name, optname) &&
                    (config_options[i].type & type))
        for (i = 0; i < num_options; i++) {
                if (!strcmp(config_options[i].name, optname) &&
                    (config_options[i].type & type))
-                       return &config_options[i];
+                       return &config_options[i];
        }
 
        return NULL;
        }
 
        return NULL;
@@ -52,7 +52,7 @@ static OPTION *find_option(char *optname, unsigned int type)
  */
 
 static int set_option_str(char *filename, int line, OPTION *option, char *p)
  */
 
 static int set_option_str(char *filename, int line, OPTION *option, char *p)
-{ 
+{
        if (p)
                option->val = (void *) strdup(p);
        else
        if (p)
                option->val = (void *) strdup(p);
        else
@@ -74,8 +74,8 @@ static int set_option_int(char *filename, int line, OPTION *option, char *p)
                rc_log(LOG_CRIT, "read_config: out of memory");
                return (-1);
        }
                rc_log(LOG_CRIT, "read_config: out of memory");
                return (-1);
        }
-       
-       *iptr = atoi(p);                                
+
+       *iptr = atoi(p);
        option->val = (void *) iptr;
 
        return 0;
        option->val = (void *) iptr;
 
        return 0;
@@ -144,7 +144,7 @@ static int set_option_auo(char *filename, int line, OPTION *option, char *p)
                        rc_log(LOG_CRIT, "read_config: out of memory");
                        return (-1);
        }
                        rc_log(LOG_CRIT, "read_config: out of memory");
                        return (-1);
        }
-                       
+
        *iptr = 0;
        p = strtok(p, ", \t");
 
        *iptr = 0;
        p = strtok(p, ", \t");
 
@@ -154,19 +154,19 @@ static int set_option_auo(char *filename, int line, OPTION *option, char *p)
                        *iptr = AUTH_RADIUS_FST;
        else {
                rc_log(LOG_ERR,"%s: auth_order: unknown keyword: %s", filename, p);
                        *iptr = AUTH_RADIUS_FST;
        else {
                rc_log(LOG_ERR,"%s: auth_order: unknown keyword: %s", filename, p);
-               return (-1); 
+               return (-1);
        }
        }
-                       
+
        p = strtok(NULL, ", \t");
        p = strtok(NULL, ", \t");
-                       
+
        if (p && (*p != '\0')) {
                if ((*iptr & AUTH_RADIUS_FST) && !strcmp(p, "local"))
                        *iptr = (*iptr) | AUTH_LOCAL_SND;
                else if ((*iptr & AUTH_LOCAL_FST) && !strcmp(p, "radius"))
        if (p && (*p != '\0')) {
                if ((*iptr & AUTH_RADIUS_FST) && !strcmp(p, "local"))
                        *iptr = (*iptr) | AUTH_LOCAL_SND;
                else if ((*iptr & AUTH_LOCAL_FST) && !strcmp(p, "radius"))
-                       *iptr = (*iptr) | AUTH_RADIUS_SND;   
+                       *iptr = (*iptr) | AUTH_RADIUS_SND;
                else {
                        rc_log(LOG_ERR,"%s: auth_order: unknown or unexpected keyword: %s", filename, p);
                else {
                        rc_log(LOG_ERR,"%s: auth_order: unknown or unexpected keyword: %s", filename, p);
-                       return (-1); 
+                       return (-1);
                }
        }
 
                }
        }
 
@@ -180,7 +180,7 @@ static int set_option_auo(char *filename, int line, OPTION *option, char *p)
  * Function: rc_read_config
  *
  * Purpose: read the global config file
  * Function: rc_read_config
  *
  * Purpose: read the global config file
- * 
+ *
  * Returns: 0 on success, -1 when failure
  */
 
  * Returns: 0 on success, -1 when failure
  */
 
@@ -202,20 +202,20 @@ int rc_read_config(char *filename)
        {
                line++;
                p = buffer;
        {
                line++;
                p = buffer;
-               
+
                if ((*p == '\n') || (*p == '#') || (*p == '\0'))
                        continue;
 
                p[strlen(p)-1] = '\0';
                if ((*p == '\n') || (*p == '#') || (*p == '\0'))
                        continue;
 
                p[strlen(p)-1] = '\0';
-               
-               
+
+
                if ((pos = strcspn(p, "\t ")) == 0) {
                        rc_log(LOG_ERR, "%s: line %d: bogus format: %s", filename, line, p);
                        return (-1);
                if ((pos = strcspn(p, "\t ")) == 0) {
                        rc_log(LOG_ERR, "%s: line %d: bogus format: %s", filename, line, p);
                        return (-1);
-               } 
-               
+               }
+
                p[pos] = '\0';
                p[pos] = '\0';
-               
+
                if ((option = find_option(p, OT_ANY)) == NULL) {
                        rc_log(LOG_ERR, "%s: line %d: unrecognized keyword: %s", filename, line, p);
                        return (-1);
                if ((option = find_option(p, OT_ANY)) == NULL) {
                        rc_log(LOG_ERR, "%s: line %d: unrecognized keyword: %s", filename, line, p);
                        return (-1);
@@ -227,25 +227,25 @@ int rc_read_config(char *filename)
                }
 
                p += pos+1;
                }
 
                p += pos+1;
-               while (isspace(*p)) 
+               while (isspace(*p))
                        p++;
 
                switch (option->type) {
                        case OT_STR:
                                 if (set_option_str(filename, line, option, p) < 0)
                        p++;
 
                switch (option->type) {
                        case OT_STR:
                                 if (set_option_str(filename, line, option, p) < 0)
-                                       return (-1);
-                               break;                                  
+                                       return (-1);
+                               break;
                        case OT_INT:
                                 if (set_option_int(filename, line, option, p) < 0)
                        case OT_INT:
                                 if (set_option_int(filename, line, option, p) < 0)
-                                       return (-1);
+                                       return (-1);
                                break;
                        case OT_SRV:
                                 if (set_option_srv(filename, line, option, p) < 0)
                                break;
                        case OT_SRV:
                                 if (set_option_srv(filename, line, option, p) < 0)
-                                       return (-1);
+                                       return (-1);
                                break;
                        case OT_AUO:
                                 if (set_option_auo(filename, line, option, p) < 0)
                                break;
                        case OT_AUO:
                                 if (set_option_auo(filename, line, option, p) < 0)
-                                       return (-1);
+                                       return (-1);
                                break;
                        default:
                                rc_log(LOG_CRIT, "rc_read_config: impossible case branch!");
                                break;
                        default:
                                rc_log(LOG_CRIT, "rc_read_config: impossible case branch!");
@@ -261,7 +261,7 @@ int rc_read_config(char *filename)
  * Function: rc_conf_str, rc_conf_int, rc_conf_src
  *
  * Purpose: get the value of a config option
  * Function: rc_conf_str, rc_conf_int, rc_conf_src
  *
  * Purpose: get the value of a config option
- * 
+ *
  * Returns: config option value
  */
 
  * Returns: config option value
  */
 
@@ -270,9 +270,9 @@ char *rc_conf_str(char *optname)
        OPTION *option;
 
        option = find_option(optname, OT_STR);
        OPTION *option;
 
        option = find_option(optname, OT_STR);
-       
+
        if (option != NULL) {
        if (option != NULL) {
-               return (char *)option->val;     
+               return (char *)option->val;
        } else {
                rc_log(LOG_CRIT, "rc_conf_str: unkown config option requested: %s", optname);
                abort();
        } else {
                rc_log(LOG_CRIT, "rc_conf_str: unkown config option requested: %s", optname);
                abort();
@@ -284,9 +284,9 @@ int rc_conf_int(char *optname)
        OPTION *option;
 
        option = find_option(optname, OT_INT|OT_AUO);
        OPTION *option;
 
        option = find_option(optname, OT_INT|OT_AUO);
-       
+
        if (option != NULL) {
        if (option != NULL) {
-               return *((int *)option->val);   
+               return *((int *)option->val);
        } else {
                rc_log(LOG_CRIT, "rc_conf_int: unkown config option requested: %s", optname);
                abort();
        } else {
                rc_log(LOG_CRIT, "rc_conf_int: unkown config option requested: %s", optname);
                abort();
@@ -298,9 +298,9 @@ SERVER *rc_conf_srv(char *optname)
        OPTION *option;
 
        option = find_option(optname, OT_SRV);
        OPTION *option;
 
        option = find_option(optname, OT_SRV);
-       
+
        if (option != NULL) {
        if (option != NULL) {
-               return (SERVER *)option->val;   
+               return (SERVER *)option->val;
        } else {
                rc_log(LOG_CRIT, "rc_conf_srv: unkown config option requested: %s", optname);
                abort();
        } else {
                rc_log(LOG_CRIT, "rc_conf_srv: unkown config option requested: %s", optname);
                abort();
@@ -336,7 +336,7 @@ static int test_config(char *filename)
        {
                rc_log(LOG_ERR,"%s: no servers file specified", filename);
                return (-1);
        {
                rc_log(LOG_ERR,"%s: no servers file specified", filename);
                return (-1);
-       }                                                                         
+       }
        if (!rc_conf_str("dictionary"))
        {
                rc_log(LOG_ERR,"%s: no dictionary specified", filename);
        if (!rc_conf_str("dictionary"))
        {
                rc_log(LOG_ERR,"%s: no dictionary specified", filename);
@@ -348,11 +348,11 @@ static int test_config(char *filename)
                rc_log(LOG_ERR,"%s: radius_timeout <= 0 is illegal", filename);
                return (-1);
        }
                rc_log(LOG_ERR,"%s: radius_timeout <= 0 is illegal", filename);
                return (-1);
        }
-       if (rc_conf_int("radius_retries") <= 0) 
+       if (rc_conf_int("radius_retries") <= 0)
        {
                rc_log(LOG_ERR,"%s: radius_retries <= 0 is illegal", filename);
                return (-1);
        {
                rc_log(LOG_ERR,"%s: radius_retries <= 0 is illegal", filename);
                return (-1);
-       }       
+       }
 
 #if 0
        file = rc_conf_str("login_local");
 
 #if 0
        file = rc_conf_str("login_local");
@@ -378,32 +378,32 @@ static int test_config(char *filename)
                return (-1);
        }
 #endif
                return (-1);
        }
 #endif
-       
+
        if (rc_conf_int("login_tries") <= 0)
        {
                rc_log(LOG_ERR,"%s: login_tries <= 0 is illegal", filename);
                return (-1);
        if (rc_conf_int("login_tries") <= 0)
        {
                rc_log(LOG_ERR,"%s: login_tries <= 0 is illegal", filename);
                return (-1);
-       }       
+       }
        if (rc_conf_str("seqfile") == NULL)
        {
                rc_log(LOG_ERR,"%s: seqfile not specified", filename);
                return (-1);
        if (rc_conf_str("seqfile") == NULL)
        {
                rc_log(LOG_ERR,"%s: seqfile not specified", filename);
                return (-1);
-       }       
+       }
        if (rc_conf_int("login_timeout") <= 0)
        {
                rc_log(LOG_ERR,"%s: login_timeout <= 0 is illegal", filename);
                return (-1);
        if (rc_conf_int("login_timeout") <= 0)
        {
                rc_log(LOG_ERR,"%s: login_timeout <= 0 is illegal", filename);
                return (-1);
-       }       
+       }
        if (rc_conf_str("mapfile") == NULL)
        {
                rc_log(LOG_ERR,"%s: mapfile not specified", filename);
                return (-1);
        if (rc_conf_str("mapfile") == NULL)
        {
                rc_log(LOG_ERR,"%s: mapfile not specified", filename);
                return (-1);
-       }       
+       }
        if (rc_conf_str("nologin") == NULL)
        {
                rc_log(LOG_ERR,"%s: nologin not specified", filename);
                return (-1);
        if (rc_conf_str("nologin") == NULL)
        {
                rc_log(LOG_ERR,"%s: nologin not specified", filename);
                return (-1);
-       }       
+       }
 
        return 0;
 }
 
        return 0;
 }
@@ -446,7 +446,7 @@ static int find_match (UINT4 *ip_addr, char *hostname)
                }
        }
        return (-1);
                }
        }
        return (-1);
-} 
+}
 
 /*
  * Function: rc_find_server
 
 /*
  * Function: rc_find_server
@@ -456,10 +456,10 @@ static int find_match (UINT4 *ip_addr, char *hostname)
  * Returns: 0 on success, -1 on failure
  *
  */
  * Returns: 0 on success, -1 on failure
  *
  */
+
 int rc_find_server (char *server_name, UINT4 *ip_addr, char *secret)
 {
 int rc_find_server (char *server_name, UINT4 *ip_addr, char *secret)
 {
-       UINT4           myipaddr = 0;
+       UINT4   myipaddr = 0;
        int             len;
        int             result;
        FILE           *clientfd;
        int             len;
        int             result;
        FILE           *clientfd;
@@ -478,7 +478,7 @@ int rc_find_server (char *server_name, UINT4 *ip_addr, char *secret)
                rc_log(LOG_ERR, "rc_find_server: couldn't open file: %s: %s", strerror(errno), rc_conf_str("servers"));
                return (-1);
        }
                rc_log(LOG_ERR, "rc_find_server: couldn't open file: %s: %s", strerror(errno), rc_conf_str("servers"));
                return (-1);
        }
-       
+
        if ((myipaddr = rc_own_ipaddress()) == 0)
                return (-1);
 
        if ((myipaddr = rc_own_ipaddress()) == 0)
                return (-1);
 
index f3d177be39bc13cd63161362b367310c473b4ec5..5132b1b7fdc19f3a58f91de8bd5de903de8ca798 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * $Id: env.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: env.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -19,7 +19,7 @@
  * Purpose: allocate space for a new environment
  *
  */
  * Purpose: allocate space for a new environment
  *
  */
+
 ENV *rc_new_env(int size)
 {
        ENV *p;
 ENV *rc_new_env(int size)
 {
        ENV *p;
@@ -29,19 +29,19 @@ ENV *rc_new_env(int size)
 
        if ((p = malloc(sizeof(*p))) == NULL)
                return NULL;
 
        if ((p = malloc(sizeof(*p))) == NULL)
                return NULL;
-               
+
        if ((p->env = malloc(size * sizeof(char *))) == NULL)
        {
                rc_log(LOG_CRIT, "rc_new_env: out of memory");
                free(p);
                return NULL;
        if ((p->env = malloc(size * sizeof(char *))) == NULL)
        {
                rc_log(LOG_CRIT, "rc_new_env: out of memory");
                free(p);
                return NULL;
-       } 
+       }
 
        p->env[0] = NULL;
 
        p->env[0] = NULL;
-       
+
        p->size = 0;
        p->size = 0;
-       p->maxsize = size;      
-               
+       p->maxsize = size;
+
        return p;
 }
 
        return p;
 }
 
@@ -51,11 +51,11 @@ ENV *rc_new_env(int size)
  * Purpose: free the space used by an env structure
  *
  */
  * Purpose: free the space used by an env structure
  *
  */
+
 void rc_free_env(ENV *env)
 {
        free(env->env);
 void rc_free_env(ENV *env)
 {
        free(env->env);
-       free(env); 
+       free(env);
 }
 
 /*
 }
 
 /*
@@ -64,7 +64,7 @@ void rc_free_env(ENV *env)
  * Purpose: add an environment entry
  *
  */
  * Purpose: add an environment entry
  *
  */
+
 int rc_add_env(ENV *env, char *name, char *value)
 {
        int i;
 int rc_add_env(ENV *env, char *name, char *value)
 {
        int i;
@@ -73,7 +73,7 @@ int rc_add_env(ENV *env, char *name, char *value)
        for (i = 0; env->env[i] != NULL; i++)
        {
                if (strncmp(env->env[i], name, MAX(strchr(env->env[i], '=') - env->env[i],strlen(name))) == 0)
        for (i = 0; env->env[i] != NULL; i++)
        {
                if (strncmp(env->env[i], name, MAX(strchr(env->env[i], '=') - env->env[i],strlen(name))) == 0)
-                       break;  
+                       break;
        }
 
        if (env->env[i])
        }
 
        if (env->env[i])
@@ -89,20 +89,20 @@ int rc_add_env(ENV *env, char *name, char *value)
                        rc_log(LOG_CRIT, "rc_add_env: not enough space for environment (increase ENV_SIZE)");
                        return (-1);
                }
                        rc_log(LOG_CRIT, "rc_add_env: not enough space for environment (increase ENV_SIZE)");
                        return (-1);
                }
-       
+
                if ((env->env[env->size] = malloc(strlen(name)+strlen(value)+2)) == NULL) {
                        rc_log(LOG_CRIT, "rc_add_env: out of memory");
                        return (-1);
                }
                if ((env->env[env->size] = malloc(strlen(name)+strlen(value)+2)) == NULL) {
                        rc_log(LOG_CRIT, "rc_add_env: out of memory");
                        return (-1);
                }
-       
+
                sprintf(env->env[env->size],"%s=%s", name, value);
                sprintf(env->env[env->size],"%s=%s", name, value);
-       
+
                env->size++;
 
                env->env[env->size] = NULL;
        }
 
                env->size++;
 
                env->env[env->size] = NULL;
        }
 
-       return 0;               
+       return 0;
 }
 
 /*
 }
 
 /*
@@ -111,21 +111,21 @@ int rc_add_env(ENV *env, char *name, char *value)
  * Purpose: imports an array of null-terminated strings
  *
  */
  * Purpose: imports an array of null-terminated strings
  *
  */
+
 int rc_import_env(ENV *env, char **import)
 {
        char *es;
 int rc_import_env(ENV *env, char **import)
 {
        char *es;
-       
+
        while (*import)
        {
                es = strchr(*import, '=');
        while (*import)
        {
                es = strchr(*import, '=');
-               
+
                if (!es)
                {
                        import++;
                        continue;
                }
                if (!es)
                {
                        import++;
                        continue;
                }
-               
+
                /* ok, i grant thats not very clean... */
                *es = '\0';
 
                /* ok, i grant thats not very clean... */
                *es = '\0';
 
@@ -134,11 +134,11 @@ int rc_import_env(ENV *env, char **import)
                        *es = '=';
                        return (-1);
                }
                        *es = '=';
                        return (-1);
                }
-       
+
                *es = '=';
                *es = '=';
-       
+
                import++;
        }
                import++;
        }
-       
+
        return 0;
 }
        return 0;
 }
index f207b0cec81096b3abaaafd431ace132bb241016..3a26d13adc1e8ddeb16b21895cdddbf9df4bafe0 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: ip_util.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: ip_util.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -41,7 +41,7 @@ UINT4 rc_get_ipaddr (char *host)
                return ((UINT4) 0);
        }
        return ntohl((*(UINT4 *) hp->h_addr));
                return ((UINT4) 0);
        }
        return ntohl((*(UINT4 *) hp->h_addr));
-} 
+}
 
 /*
  * Function: rc_good_ipaddr
 
 /*
  * Function: rc_good_ipaddr
@@ -100,7 +100,7 @@ int rc_good_ipaddr (char *addr)
  *         for the supplied IP address.
  *
  */
  *         for the supplied IP address.
  *
  */
+
 const char *rc_ip_hostname (UINT4 h_ipaddr)
 {
        struct hostent  *hp;
 const char *rc_ip_hostname (UINT4 h_ipaddr)
 {
        struct hostent  *hp;
@@ -110,9 +110,9 @@ const char *rc_ip_hostname (UINT4 h_ipaddr)
                            AF_INET)) == NULL) {
                rc_log(LOG_ERR,"rc_ip_hostname: couldn't look up host by addr: %08lX", h_ipaddr);
        }
                            AF_INET)) == NULL) {
                rc_log(LOG_ERR,"rc_ip_hostname: couldn't look up host by addr: %08lX", h_ipaddr);
        }
-                                 
+
        return ((hp==NULL)?"unknown":hp->h_name);
        return ((hp==NULL)?"unknown":hp->h_name);
-} 
+}
 
 /*
  * Function: rc_getport
 
 /*
  * Function: rc_getport
@@ -170,7 +170,7 @@ rc_own_hostname(char *hostname, int len)
        }
 #else
        return -1;
        }
 #else
        return -1;
-#endif 
+#endif
 
        return 0;
 }
 
        return 0;
 }
@@ -196,7 +196,7 @@ UINT4 rc_own_ipaddress(void)
                        rc_log(LOG_ERR, "rc_own_ipaddress: couldn't get own IP address");
                        return 0;
                }
                        rc_log(LOG_ERR, "rc_own_ipaddress: couldn't get own IP address");
                        return 0;
                }
-       } 
-       
+       }
+
        return this_host_ipaddr;
 }
        return this_host_ipaddr;
 }
index f78c5927a82b6d474c0756ff7baf1bd731edd9c1..83f79d83bb700fefda8fa012826de07ac828adc7 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * $Id: lock.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: lock.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1997 Lars Fenneberg
  *
  *
  * Copyright (C) 1997 Lars Fenneberg
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -30,15 +30,15 @@ int do_lock_exclusive(int fd)
 {
        flock_t fl;
        int res;
 {
        flock_t fl;
        int res;
-       
+
        memset((void *)&fl, 0, sizeof(fl));
        memset((void *)&fl, 0, sizeof(fl));
-       
+
        fl.l_type = F_WRLCK;
        fl.l_whence = fl.l_start = 0;
        fl.l_len = 0; /* 0 means "to end of file" */
 
        res = fcntl(fd, F_SETLK, &fl);
        fl.l_type = F_WRLCK;
        fl.l_whence = fl.l_start = 0;
        fl.l_len = 0; /* 0 means "to end of file" */
 
        res = fcntl(fd, F_SETLK, &fl);
-       
+
        if ((res == -1) && (errno == EAGAIN))
                errno = EWOULDBLOCK;
 
        if ((res == -1) && (errno == EAGAIN))
                errno = EWOULDBLOCK;
 
@@ -48,9 +48,9 @@ int do_lock_exclusive(int fd)
 int do_unlock(int fd)
 {
        flock_t fl;
 int do_unlock(int fd)
 {
        flock_t fl;
-       
+
        memset((void *)&fl, 0, sizeof(fl));
        memset((void *)&fl, 0, sizeof(fl));
-       
+
        fl.l_type = F_UNLCK;
        fl.l_whence = fl.l_start = 0;
        fl.l_len = 0; /* 0 means "to end of file" */
        fl.l_type = F_UNLCK;
        fl.l_whence = fl.l_start = 0;
        fl.l_len = 0; /* 0 means "to end of file" */
@@ -61,4 +61,3 @@ int do_unlock(int fd)
 #else
 YOU_LOOSE "need either flock(2) or fcntl(2)"
 #endif
 #else
 YOU_LOOSE "need either flock(2) or fcntl(2)"
 #endif
-       
index 9e922a39fc85893cf2774a9c4b2cc85757558697..917b90728299578ca1132110f2baeb5fe6501315 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * $Id: log.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: log.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -44,10 +44,10 @@ void rc_log(int prio, const char *format, ...)
 {
        char buff[1024];
        va_list ap;
 {
        char buff[1024];
        va_list ap;
-                                    
+
        va_start(ap,format);
     vsnprintf(buff, sizeof(buff), format, ap);
     va_end(ap);
        va_start(ap,format);
     vsnprintf(buff, sizeof(buff), format, ap);
     va_end(ap);
-                                                            
+
        syslog(prio, "%s", buff);
 }
        syslog(prio, "%s", buff);
 }
index 5dc7652028b37bc93151dc3c30da57b9942f9e02..07c6cee65b2695611b25998fe0c062404647c3ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: md5.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: md5.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  */
 
 /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
  */
 
 /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
@@ -144,8 +144,8 @@ static void MD5Init (MD5_CTX *context)
 static void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen)
 {
        unsigned int    i,
 static void MD5Update (MD5_CTX *context, unsigned char *input, unsigned int inputLen)
 {
        unsigned int    i,
-                       index,
-                       partLen;
+                       index,
+                       partLen;
 
        /* Compute number of bytes mod 64 */
        index = (unsigned int) ((context->count[0] >> 3) & 0x3F);
 
        /* Compute number of bytes mod 64 */
        index = (unsigned int) ((context->count[0] >> 3) & 0x3F);
@@ -188,7 +188,7 @@ static void MD5Final (unsigned char *digest, MD5_CTX *context)
 {
        unsigned char   bits[8];
        unsigned int    index,
 {
        unsigned char   bits[8];
        unsigned int    index,
-                       padLen;
+                       padLen;
 
        /* Save number of bits */
        Encode (bits, context->count, 8);
 
        /* Save number of bits */
        Encode (bits, context->count, 8);
@@ -217,10 +217,10 @@ static void MD5Final (unsigned char *digest, MD5_CTX *context)
 static void MD5Transform (UINT4 *state, unsigned char *block)
 {
        UINT4           a = state[0],
 static void MD5Transform (UINT4 *state, unsigned char *block)
 {
        UINT4           a = state[0],
-                       b = state[1],
-                       c = state[2],
-                       d = state[3],
-                       x[16];
+                       b = state[1],
+                       c = state[2],
+                       d = state[3],
+                       x[16];
 
        Decode (x, block, 64);
 
 
        Decode (x, block, 64);
 
@@ -313,7 +313,7 @@ static void MD5Transform (UINT4 *state, unsigned char *block)
 static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
 {
        unsigned int    i,
 static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
 {
        unsigned int    i,
-                       j;
+                       j;
 
        for (i = 0, j = 0; j < len; i++, j += 4)
        {
 
        for (i = 0, j = 0; j < len; i++, j += 4)
        {
@@ -330,7 +330,7 @@ static void Encode (unsigned char *output, UINT4 *input, unsigned int len)
 static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
 {
        unsigned int    i,
 static void Decode (UINT4 *output, unsigned char *input, unsigned int len)
 {
        unsigned int    i,
-                       j;
+                       j;
 
        for (i = 0, j = 0; j < len; i++, j += 4)
                output[i] = ((UINT4) input[j]) | (((UINT4) input[j + 1]) << 8) |
 
        for (i = 0, j = 0; j < len; i++, j += 4)
                output[i] = ((UINT4) input[j]) | (((UINT4) input[j + 1]) << 8) |
index d0d86e0ee53164ca382181f8e637c5bd451e7761..3c2b1cbedf294c565cfa86b6e30e4ade0420236d 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: memcmp.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: memcmp.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Taken from the Linux kernel. GPL applies.
  * Copyright (C) 1991, 1992  Linus Torvalds
  *
  * Taken from the Linux kernel. GPL applies.
  * Copyright (C) 1991, 1992  Linus Torvalds
@@ -13,10 +13,9 @@ int memcmp(const void * cs,const void * ct,size_t count)
 {
        const unsigned char *su1, *su2;
        signed char res = 0;
 {
        const unsigned char *su1, *su2;
        signed char res = 0;
-                
+
        for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
                if ((res = *su1 - *su2) != 0)
                        break;
        for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
                if ((res = *su1 - *su2) != 0)
                        break;
-        return res;
+       return res;
 }
 }
-                                                                        
\ No newline at end of file
index 190da22818844b9423ddb701d537ff0295997e1b..f94dde616064b8eaac11730b1b941ce61e5f3485 100644 (file)
@@ -1,11 +1,11 @@
 /*
 /*
- * $Id: strcasecmp.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: strcasecmp.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
  *
  *
  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
  *
- * This file is provided under the terms and conditions of the GNU general 
- * public license, version 2 or any later version, incorporated herein by 
- * reference. 
+ * This file is provided under the terms and conditions of the GNU general
+ * public license, version 2 or any later version, incorporated herein by
+ * reference.
  *
  */
 
  *
  */
 
 int strcasecmp(char *s1, char *s2)
 {
        while (*s1 && *s2 && toupper(*s1) == toupper(*s2))
 int strcasecmp(char *s1, char *s2)
 {
        while (*s1 && *s2 && toupper(*s1) == toupper(*s2))
-       s1++, s2++;
-        
+       s1++, s2++;
+
     if (!*s1 && !*s2)
     if (!*s1 && !*s2)
-       return 0;    
+       return 0;
     else
     else
-       return (toupper(*s1) - toupper(*s2));                            
+       return (toupper(*s1) - toupper(*s2));
 }
 #endif
 }
 #endif
index 0c487bf3ba1760516d7ebdf66d6c8b971e46e2fd..bf923e839264ee9324ce0269ee863d7a9952c16e 100644 (file)
@@ -1,11 +1,11 @@
 /*
 /*
- * $Id: strdup.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: strdup.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
  *
  *
  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
  *
- * This file is provided under the terms and conditions of the GNU general 
- * public license, version 2 or any later version, incorporated herein by 
- * reference. 
+ * This file is provided under the terms and conditions of the GNU general
+ * public license, version 2 or any later version, incorporated herein by
+ * reference.
  *
  */
 
  *
  */
 
@@ -29,5 +29,5 @@ char *strdup(char *str)
        if ((p = (char *)malloc(strlen(str)+1)) == NULL)
                return p;
 
        if ((p = (char *)malloc(strlen(str)+1)) == NULL)
                return p;
 
-       return strcpy(p, str);  
+       return strcpy(p, str);
 }
 }
index 849f58e822d5f0a3e92e60ec1b2a6a5f1c96186d..bb51a57bc8266a74e2c0c75bd1bb812f146d9d3f 100644 (file)
@@ -1,11 +1,11 @@
 /*
 /*
- * $Id: strerror.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: strerror.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
  *
  *
  * Copyright (C) 1996 Lars Fenneberg and Christian Graefe
  *
- * This file is provided under the terms and conditions of the GNU general 
- * public license, version 2 or any later version, incorporated herein by 
- * reference. 
+ * This file is provided under the terms and conditions of the GNU general
+ * public license, version 2 or any later version, incorporated herein by
+ * reference.
  *
  */
 
  *
  */
 
index 392db249bc24a88b977b6867d0858d64ebe48a9d..813ec7ec5452e832121dccdc8774ff5c6c32e817 100644 (file)
@@ -1,15 +1,15 @@
 /*
 /*
- * $Id: util.c,v 1.1 2002/01/22 16:03:02 dfs Exp $
+ * $Id: util.c,v 1.2 2002/02/27 15:51:20 dfs Exp $
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
  *
  * Copyright (C) 1995,1996,1997 Lars Fenneberg
  *
  * Copyright 1992 Livingston Enterprises, Inc.
  *
- * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan 
+ * Copyright 1992,1993, 1994,1995 The Regents of the University of Michigan
  * and Merit Network, Inc. All Rights Reserved
  *
  * and Merit Network, Inc. All Rights Reserved
  *
- * See the file COPYRIGHT for the respective terms and conditions. 
- * If the file is missing contact me at lf@elemental.net 
+ * See the file COPYRIGHT for the respective terms and conditions.
+ * If the file is missing contact me at lf@elemental.net
  * and I'll send you a copy.
  *
  */
  * and I'll send you a copy.
  *
  */
@@ -61,16 +61,16 @@ void rc_str2tm (char *valstr, struct tm *tm)
 
 char *rc_getifname(char *tty)
 {
 
 char *rc_getifname(char *tty)
 {
-#if defined(BSD4_4) || defined(linux)  
-       static char     name[512];
+#if defined(BSD4_4) || defined(linux)
+       static char     name[512];
        int             fd;
 
        if ((fd = open(tty, O_RDWR|O_NDELAY)) < 0) {
                rc_log(LOG_ERR, "rc_getifname: can't open %s: %s", tty, strerror(errno));
                return NULL;
        }
        int             fd;
 
        if ((fd = open(tty, O_RDWR|O_NDELAY)) < 0) {
                rc_log(LOG_ERR, "rc_getifname: can't open %s: %s", tty, strerror(errno));
                return NULL;
        }
-#endif 
-       
+#endif
+
 #ifdef BSD4_4
        strcpy(name,ttyname(fd));
        if (strlen(name) < 1) {
 #ifdef BSD4_4
        strcpy(name,ttyname(fd));
        if (strlen(name) < 1) {
@@ -88,7 +88,7 @@ char *rc_getifname(char *tty)
        return NULL;
 #endif
 
        return NULL;
 #endif
 
-#if defined(BSD4_4) || defined(linux)  
+#if defined(BSD4_4) || defined(linux)
        close(fd);
        return name;
 #endif
        close(fd);
        return name;
 #endif
@@ -125,17 +125,17 @@ char *rc_getstr (char *prompt, int do_echo)
 
        if ((is_term = isatty(in)))
        {
 
        if ((is_term = isatty(in)))
        {
-       
+
                (void) tcgetattr (in, &term_old);
                term_new = term_old;
                if (do_echo)
                        term_new.c_lflag |= ECHO;
                (void) tcgetattr (in, &term_old);
                term_new = term_old;
                if (do_echo)
                        term_new.c_lflag |= ECHO;
-               else 
+               else
                        term_new.c_lflag &= ~ECHO;
                        term_new.c_lflag &= ~ECHO;
-       
+
                if (tcsetattr (in, TCSAFLUSH, &term_new) == 0)
                        flushed = 1;
                if (tcsetattr (in, TCSAFLUSH, &term_new) == 0)
                        flushed = 1;
-                       
+
        }
        else
        {
        }
        else
        {
@@ -143,18 +143,18 @@ char *rc_getstr (char *prompt, int do_echo)
                if ((flags = fcntl(in, F_GETFL, 0)) >= 0) {
                        old_flags = flags;
                        flags |= O_NONBLOCK;
                if ((flags = fcntl(in, F_GETFL, 0)) >= 0) {
                        old_flags = flags;
                        flags |= O_NONBLOCK;
-                       
+
                        fcntl(in, F_SETFL, flags);
                        fcntl(in, F_SETFL, flags);
-                       
+
                        while (read(in, &c, 1) > 0)
                                /* nothing */;
                        while (read(in, &c, 1) > 0)
                                /* nothing */;
-                               
+
                        fcntl(in, F_SETFL, old_flags);
                        fcntl(in, F_SETFL, old_flags);
-                       
+
                        flushed = 1;
                        flushed = 1;
-               }  
+               }
        }
        }
-               
+
        write(out, prompt, strlen(prompt));
 
        /* well, this looks ugly, but it handles the following end of line
        write(out, prompt, strlen(prompt));
 
        /* well, this looks ugly, but it handles the following end of line
@@ -165,7 +165,7 @@ char *rc_getstr (char *prompt, int do_echo)
        {
                if (read(in, &c, 1) <= 0)
                        return NULL;
        {
                if (read(in, &c, 1) <= 0)
                        return NULL;
-               
+
                if (!flushed && ((c == '\0') || (c == '\r') || (c == '\n'))) {
                        flushed = 1;
                        continue;
                if (!flushed && ((c == '\0') || (c == '\r') || (c == '\n'))) {
                        flushed = 1;
                        continue;
@@ -185,23 +185,23 @@ char *rc_getstr (char *prompt, int do_echo)
        }
 
        *p = '\0';
        }
 
        *p = '\0';
-       
+
        if (!do_echo || !is_term) write(out, "\r\n", 2);
        if (!do_echo || !is_term) write(out, "\r\n", 2);
-       
+
        if (is_term)
                tcsetattr (in, TCSAFLUSH, &term_old);
        else {
                if ((flags = fcntl(in, F_GETFL, 0)) >= 0) {
                        old_flags = flags;
                        flags |= O_NONBLOCK;
        if (is_term)
                tcsetattr (in, TCSAFLUSH, &term_old);
        else {
                if ((flags = fcntl(in, F_GETFL, 0)) >= 0) {
                        old_flags = flags;
                        flags |= O_NONBLOCK;
-                       
+
                        fcntl(in, F_SETFL, flags);
                        fcntl(in, F_SETFL, flags);
-                       
+
                        while (read(in, &c, 1) > 0)
                                /* nothing */;
                        while (read(in, &c, 1) > 0)
                                /* nothing */;
-                               
+
                        fcntl(in, F_SETFL, old_flags);
                        fcntl(in, F_SETFL, old_flags);
-               }  
+               }
        }
 
        (void) sigprocmask (SIG_SETMASK, &oldset, NULL);
        }
 
        (void) sigprocmask (SIG_SETMASK, &oldset, NULL);
@@ -212,7 +212,7 @@ char *rc_getstr (char *prompt, int do_echo)
 void rc_mdelay(int msecs)
 {
        struct timeval tv;
 void rc_mdelay(int msecs)
 {
        struct timeval tv;
-       
+
        tv.tv_sec = (int) msecs / 1000;
        tv.tv_usec = (msecs % 1000) * 1000;
 
        tv.tv_sec = (int) msecs / 1000;
        tv.tv_usec = (msecs % 1000) * 1000;