]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/avpair.c
Header file reorganization and cleaning up the public API for pppd version 2.5.0...
[ppp.git] / pppd / plugins / radius / avpair.c
index d548b47b1d23bd5ecc4c56b6ad2081a2068463dc..9b5c39cd42687694e62ee927390462c32aff96f2 100644 (file)
@@ -31,7 +31,7 @@ static void rc_extract_vendor_specific_attributes(int attrlen,
  *
  */
 
-VALUE_PAIR *rc_avpair_add (VALUE_PAIR **list, int attrid, void *pval, int len,
+VALUE_PAIR *rc_avpair_add (VALUE_PAIR **list, int attrid, const void *pval, int len,
                           int vendorcode)
 {
        VALUE_PAIR     *vp;
@@ -57,7 +57,7 @@ VALUE_PAIR *rc_avpair_add (VALUE_PAIR **list, int attrid, void *pval, int len,
  *
  */
 
-int rc_avpair_assign (VALUE_PAIR *vp, void *pval, int len)
+int rc_avpair_assign (VALUE_PAIR *vp, const void *pval, int len)
 {
        int     result = -1;
 
@@ -65,19 +65,19 @@ int rc_avpair_assign (VALUE_PAIR *vp, void *pval, int len)
        {
                case PW_TYPE_STRING:
 
-                       if (((len == 0) && (strlen ((char *) pval)) > AUTH_STRING_LEN)
+                       if (((len == 0) && (strlen ((const char *) pval)) > AUTH_STRING_LEN)
                            || (len > AUTH_STRING_LEN)) {
                                error("rc_avpair_assign: bad attribute length");
                                return result;
                    }
 
                        if (len > 0) {
-                               memcpy(vp->strvalue, (char *)pval, len);
+                               memcpy(vp->strvalue, (const char *)pval, len);
                                vp->strvalue[len] = '\0';
                                vp->lvalue = len;
                        } else {
-                       strncpy (vp->strvalue, (char *) pval, AUTH_STRING_LEN);
-                       vp->lvalue = strlen((char *) pval);
+                       strncpy ((char*) vp->strvalue, (const char *) pval, AUTH_STRING_LEN);
+                       vp->lvalue = strlen((const char *) pval);
                        }
 
                        result = 0;
@@ -107,7 +107,7 @@ int rc_avpair_assign (VALUE_PAIR *vp, void *pval, int len)
  *
  */
 
-VALUE_PAIR *rc_avpair_new (int attrid, void *pval, int len, int vendorcode)
+VALUE_PAIR *rc_avpair_new (int attrid, const void *pval, int len, int vendorcode)
 {
        VALUE_PAIR     *vp = (VALUE_PAIR *) NULL;
        DICT_ATTR      *pda;
@@ -161,7 +161,7 @@ VALUE_PAIR *rc_avpair_gen (AUTH_HDR *auth)
        DICT_ATTR      *attr;
        VALUE_PAIR     *vp;
        VALUE_PAIR     *pair;
-       unsigned char   hex[3];         /* For hex string conversion. */
+       char            hex[3];         /* For hex string conversion. */
        char            buffer[512];
 
        /*
@@ -600,7 +600,7 @@ int rc_avpair_parse (char *buffer, VALUE_PAIR **first_pair)
                        {
 
                            case PW_TYPE_STRING:
-                               strcpy (pair->strvalue, valstr);
+                               strcpy ((char*) pair->strvalue, valstr);
                                pair->lvalue = strlen(valstr);
                                break;
 
@@ -725,7 +725,7 @@ int rc_avpair_tostr (VALUE_PAIR *pair, char *name, int ln, char *value, int lv)
                        }
                        else
                        {
-                               strncat(value, ptr, 1);
+                               strncat(value, (char*) ptr, 1);
                                lv--;
                                if (lv < 0) break;
                        }