blob: 4a00966853e28bc1143b6e8a4d4583f3884076a4 [file] [log] [blame]
Ari Saha89831742015-06-26 10:31:48 -07001/*
Amit Ghoshc9ac1e52017-07-28 12:31:18 +01002 * Copyright 2017-present Open Networking Foundation
Ari Saha89831742015-06-26 10:31:48 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
alshabib6d527452016-06-01 18:00:47 -070018package org.opencord.aaa;
Ari Saha89831742015-06-26 10:31:48 -070019
Ray Milkeyf61a24e2015-09-24 16:34:02 -070020import java.util.Map;
21
Ari Saha89831742015-06-26 10:31:48 -070022import org.onlab.packet.MacAddress;
Amit Ghoshc9ac1e52017-07-28 12:31:18 +010023import org.onlab.packet.VlanId;
Ari Saha89831742015-06-26 10:31:48 -070024import org.onosproject.net.ConnectPoint;
Amit Ghoshc9ac1e52017-07-28 12:31:18 +010025
26import org.opencord.olt.AccessDeviceService;
27
Ari Saha89831742015-06-26 10:31:48 -070028import org.slf4j.Logger;
Thomas Vachuskae9894202015-07-30 11:59:07 -070029
Ray Milkeyf61a24e2015-09-24 16:34:02 -070030import com.google.common.collect.Maps;
Ari Saha89831742015-06-26 10:31:48 -070031
32import static org.slf4j.LoggerFactory.getLogger;
33
34/**
35 * AAA Finite State Machine.
36 */
37
38class StateMachine {
39 //INDEX to identify the state in the transition table
40 static final int STATE_IDLE = 0;
41 static final int STATE_STARTED = 1;
42 static final int STATE_PENDING = 2;
43 static final int STATE_AUTHORIZED = 3;
44 static final int STATE_UNAUTHORIZED = 4;
45
46 //INDEX to identify the transition in the transition table
47 static final int TRANSITION_START = 0; // --> started
48 static final int TRANSITION_REQUEST_ACCESS = 1;
49 static final int TRANSITION_AUTHORIZE_ACCESS = 2;
50 static final int TRANSITION_DENY_ACCESS = 3;
51 static final int TRANSITION_LOGOFF = 4;
52
Amit Ghoshc9ac1e52017-07-28 12:31:18 +010053 private static AccessDeviceService accessDeviceService;
Ari Saha89831742015-06-26 10:31:48 -070054
Amit Ghoshc9ac1e52017-07-28 12:31:18 +010055 private static int identifier = -1;
Ari Saha89831742015-06-26 10:31:48 -070056 private byte challengeIdentifier;
57 private byte[] challengeState;
58 private byte[] username;
59 private byte[] requestAuthenticator;
60
61 // Supplicant connectivity info
Ray Milkeyf61a24e2015-09-24 16:34:02 -070062 private ConnectPoint supplicantConnectpoint;
63 private MacAddress supplicantAddress;
64 private short vlanId;
Amit Ghoshc9ac1e52017-07-28 12:31:18 +010065 private VlanId ctag;
66 private byte priorityCode;
Ari Saha89831742015-06-26 10:31:48 -070067
68 private String sessionId = null;
69
70 private final Logger log = getLogger(getClass());
71
72
73 private State[] states = {
74 new Idle(), new Started(), new Pending(), new Authorized(), new Unauthorized()
75 };
76
77
78 //State transition table
79 /*
80
81 state IDLE | STARTED | PENDING | AUTHORIZED | UNAUTHORIZED
82 ////
83 input
84 ----------------------------------------------------------------------------------------------------
85
ke han04e47f32016-10-28 14:15:43 +080086 START STARTED | _ | _ | STARTED | STARTED
Ari Saha89831742015-06-26 10:31:48 -070087
88 REQUEST_ACCESS _ | PENDING | _ | _ | _
89
90 AUTHORIZE_ACCESS _ | _ | AUTHORIZED | _ | _
91
92 DENY_ACCESS _ | - | UNAUTHORIZED | _ | _
93
94 LOGOFF _ | _ | _ | IDLE | IDLE
95 */
96
97 private int[] idleTransition =
98 {STATE_STARTED, STATE_IDLE, STATE_IDLE, STATE_IDLE, STATE_IDLE};
99 private int[] startedTransition =
100 {STATE_STARTED, STATE_PENDING, STATE_STARTED, STATE_STARTED, STATE_STARTED};
101 private int[] pendingTransition =
102 {STATE_PENDING, STATE_PENDING, STATE_AUTHORIZED, STATE_UNAUTHORIZED, STATE_PENDING};
103 private int[] authorizedTransition =
Qianqian Hu0c349812016-02-15 17:25:22 +0800104 {STATE_STARTED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_AUTHORIZED, STATE_IDLE};
Ari Saha89831742015-06-26 10:31:48 -0700105 private int[] unauthorizedTransition =
ke han04e47f32016-10-28 14:15:43 +0800106 {STATE_STARTED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_UNAUTHORIZED, STATE_IDLE};
Ari Saha89831742015-06-26 10:31:48 -0700107
108 //THE TRANSITION TABLE
109 private int[][] transition =
110 {idleTransition, startedTransition, pendingTransition, authorizedTransition,
111 unauthorizedTransition};
112
113 private int currentState = STATE_IDLE;
114
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700115 // Maps of state machines. Each state machine is represented by an
116 // unique identifier on the switch: dpid + port number
117 private static Map<String, StateMachine> sessionIdMap;
118 private static Map<Integer, StateMachine> identifierMap;
Ari Saha89831742015-06-26 10:31:48 -0700119
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700120 public static void initializeMaps() {
121 sessionIdMap = Maps.newConcurrentMap();
122 identifierMap = Maps.newConcurrentMap();
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100123 identifier = -1;
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700124 }
125
126 public static void destroyMaps() {
127 sessionIdMap = null;
128 identifierMap = null;
129 }
130
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100131 public static void setAccessDeviceService(AccessDeviceService service) {
132 accessDeviceService = service;
133 }
134
Qianqian Hu61a6a402016-02-16 15:18:05 +0800135 public static Map<String, StateMachine> sessionIdMap() {
136 return sessionIdMap;
137 }
138
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700139 public static StateMachine lookupStateMachineById(byte identifier) {
140 return identifierMap.get((int) identifier);
141 }
142
143 public static StateMachine lookupStateMachineBySessionId(String sessionId) {
144 return sessionIdMap.get(sessionId);
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100145 }
146
147 public static void deleteStateMachineMapping(StateMachine machine) {
148 identifierMap.entrySet().removeIf(e -> e.getValue().equals(machine));
149 }
150
151 /**
Ari Saha89831742015-06-26 10:31:48 -0700152 * State Machine Constructor.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700153 *
154 * @param sessionId session Id represented by the switch dpid + port number
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100155 * @param ctag C-TAG for this subscriber
Ari Saha89831742015-06-26 10:31:48 -0700156 */
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100157 public StateMachine(String sessionId, VlanId ctag) {
158 log.info("Creating a new state machine for {} C-TAG {}", sessionId,
159 ctag);
Ari Saha89831742015-06-26 10:31:48 -0700160 this.sessionId = sessionId;
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700161 sessionIdMap.put(sessionId, this);
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100162 this.ctag = ctag;
Ari Saha89831742015-06-26 10:31:48 -0700163 }
164
165 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700166 * Gets the connect point for the supplicant side.
167 *
168 * @return supplicant connect point
169 */
170 public ConnectPoint supplicantConnectpoint() {
171 return supplicantConnectpoint;
172 }
173
174 /**
175 * Sets the supplicant side connect point.
176 *
177 * @param supplicantConnectpoint supplicant select point.
178 */
179 public void setSupplicantConnectpoint(ConnectPoint supplicantConnectpoint) {
180 this.supplicantConnectpoint = supplicantConnectpoint;
181 }
182
183 /**
184 * Gets the MAC address of the supplicant.
185 *
186 * @return supplicant MAC address
187 */
188 public MacAddress supplicantAddress() {
189 return supplicantAddress;
190 }
191
192 /**
193 * Sets the supplicant MAC address.
194 *
195 * @param supplicantAddress new supplicant MAC address
196 */
197 public void setSupplicantAddress(MacAddress supplicantAddress) {
198 this.supplicantAddress = supplicantAddress;
199 }
200
201 /**
202 * Gets the client's Vlan ID.
203 *
204 * @return client vlan ID
205 */
206 public short vlanId() {
207 return vlanId;
208 }
209
210 /**
211 * Sets the client's vlan ID.
212 *
213 * @param vlanId new client vlan ID
214 */
215 public void setVlanId(short vlanId) {
216 this.vlanId = vlanId;
217 }
218
219 /**
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100220 * Gets the client's priority Code.
221 *
222 * @return client Priority code
223 */
224 public byte priorityCode() {
225 return priorityCode;
226 }
227
228 /**
229 * Sets the client's priority Code.
230 *
231 * @param priorityCode new client priority Code
232 */
233 public void setPriorityCode(byte priorityCode) {
234 this.priorityCode = priorityCode;
235 }
236
237 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700238 * Gets the client id that is requesting for access.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700239 *
Ari Saha89831742015-06-26 10:31:48 -0700240 * @return The client id.
241 */
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700242 public String sessionId() {
Ari Saha89831742015-06-26 10:31:48 -0700243 return this.sessionId;
244 }
245
246 /**
Ari Saha89831742015-06-26 10:31:48 -0700247 * Set the challenge identifier and the state issued by the RADIUS.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700248 *
Ari Saha89831742015-06-26 10:31:48 -0700249 * @param challengeIdentifier The challenge identifier set into the EAP packet from the RADIUS message.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700250 * @param challengeState The challenge state from the RADIUS.
Ari Saha89831742015-06-26 10:31:48 -0700251 */
252 protected void setChallengeInfo(byte challengeIdentifier, byte[] challengeState) {
253 this.challengeIdentifier = challengeIdentifier;
254 this.challengeState = challengeState;
255 }
Thomas Vachuskae9894202015-07-30 11:59:07 -0700256
Ari Saha89831742015-06-26 10:31:48 -0700257 /**
258 * Set the challenge identifier issued by the RADIUS on the access challenge request.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700259 *
Ari Saha89831742015-06-26 10:31:48 -0700260 * @param challengeIdentifier The challenge identifier set into the EAP packet from the RADIUS message.
261 */
262 protected void setChallengeIdentifier(byte challengeIdentifier) {
263 log.info("Set Challenge Identifier to {}", challengeIdentifier);
264 this.challengeIdentifier = challengeIdentifier;
265 }
266
267 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700268 * Gets the challenge EAP identifier set by the RADIUS.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700269 *
Ari Saha89831742015-06-26 10:31:48 -0700270 * @return The challenge EAP identifier.
271 */
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700272 protected byte challengeIdentifier() {
Ari Saha89831742015-06-26 10:31:48 -0700273 return this.challengeIdentifier;
274 }
275
276
277 /**
278 * Set the challenge state info issued by the RADIUS.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700279 *
Ari Saha89831742015-06-26 10:31:48 -0700280 * @param challengeState The challenge state from the RADIUS.
281 */
282 protected void setChallengeState(byte[] challengeState) {
283 log.info("Set Challenge State");
284 this.challengeState = challengeState;
285 }
286
287 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700288 * Gets the challenge state set by the RADIUS.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700289 *
Ari Saha89831742015-06-26 10:31:48 -0700290 * @return The challenge state.
291 */
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700292 protected byte[] challengeState() {
Ari Saha89831742015-06-26 10:31:48 -0700293 return this.challengeState;
294 }
295
296 /**
297 * Set the username.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700298 *
Ari Saha89831742015-06-26 10:31:48 -0700299 * @param username The username sent to the RADIUS upon access request.
300 */
301 protected void setUsername(byte[] username) {
302 this.username = username;
303 }
304
305
306 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700307 * Gets the username.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700308 *
Ari Saha89831742015-06-26 10:31:48 -0700309 * @return The requestAuthenticator.
310 */
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700311 protected byte[] requestAuthenticator() {
Ari Saha89831742015-06-26 10:31:48 -0700312 return this.requestAuthenticator;
313 }
314
315 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700316 * Sets the authenticator.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700317 *
Ari Saha89831742015-06-26 10:31:48 -0700318 * @param authenticator The username sent to the RADIUS upon access request.
319 */
320 protected void setRequestAuthenticator(byte[] authenticator) {
321 this.requestAuthenticator = authenticator;
322 }
323
324
325 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700326 * Gets the username.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700327 *
Ari Saha89831742015-06-26 10:31:48 -0700328 * @return The username.
329 */
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700330 protected byte[] username() {
Ari Saha89831742015-06-26 10:31:48 -0700331 return this.username;
332 }
333
334 /**
335 * Return the identifier of the state machine.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700336 *
Ari Saha89831742015-06-26 10:31:48 -0700337 * @return The state machine identifier.
338 */
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100339 public synchronized byte identifier() {
340 identifier = (identifier + 1) % 255;
341 identifierMap.put(identifier, this);
342 return (byte) identifier;
Ari Saha89831742015-06-26 10:31:48 -0700343 }
344
Ari Saha89831742015-06-26 10:31:48 -0700345 /**
346 * Move to the next state.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700347 *
Ray Milkey78e95a42015-09-24 08:36:45 -0700348 * @param msg message
Ari Saha89831742015-06-26 10:31:48 -0700349 */
Thomas Vachuskae9894202015-07-30 11:59:07 -0700350 private void next(int msg) {
Ari Saha89831742015-06-26 10:31:48 -0700351 currentState = transition[currentState][msg];
352 log.info("Current State " + currentState);
353 }
354
355 /**
356 * Client has requested the start action to allow network access.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700357 *
358 * @throws StateMachineException if authentication protocol is violated
Ari Saha89831742015-06-26 10:31:48 -0700359 */
360 public void start() throws StateMachineException {
Ray Milkey78e95a42015-09-24 08:36:45 -0700361 states[currentState].start();
362 //move to the next state
363 next(TRANSITION_START);
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100364 identifier = this.identifier();
Ari Saha89831742015-06-26 10:31:48 -0700365 }
366
367 /**
368 * An Identification information has been sent by the supplicant.
369 * Move to the next state if possible.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700370 *
371 * @throws StateMachineException if authentication protocol is violated
Ari Saha89831742015-06-26 10:31:48 -0700372 */
373 public void requestAccess() throws StateMachineException {
Ray Milkey78e95a42015-09-24 08:36:45 -0700374 states[currentState].requestAccess();
375 //move to the next state
376 next(TRANSITION_REQUEST_ACCESS);
Ari Saha89831742015-06-26 10:31:48 -0700377 }
378
379 /**
380 * RADIUS has accepted the identification.
381 * Move to the next state if possible.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700382 *
383 * @throws StateMachineException if authentication protocol is violated
Ari Saha89831742015-06-26 10:31:48 -0700384 */
385 public void authorizeAccess() throws StateMachineException {
Ray Milkey78e95a42015-09-24 08:36:45 -0700386 states[currentState].radiusAccepted();
387 //move to the next state
388 next(TRANSITION_AUTHORIZE_ACCESS);
Ari Saha89831742015-06-26 10:31:48 -0700389
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100390 if (accessDeviceService != null) {
391 log.info("Provisioning subscriber at {} with C-TAG {}",
392 supplicantConnectpoint(), ctag);
393 accessDeviceService.provisionSubscriber(supplicantConnectpoint(),
394 ctag);
395 }
Ari Saha89831742015-06-26 10:31:48 -0700396
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100397 // Clear mapping
398 deleteStateMachineMapping(this);
Ari Saha89831742015-06-26 10:31:48 -0700399 }
400
401 /**
402 * RADIUS has denied the identification.
403 * Move to the next state if possible.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700404 *
405 * @throws StateMachineException if authentication protocol is violated
Ari Saha89831742015-06-26 10:31:48 -0700406 */
407 public void denyAccess() throws StateMachineException {
Ray Milkey78e95a42015-09-24 08:36:45 -0700408 states[currentState].radiusDenied();
409 //move to the next state
410 next(TRANSITION_DENY_ACCESS);
Amit Ghoshc9ac1e52017-07-28 12:31:18 +0100411 // Clear mappings
412 deleteStateMachineMapping(this);
Ari Saha89831742015-06-26 10:31:48 -0700413 }
414
415 /**
416 * Logoff request has been requested.
417 * Move to the next state if possible.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700418 *
419 * @throws StateMachineException if authentication protocol is violated
Ari Saha89831742015-06-26 10:31:48 -0700420 */
421 public void logoff() throws StateMachineException {
Ray Milkey78e95a42015-09-24 08:36:45 -0700422 states[currentState].logoff();
423 //move to the next state
424 next(TRANSITION_LOGOFF);
Ari Saha89831742015-06-26 10:31:48 -0700425 }
426
427 /**
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700428 * Gets the current state.
Thomas Vachuskae9894202015-07-30 11:59:07 -0700429 *
Ari Saha89831742015-06-26 10:31:48 -0700430 * @return The current state. Could be STATE_IDLE, STATE_STARTED, STATE_PENDING, STATE_AUTHORIZED,
431 * STATE_UNAUTHORIZED.
432 */
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700433 public int state() {
Ari Saha89831742015-06-26 10:31:48 -0700434 return currentState;
435 }
436
Ray Milkeyf61a24e2015-09-24 16:34:02 -0700437 @Override
Ari Saha89831742015-06-26 10:31:48 -0700438 public String toString() {
439 return ("sessionId: " + this.sessionId) + "\t" + ("identifier: " + this.identifier) + "\t" +
440 ("state: " + this.currentState);
441 }
Ari Saha89831742015-06-26 10:31:48 -0700442
Ray Milkey78e95a42015-09-24 08:36:45 -0700443 abstract class State {
444 private final Logger log = getLogger(getClass());
Thomas Vachuskae9894202015-07-30 11:59:07 -0700445
Ray Milkey78e95a42015-09-24 08:36:45 -0700446 private String name = "State";
Ari Saha89831742015-06-26 10:31:48 -0700447
Ray Milkey78e95a42015-09-24 08:36:45 -0700448 public void start() throws StateMachineInvalidTransitionException {
449 log.warn("START transition from this state is not allowed.");
450 }
Ari Saha89831742015-06-26 10:31:48 -0700451
Ray Milkey78e95a42015-09-24 08:36:45 -0700452 public void requestAccess() throws StateMachineInvalidTransitionException {
453 log.warn("REQUEST ACCESS transition from this state is not allowed.");
454 }
455
456 public void radiusAccepted() throws StateMachineInvalidTransitionException {
457 log.warn("AUTHORIZE ACCESS transition from this state is not allowed.");
458 }
459
460 public void radiusDenied() throws StateMachineInvalidTransitionException {
461 log.warn("DENY ACCESS transition from this state is not allowed.");
462 }
463
464 public void logoff() throws StateMachineInvalidTransitionException {
465 log.warn("LOGOFF transition from this state is not allowed.");
466 }
Ari Saha89831742015-06-26 10:31:48 -0700467 }
Thomas Vachuskae9894202015-07-30 11:59:07 -0700468
Ray Milkey78e95a42015-09-24 08:36:45 -0700469 /**
470 * Idle state: supplicant is logged of from the network.
471 */
472 class Idle extends State {
473 private final Logger log = getLogger(getClass());
474 private String name = "IDLE_STATE";
475
476 public void start() {
477 log.info("Moving from IDLE state to STARTED state.");
478 }
Ari Saha89831742015-06-26 10:31:48 -0700479 }
Thomas Vachuskae9894202015-07-30 11:59:07 -0700480
Ray Milkey78e95a42015-09-24 08:36:45 -0700481 /**
482 * Started state: supplicant has entered the network and informed the authenticator.
483 */
484 class Started extends State {
485 private final Logger log = getLogger(getClass());
486 private String name = "STARTED_STATE";
487
488 public void requestAccess() {
489 log.info("Moving from STARTED state to PENDING state.");
490 }
Ari Saha89831742015-06-26 10:31:48 -0700491 }
Thomas Vachuskae9894202015-07-30 11:59:07 -0700492
Ray Milkey78e95a42015-09-24 08:36:45 -0700493 /**
494 * Pending state: supplicant has been identified by the authenticator but has not access yet.
495 */
496 class Pending extends State {
497 private final Logger log = getLogger(getClass());
498 private String name = "PENDING_STATE";
499
500 public void radiusAccepted() {
501 log.info("Moving from PENDING state to AUTHORIZED state.");
502 }
503
504 public void radiusDenied() {
505 log.info("Moving from PENDING state to UNAUTHORIZED state.");
506 }
Ari Saha89831742015-06-26 10:31:48 -0700507 }
Thomas Vachuskae9894202015-07-30 11:59:07 -0700508
Ray Milkey78e95a42015-09-24 08:36:45 -0700509 /**
510 * Authorized state: supplicant port has been accepted, access is granted.
511 */
512 class Authorized extends State {
513 private final Logger log = getLogger(getClass());
514 private String name = "AUTHORIZED_STATE";
Ari Saha89831742015-06-26 10:31:48 -0700515
Qianqian Hu0c349812016-02-15 17:25:22 +0800516 public void start() {
517 log.info("Moving from AUTHORIZED state to STARTED state.");
518 }
519
Ray Milkey78e95a42015-09-24 08:36:45 -0700520 public void logoff() {
Ari Saha89831742015-06-26 10:31:48 -0700521
Ray Milkey78e95a42015-09-24 08:36:45 -0700522 log.info("Moving from AUTHORIZED state to IDLE state.");
523 }
Ari Saha89831742015-06-26 10:31:48 -0700524 }
525
Ray Milkey78e95a42015-09-24 08:36:45 -0700526 /**
527 * Unauthorized state: supplicant port has been rejected, access is denied.
528 */
529 class Unauthorized extends State {
530 private final Logger log = getLogger(getClass());
531 private String name = "UNAUTHORIZED_STATE";
532
ke han04e47f32016-10-28 14:15:43 +0800533 public void start() {
534 log.info("Moving from UNAUTHORIZED state to STARTED state.");
535 }
536
Ray Milkey78e95a42015-09-24 08:36:45 -0700537 public void logoff() {
538 log.info("Moving from UNAUTHORIZED state to IDLE state.");
539 }
Ari Saha89831742015-06-26 10:31:48 -0700540 }
Ari Saha89831742015-06-26 10:31:48 -0700541
542
Ari Saha89831742015-06-26 10:31:48 -0700543}