State Pseudocode: Request-Sent & ACK-Received
Request-Sent: In the Request-Sent state an attempt is made to configure the connection. A Configure-Request has been sent and the Restart timer is running, but a Configure-Ack has not yet been received nor has one been sent.
[10-1]
|
reqsent (){
if (event) {
= DOWN : transition(STARTING); //transition to STARTING state
end DOWN;
= OPEN : transition(REQSENT); //transition to REQSENT state
end OPEN;
= CLOSE : irc(event); //action
str(... ); //action
transition(CLOSING); //transition to closing state
end CLOSE;
= TOP : scr(false); //action
initialize PPPTimer(); //initialize PPP timer
end TOP;
= TON, RTA, RXJP, or RXR :
end EVENT; //no action or state transition
= RCRP : sca(... ); //action if (PAP
= Server) { tlu(); //action
transition(OPENED); //transition to OPENED state
} else { //client
transition(ACKSENT); //transition to ACKSENT state
}
end RCRP;
= RCRN : scn(... ); //action
end RCRN;
= RCA : if (PAP
= Server) { tlu(); //action
transition(OPENED); //transition to OPENED state
} else { //client
irc(event); //action
transition(ACKRCVD); //transition to ACKRCVD state
}
end RCA;
= RCN : irc(event); //action
scr(false); //action
transition(REQSENT); //transition to REQSENT state
end RCN;
= RTR : sta(... ); //action
end RTR;
= RUC : scj(..); //action
break;
= RXJN : tlf(); //action
transition(STOPPED); //transition to STOPPED state
end RXJN;
= any other event :
wrongEvent; //indicate that when PPP in reqsent state no other event is processed
}
}
|
ACK-Received: In the Ack-Received state, a Configure-Request has been sent and a Configure-Ack has been received. The Restart timer is still running, since a Config-ure-Ack has not yet been sent. [10-1]
|
ackrcvd (){
if (event) {
= DOWN : transition(STARTING); //transition to STARTING state
end DOWN;
= OPEN, TON, or RXR:
end EVENT; //no action or state transition
= CLOSE : irc(event); //action
str(... ); //action
transition(CLOSING); //transition to CLOSING state
end CLOSE;
= TOP : scr(false); //action
transition(REQSENT); //transition to REQSENT state
end TOP;
= RCRP : sca(... ); //action
tlu(); //action
transition(OPENED); //transition to OPENED state
end RCRP;
= RCRN : scn(... ); //action
end RCRN;
= RCA or RCN : scr(false); //action
transition(REQSENT); //transition to REQSENT state
end EVENT;
= RTR : sta(... ); //action
transition(REQSENT); //transition to REQSENT state
end RTR;
= RTA or RXJP : transition(REQSENT); //transition to REQSENT state
end EVENT;
= RUC : scj(... .); //action
end RUC;
= RXJN : tlf(); //action
transition(STOPPED); //event
end RXJN;
= any other event :
wrongEvent; //indicate that when PPP in ackrcvd state no other event is processed
}
}
|