Qianqian Hu
Committed by Ray Milkey

According to the 802.1x standard, the state-machine should go back to connecting…

… state if a start packet is received while in authorized state

Change-Id: I07ef81eb73d2422cbb85b9c8dd9fcd4f48742e2e
......@@ -83,7 +83,7 @@ class StateMachine {
input
----------------------------------------------------------------------------------------------------
START STARTED | _ | _ | _ | _
START STARTED | _ | _ | STARTED | _
REQUEST_ACCESS _ | PENDING | _ | _ | _
......@@ -101,7 +101,7 @@ class StateMachine {
private int[] pendingTransition =
{STATE_PENDING, STATE_PENDING, STATE_AUTHORIZED, STATE_UNAUTHORIZED, STATE_PENDING};
private int[] authorizedTransition =
{STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_IDLE};
{STATE_STARTED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_IDLE};
private int[] unauthorizedTransition =
{STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_IDLE};
......@@ -515,6 +515,10 @@ class StateMachine {
private final Logger log = getLogger(getClass());
private String name = "AUTHORIZED_STATE";
public void start() {
log.info("Moving from AUTHORIZED state to STARTED state.");
}
public void logoff() {
log.info("Moving from AUTHORIZED state to IDLE state.");
......
......@@ -175,10 +175,10 @@ public class StateMachineTest {
stateMachine.authorizeAccess();
stateMachine.start();
Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED);
Assert.assertEquals(stateMachine.state(), StateMachine.STATE_STARTED);
stateMachine.requestAccess();
Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED);
Assert.assertEquals(stateMachine.state(), StateMachine.STATE_PENDING);
stateMachine.authorizeAccess();
Assert.assertEquals(stateMachine.state(), StateMachine.STATE_AUTHORIZED);
......