예제 #1
0
파일: Protocol.cpp 프로젝트: DonCN/haiku
void
IPCP::NewState(ppp_state next)
{
	TRACE("IPCP: NewState(%d) state=%d\n", next, State());
	
	// report state changes
	if(State() == PPP_INITIAL_STATE && next != State())
		UpStarted();
	else if(State() == PPP_OPENED_STATE && next != State())
		DownStarted();
	
	// maybe we do not need the timer anymore
	if(next < PPP_CLOSING_STATE || next == PPP_OPENED_STATE)
		fNextTimeout = 0;
	
	fState = next;
}
예제 #2
0
void
PAP::NewState(pap_state next)
{
	TRACE("PAP: NewState(%d) state=%d\n", next, State());

	//  state changes
	if (State() == INITIAL && next != State()) {
		if (Side() == PPP_LOCAL_SIDE)
			Interface().StateMachine().LocalAuthenticationRequested();
		else if (Side() == PPP_PEER_SIDE)
			Interface().StateMachine().PeerAuthenticationRequested();

		UpStarted();
	} else if (State() == ACCEPTED && next != State())
		DownStarted();

	// maybe we do not need the timer anymore
	if (next == INITIAL || next == ACCEPTED)
		fNextTimeout = 0;

	fState = next;
}