comparison extensions/app_diameap/diameap_eap.c @ 1027:0117a7746b21

Fix a number of errors and warnings introduced/highlighted by recent commits
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 15 Apr 2013 15:17:07 +0800
parents a137913d9f88
children b3d623f04b6d
comparison
equal deleted inserted replaced
1026:beb375690453 1027:0117a7746b21
54 *id=*id+1; 54 *id=*id+1;
55 } 55 }
56 } 56 }
57 57
58 static void diameap_ba_policyupdate(struct eap_state_machine * eap_sm, 58 static void diameap_ba_policyupdate(struct eap_state_machine * eap_sm,
59 struct eap_packet eapPacket) 59 struct eap_packet *eapPacket)
60 { 60 {
61 TRACE_ENTRY("%p %p",eap_sm, eapPacket); 61 TRACE_ENTRY("%p %p",eap_sm, eapPacket);
62 if ((eap_sm->respMethod == TYPE_NAK)) 62 if ((eap_sm->respMethod == TYPE_NAK))
63 { 63 {
64 int id; 64 int id;
65 eap_sm->user.pmethods = 0; 65 eap_sm->user.pmethods = 0;
66 u32 vendor; 66 u32 vendor;
67 eap_type type; 67 eap_type type;
68 u8 *data = (u8 *) eapPacket.data; 68 u8 *data = (u8 *) eapPacket->data;
69 data += 5; 69 data += 5;
70 id = 5; 70 id = 5;
71 while (id < eapPacket.length) 71 while (id < eapPacket->length)
72 { 72 {
73 vendor = VENDOR_IETF; 73 vendor = VENDOR_IETF;
74 type = G8(data); 74 type = G8(data);
75 if (diameap_plugin_exist(vendor, type) == TRUE) 75 if (diameap_plugin_exist(vendor, type) == TRUE)
76 { 76 {
240 return 0; 240 return 0;
241 } 241 }
242 242
243 static boolean diameap_ba_policydopickup(eap_type type) 243 static boolean diameap_ba_policydopickup(eap_type type)
244 { 244 {
245 TRACE_ENTRY("%p",type); 245 TRACE_ENTRY("%d",type);
246 if (type == TYPE_IDENTITY) 246 if (type == TYPE_IDENTITY)
247 { 247 {
248 return TRUE; 248 return TRUE;
249 } 249 }
250 return FALSE; 250 return FALSE;
328 break; 328 break;
329 329
330 case EAP_RECEIVED: 330 case EAP_RECEIVED:
331 TRACE_DEBUG(FULL+1,"%s[EAP Protocol] New EAP Response received",DIAMEAP_EXTENSION) 331 TRACE_DEBUG(FULL+1,"%s[EAP Protocol] New EAP Response received",DIAMEAP_EXTENSION)
332 ; 332 ;
333 diameap_eap_dump(FULL + 1, eap_i->aaaEapRespData); 333 diameap_eap_dump(FULL + 1, &eap_i->aaaEapRespData);
334 if ((eap_sm->rxResp == TRUE) && (eap_sm->respId 334 if ((eap_sm->rxResp == TRUE) && (eap_sm->respId
335 == eap_sm->currentId) && ((eap_sm->respMethod 335 == eap_sm->currentId) && ((eap_sm->respMethod
336 == eap_sm->currentMethod) || ((eap_sm->respMethod 336 == eap_sm->currentMethod) || ((eap_sm->respMethod
337 == TYPE_EXPANDED_TYPES) && (eap_sm->respVendor 337 == TYPE_EXPANDED_TYPES) && (eap_sm->respVendor
338 == VENDOR_IETF) && (eap_sm->respVendorMethod 338 == VENDOR_IETF) && (eap_sm->respVendorMethod
362 break; 362 break;
363 363
364 case EAP_SEND_REQUEST: 364 case EAP_SEND_REQUEST:
365 TRACE_DEBUG(FULL+1,"%s[EAP Protocol] New EAP packet request created.",DIAMEAP_EXTENSION) 365 TRACE_DEBUG(FULL+1,"%s[EAP Protocol] New EAP packet request created.",DIAMEAP_EXTENSION)
366 ; 366 ;
367 diameap_eap_dump(FULL, eap_i->aaaEapReqData); 367 diameap_eap_dump(FULL, &eap_i->aaaEapReqData);
368 eap_i->aaaEapResp = FALSE; 368 eap_i->aaaEapResp = FALSE;
369 eap_i->aaaEapReq = TRUE; 369 eap_i->aaaEapReq = TRUE;
370 eap_sm->eap_state = EAP_IDLE; 370 eap_sm->eap_state = EAP_IDLE;
371 break; 371 break;
372 372
513 { 513 {
514 free(eap_sm->methodData); 514 free(eap_sm->methodData);
515 eap_sm->methodData = NULL; 515 eap_sm->methodData = NULL;
516 } 516 }
517 } 517 }
518 diameap_ba_policyupdate(eap_sm, eap_i->aaaEapRespData); 518 diameap_ba_policyupdate(eap_sm, &eap_i->aaaEapRespData);
519 eap_sm->eap_state = EAP_SELECT_ACTION; 519 eap_sm->eap_state = EAP_SELECT_ACTION;
520 break; 520 break;
521 case EAP_SELECT_ACTION: 521 case EAP_SELECT_ACTION:
522 CHECK_FCT(diameap_ba_policygetdecision(eap_sm, eap_i,&eap_sm->sm_decision)) 522 CHECK_FCT(diameap_ba_policygetdecision(eap_sm, eap_i,&eap_sm->sm_decision))
523 ; 523 ;
"Welcome to our mercurial repository"