more lvalue to vp_* changes
authoraland <aland>
Thu, 19 Apr 2007 15:36:14 +0000 (15:36 +0000)
committeraland <aland>
Thu, 19 Apr 2007 15:36:14 +0000 (15:36 +0000)
src/modules/rlm_eap/types/rlm_eap_peap/peap.c
src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c
src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c
src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c

index 6e2ba77..c5832ca 100644 (file)
@@ -688,7 +688,7 @@ int eappeap_process(EAP_HANDLER *handler, tls_session_t *tls_session)
                        if (t->default_eap_type != 0) {
                                DEBUG2("  PEAP: Setting default EAP type for tunneled EAP session.");
                                vp = pairmake("EAP-Type", "0", T_OP_EQ);
-                               vp->lvalue = t->default_eap_type;
+                               vp->vp_integer = t->default_eap_type;
                                pairadd(&fake->config_items, vp);
                        }
                }
index 168e5e2..7b49428 100644 (file)
@@ -118,7 +118,7 @@ static int eap_sim_sendstart(EAP_HANDLER *handler)
 
        /* set the EAP_ID - new value */
        newvp = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER);
-       newvp->lvalue = ess->sim_id++;
+       newvp->vp_integer = ess->sim_id++;
        pairreplace(vps, newvp);
 
        /* record it in the ess */
@@ -135,7 +135,7 @@ static int eap_sim_sendstart(EAP_HANDLER *handler)
 
        /* the SUBTYPE, set to start. */
        newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER);
-       newvp->lvalue = eapsim_start;
+       newvp->vp_integer = eapsim_start;
        pairreplace(vps, newvp);
 
        return 1;
@@ -241,7 +241,7 @@ static int eap_sim_sendchallenge(EAP_HANDLER *handler)
 
        /* set the EAP_ID - new value */
        newvp = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER);
-       newvp->lvalue = ess->sim_id++;
+       newvp->vp_integer = ess->sim_id++;
        pairreplace(outvps, newvp);
 
        /* make a copy of the identity */
@@ -275,7 +275,7 @@ static int eap_sim_sendchallenge(EAP_HANDLER *handler)
 
        /* the SUBTYPE, set to challenge. */
        newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER);
-       newvp->lvalue = eapsim_challenge;
+       newvp->vp_integer = eapsim_challenge;
        pairreplace(outvps, newvp);
 
        return 1;
@@ -305,7 +305,7 @@ static int eap_sim_sendsuccess(EAP_HANDLER *handler)
 
        /* set the EAP_ID - new value */
        newvp = paircreate(ATTRIBUTE_EAP_ID, PW_TYPE_INTEGER);
-       newvp->lvalue = ess->sim_id++;
+       newvp->vp_integer = ess->sim_id++;
        pairreplace(outvps, newvp);
 
        p = ess->keys.msk;
@@ -558,7 +558,7 @@ static int eap_sim_authenticate(void *arg, EAP_HANDLER *handler)
                DEBUG2("   no subtype attribute was created, message dropped");
                return 0;
        }
-       subtype = vp->lvalue;
+       subtype = vp->vp_integer;
 
        /*
         *      Client error supersedes anything else.
index 99ddd3a..535c4ca 100644 (file)
@@ -574,7 +574,7 @@ static int eaptls_initiate(void *type_arg, EAP_HANDLER *handler)
                if (!vp) {
                        client_cert = FALSE;
                } else {
-                       client_cert = vp->lvalue;
+                       client_cert = vp->vp_integer;
                }
        }
 
@@ -628,7 +628,7 @@ static int eaptls_initiate(void *type_arg, EAP_HANDLER *handler)
         */
        ssn->offset = inst->conf->fragment_size;
        vp = pairfind(handler->request->packet->vps, PW_FRAMED_MTU);
-       if (vp && ((vp->lvalue - 14) < ssn->offset)) {
+       if (vp && ((vp->vp_integer - 14) < ssn->offset)) {
                /*
                 *      Discount the Framed-MTU by:
                 *       4 : EAPOL header
@@ -641,7 +641,7 @@ static int eaptls_initiate(void *type_arg, EAP_HANDLER *handler)
                 *      ---
                 *      14
                 */
-               ssn->offset = vp->lvalue - 14;
+               ssn->offset = vp->vp_integer - 14;
        }
 
        handler->opaque = ((void *)ssn);
index 28dc28d..889b113 100644 (file)
@@ -267,12 +267,12 @@ static VALUE_PAIR *diameter2vp(SSL *ssl,
                                pairfree(&vp);
                                return NULL;
                        }
-                       memcpy(&vp->lvalue, data, vp->length);
+                       memcpy(&vp->vp_integer, data, vp->length);
                        
                        /*
                         *      Stored in host byte order: change it.
                         */
-                       vp->lvalue = ntohl(vp->lvalue);
+                       vp->vp_integer = ntohl(vp->vp_integer);
                        break;
                        
                case PW_TYPE_IPADDR:
@@ -283,7 +283,7 @@ static VALUE_PAIR *diameter2vp(SSL *ssl,
                                pairfree(&vp);
                                return NULL;
                        }
-                 memcpy(&vp->lvalue, data, vp->length);
+                 memcpy(&vp->vp_ipaddr, data, vp->length);
                  
                  /*
                   *    Stored in network byte order: don't change it.
@@ -492,14 +492,13 @@ static int vp2diameter(tls_session_t *tls_session, VALUE_PAIR *first)
                switch (vp->type) {
                case PW_TYPE_INTEGER:
                case PW_TYPE_DATE:
-                       attr = ntohl(vp->lvalue); /* stored in host order */
+                       attr = ntohl(vp->vp_integer); /* stored in host order */
                        memcpy(p, &attr, sizeof(attr));
                        length = 4;
                        break;
 
                case PW_TYPE_IPADDR:
-                       attr = vp->lvalue; /* stored in network order */
-                       memcpy(p, &attr, sizeof(attr));
+                       memcpy(p, &vp->vp_ipaddr, 4); /* network order */
                        length = 4;
                        break;
 
@@ -1043,7 +1042,7 @@ int eapttls_process(EAP_HANDLER *handler, tls_session_t *tls_session)
                                        vp = paircreate(PW_EAP_TYPE,
                                                        PW_TYPE_INTEGER);
                                        rad_assert(vp != NULL);
-                                       vp->lvalue = t->default_eap_type;
+                                       vp->vp_integer = t->default_eap_type;
                                        pairadd(&fake->config_items, vp);
                                }