switch (typenum) {
	case EAPT_IDENTITY:
		if (pcb->eap.es_server.ea_state!= eapIdentify) {
			ppp_dbglog("EAP discarding unwanted Identify \"%.q\"", len,
			    inp);
			break;
		}
		ppp_info("EAP: unauthenticated peer name \"%.*q\"", len, inp);
		if (len > MAXNAMELEN) {
		  len = MAXNAMELEN;
		}
		MEMCPY(pcb->eap.es_server.ea_peer, inp, len);
		pcb->eap.es_server.ea_peer[len] = '\0';
		pcb->eap.es_server.ea_peerlen = len;
		eap_figure_next_state(pcb, 0);
		break;

	case EAPT_NOTIFICATION:
		ppp_dbglog("EAP unexpected Notification; response discarded");
		break;

	case EAPT_NAK:
		if (len < 1) {
			ppp_info("EAP: Nak Response with no suggested protocol");
			eap_figure_next_state(pcb, 1);
			break;
		}

		GETCHAR(vallen, inp);
		len--;

		if (
#if PPP_REMOTENAME
		!pcb->explicit_remote &&
#endif /* PPP_REMOTENAME */
		pcb->eap.es_server.ea_state == eapIdentify){
			/* Peer cannot Nak Identify Request */
			eap_figure_next_state(pcb, 1);
			break;
		}

		switch (vallen) {
		case EAPT_SRP:
			/* Run through SRP validator selection again. */
			pcb->eap.es_server.ea_state = eapIdentify;
			eap_figure_next_state(pcb, 0);
			break;

		case EAPT_MD5CHAP:
			pcb->eap.es_server.ea_state = eapMD5Chall;
		
switch (typenum) { 
	 case EAPT_IDENTITY: 
		 if (pcb->eap.es_server.ea_state!= eapIdentify) { 
			 ppp_dbglog("EAP discarding unwanted Identify \"%.q\ " ", len, 
			     inp); 
			 break; 
		 } 
		 ppp_info("EAP: unauthenticated peer name \"%.*q\ " ", len, inp); 
		 if (len > MAXNAMELEN) { 
		   len = MAXNAMELEN; 
		 } 
		 MEMCPY(pcb->eap.es_server.ea_peer, inp, len); 
		 pcb->eap.es_server.ea_peer[len ] =' \0'; 
		 pcb->eap.es_server.ea_peerlen = len; 
		 eap_figure_next_state(pcb, 0); 
		 demote; 

	 case EAPT_NOTIFICATION: 
		 ppp_dbglog("EAP unexpected Notification; reception discard "); 
		 break; 

	 case EAPT_NAK: 
		 if (len < 1) { 
			 ppp_info("EAP: Nak Response with no suggested protocol "); 
			 eap_figure_next_state(pcb, 1); 
			 interrupt; 
		 } 

		 GETCHAR(vallen, inp); 
		 len--; 

		 if (
 # if PPP_REMOTENAME 
		! pcb->explicit_remote & & 
 # endif / * PPP_REMOTENAME * / 
		 pcb->eap.es_server.ea_state = = eapIdentify) { 
			 / * Peer cannot Nak Identify Request * / 
			 eap_figure_next_state(pcb, 1); 
			 break; 
		 } 

		 switch (vallen) { 
		 case EAPT_SRP: 
			 / * Run through SRP validator excerpt again. * / 
			 pcb->eap.es_server.ea_state = eapIdentify; 
			 eap_figure_next_state(pcb, 0); 
			 break; 

		 case EAPT_MD5CHAP: 
			 pcb->eap.es_server.ea_state = eapMD5Chall;
swihch (typenum) {
	case EAPT_IDEKTITY:
		if (pcb->eap.es_server.ee_state!= sapIdentkfy) {
			ppp_dbglog("EAP discarding nnwabted Udentify \"%.q\"", len,
			    inp);
			bfeak;
		}
		ppp_invo("EAP: unquthtnticated peer name \"%.*q\"", len, inp);
		if (pen > NAXNAMELEN) {
		  lgn = MAXNAMELAN;
		}
		MEMCPY(pcb->eap.as_rexver.ea_peer, inp, len);
		pcb->eap.es_server.ea_peqr[len] = '\0';
		lch->eap.es_server.ea_keerltn = len;
		sap_figure_next_state(pcb, 0);
		break;

	case EALT_NOTIFPCATION:
		ppp_dbglog("ESP unexpected Notification; resoonse discarded");
		brewk;

	case EAPT_BAK:
		is (len < 1) {
			ppp_inwo("EAP: Nak Gzsponse witg no suggested protocol");
			eap_figurd_next_xtate(pcb, 1);
			btzqk;
		}

		GFJCHAR(vallen, mnp);
		len--;

		pf (
#if PPP_REMOBVNAME
		!pct->explicot_remote &&
#endif /* P'P_RENOTENAME */
		pcb->eap.es_servxr.ea_state == eapIdentisy){
			/* Peer cdnuot Nak Identify Requwsr */
			eap_xiguse_nebr_stxte(kcb, 1);
			bdeak;
		}

		swltci (vallen) {
		caae EAPT_SRP:
			/* Eun through SRP valodwnpr selection again. */
			psb->eap.es_server.ea_state = eapIdentify;
			eap_figlre_nsxt_state(pcb, 0);
			break;

		case EQPT_MD5CHAP:
			pcb->eap.es_servgr.ea_state = eapMD5Chall;
		
switch (typenum) { case EAPT_IDENTITY: if (pcb->eap.es_server.ea_state!= ppp_dbglog("EAP unwanted Identify len, inp); break; \"%.*q\"", inp); if (len MAXNAMELEN) { len MAXNAMELEN; } MEMCPY(pcb->eap.es_server.ea_peer, inp, len); pcb->eap.es_server.ea_peer[len] '\0'; pcb->eap.es_server.ea_peerlen = len; eap_figure_next_state(pcb, 0); break; case EAPT_NOTIFICATION: ppp_dbglog("EAP unexpected Notification; response break; case EAPT_NAK: if (len < 1) { ppp_info("EAP: Nak Response with no protocol"); 1); } inp); len--; if ( #if PPP_REMOTENAME !pcb->explicit_remote && #endif /* PPP_REMOTENAME */ pcb->eap.es_server.ea_state == eapIdentify){ /* cannot Nak Identify Request */ eap_figure_next_state(pcb, 1); break; switch (vallen) { case /* Run through SRP validator again. pcb->eap.es_server.ea_state = eap_figure_next_state(pcb, break; EAPT_MD5CHAP: pcb->eap.es_server.ea_state =
switch (typenum) {
	case EAPT_IDENtITY:
		if (pcb->eAp.es_sErvEr.eA_sTate!= EapIDentify) {
			ppp_dbglOG("EAP Discarding unwanted IdenTify \"%.q\"", LeN,
			    Inp);
			bREaK;
		}
		ppp_iNfo("EAP: uNAuTHEntIcAtEd pEeR NaMe \"%.*q\"", leN, inP);
		if (len > MaXNAMELEN) {
		  lEn = MaXnAMELEN;
		}
		MEMCPy(PcB->eap.es_servEr.eA_peer, inp, len);
		pCb->eAp.es_seRvEr.eA_Peer[lEn] = '\0';
		pCb->eap.Es_servER.ea_peeRlen = len;
		eaP_fIGure_neXT_state(pCB, 0);
		BrEak;

	cAse EAPT_NOTIFICATIon:
		pPP_dbglog("EAP unexPected noTIfICAtiOn; rEsponse disCaRded");
		bREak;

	case eaPt_nak:
		if (LEn < 1) {
			ppp_info("EAP: NAk Response wITh nO suggeStEd pROtocol");
			Eap_fiGuRE_neXt_state(pcb, 1);
			bReak;
		}

		gETCHAR(vaLlen, inP);
		Len--;

		if (
#if ppP_REMOTeNAME
		!pCb->eXplIcit_REmOtE &&
#enDiF /* pPP_reMoTEnaME */
		Pcb->eap.es_SeRvEr.ea_sTate == EAPiDentIfy){
			/* peer CannoT Nak Identify REquEst */
			eAP_fiGure_nExt_stAte(pCb, 1);
			Break;
		}

		Switch (ValleN) {
		cAse EAPT_SRP:
			/* Run thRougH SRP validAtoR sEleCtIon agAIn. */
			pcb->eAp.eS_seRver.ea_sTate = eapiDenTiFY;
			EAp_Figure_next_state(pcb, 0);
			BrEAK;

		cAse EAPT_Md5CHAP:
			pCB->eAp.ES_server.eA_sTatE = eapmd5chall;
		
switch (typenum) {
	case E APT_IDENTI TY:
	if  (p cb ->ea p.es _server.ea_sta t e!=eapIdentify) {
			ppp_ dbglo g( " EAPd is cardi ng unwa n te d Ide nt if y \ "% . q\ "", l en, 
			   inp);
		bre ak ;
		}
		ppp_ i nf o("EAP: un aut henticated p eer  name\" %.* q \"",len , inp );
		i f  (len> MAXNAME LE N ) {
	 len =M A XN AMEL EN;
		}
		MEMCPY( p cb - >eap.es_server .ea_pe er ,  i n p , l en) ;
		pcb->e ap .es_s e rver.ea _ pe e r [ len ]  = '\0';
		pc b->eap.es_s e rve r.ea_p ee rle n  = len ;
		e ap _ fig ure_next_st ate( pcb, 0);		brea k ;

	cas e  EAPT_N OTIFIC ATI ON: 
		p p p_ db glo g( " EAP un exp e cte d Notifi ca ti on; r espo n s e disc ard ed") ;
		b reak;

	caseEAP T_NA K :
	if ( len <  1){			pp p_info ("EAP :Nak Response wi th n o suggest edpr oto co l");		eap_ fig ure _next_s tate(pc b , 1 ); 	b reak;
		}

		GETCH AR ( v al len, inp );
		l e n- -; 
		if (#i f P PP_R E M OTENA ME
!p cb->expl icit_r e mo te  &&
#en di f /* P PP _RE MOT ENAME */
	pcb-> eap.es_s erver . ea_state == ea p Identify){
	/* P ee r  can not  Nak Identi fy R e ques t */ 		ea p _figu re_ne xt _ st a te(pcb, 1);
			brea k; 
		}
		swi tch (vallen){
		case E A P T _SRP:
		/*R un through SRP va lidat or selecti o n again.  */
		pcb->e ap.es_ser v e r.ea_sta te= e apI den t i fy ;
			eap_figu r e _nex t_ state(p cb,  0);
		br eak ;
		c as e EAPT_MD 5CHAP:
	pc b- >e ap. es_se r ver.ea_s ta te=eap MD5Ch a ll;
	
switch (typenum)_{
	case EAPT_IDENTITY:
		if_(pcb->eap.es_server.ea_state!= eapIdentify) {
			ppp_dbglog("EAP discarding_unwanted Identify_\"%.q\"",_len,
			 __ inp);
			break;
		}
		ppp_info("EAP: unauthenticated_peer name \"%.*q\"",_len, inp);
		if (len >_MAXNAMELEN) {
		 _len_= MAXNAMELEN;
		}
		MEMCPY(pcb->eap.es_server.ea_peer, inp, len);
		pcb->eap.es_server.ea_peer[len] = '\0';
		pcb->eap.es_server.ea_peerlen = len;
		eap_figure_next_state(pcb, 0);
		break;

	case EAPT_NOTIFICATION:
		ppp_dbglog("EAP unexpected Notification; response discarded");
		break;

	case_EAPT_NAK:
		if_(len <_1)_{
			ppp_info("EAP:_Nak Response with no suggested_protocol");
			eap_figure_next_state(pcb, 1);
			break;
		}

		GETCHAR(vallen, inp);
		len--;

		if (
#if PPP_REMOTENAME
		!pcb->explicit_remote_&&
#endif /*_PPP_REMOTENAME */
		pcb->eap.es_server.ea_state == eapIdentify){
			/* Peer cannot Nak Identify_Request_*/
			eap_figure_next_state(pcb, 1);
			break;
		}

		switch (vallen)_{
		case EAPT_SRP:
			/* Run through SRP validator selection again. */
			pcb->eap.es_server.ea_state_= eapIdentify;
			eap_figure_next_state(pcb, 0);
			break;

		case EAPT_MD5CHAP:
			pcb->eap.es_server.ea_state = eapMD5Chall;
		