Committed by
Gerrit Code Review
Break dependency between AAA app and demo XOS integration app
The XOS integration app was written just for the ONS demo and is a frequent cause of confusion for people outside the lab. Change-Id: I03cf592890dc7ae68520bc7b71d99e742a9da74c
Showing
4 changed files
with
20 additions
and
43 deletions
... | @@ -45,12 +45,6 @@ | ... | @@ -45,12 +45,6 @@ |
45 | 45 | ||
46 | <dependency> | 46 | <dependency> |
47 | <groupId>org.onosproject</groupId> | 47 | <groupId>org.onosproject</groupId> |
48 | - <artifactId>onos-app-xos-integration</artifactId> | ||
49 | - <version>${project.version}</version> | ||
50 | - </dependency> | ||
51 | - | ||
52 | - <dependency> | ||
53 | - <groupId>org.onosproject</groupId> | ||
54 | <artifactId>onlab-junit</artifactId> | 48 | <artifactId>onlab-junit</artifactId> |
55 | <scope>test</scope> | 49 | <scope>test</scope> |
56 | </dependency> | 50 | </dependency> | ... | ... |
... | @@ -15,7 +15,14 @@ | ... | @@ -15,7 +15,14 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.aaa; | 16 | package org.onosproject.aaa; |
17 | 17 | ||
18 | -import com.google.common.util.concurrent.ThreadFactoryBuilder; | 18 | +import java.io.IOException; |
19 | +import java.net.DatagramPacket; | ||
20 | +import java.net.DatagramSocket; | ||
21 | +import java.net.InetAddress; | ||
22 | +import java.nio.ByteBuffer; | ||
23 | +import java.util.concurrent.ExecutorService; | ||
24 | +import java.util.concurrent.Executors; | ||
25 | + | ||
19 | import org.apache.felix.scr.annotations.Activate; | 26 | import org.apache.felix.scr.annotations.Activate; |
20 | import org.apache.felix.scr.annotations.Component; | 27 | import org.apache.felix.scr.annotations.Component; |
21 | import org.apache.felix.scr.annotations.Deactivate; | 28 | import org.apache.felix.scr.annotations.Deactivate; |
... | @@ -48,16 +55,9 @@ import org.onosproject.net.packet.OutboundPacket; | ... | @@ -48,16 +55,9 @@ import org.onosproject.net.packet.OutboundPacket; |
48 | import org.onosproject.net.packet.PacketContext; | 55 | import org.onosproject.net.packet.PacketContext; |
49 | import org.onosproject.net.packet.PacketProcessor; | 56 | import org.onosproject.net.packet.PacketProcessor; |
50 | import org.onosproject.net.packet.PacketService; | 57 | import org.onosproject.net.packet.PacketService; |
51 | -import org.onosproject.xosintegration.VoltTenantService; | ||
52 | import org.slf4j.Logger; | 58 | import org.slf4j.Logger; |
53 | 59 | ||
54 | -import java.io.IOException; | 60 | +import com.google.common.util.concurrent.ThreadFactoryBuilder; |
55 | -import java.net.DatagramPacket; | ||
56 | -import java.net.DatagramSocket; | ||
57 | -import java.net.InetAddress; | ||
58 | -import java.nio.ByteBuffer; | ||
59 | -import java.util.concurrent.ExecutorService; | ||
60 | -import java.util.concurrent.Executors; | ||
61 | 61 | ||
62 | import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY; | 62 | import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY; |
63 | import static org.onosproject.net.packet.PacketPriority.CONTROL; | 63 | import static org.onosproject.net.packet.PacketPriority.CONTROL; |
... | @@ -82,9 +82,6 @@ public class AaaManager { | ... | @@ -82,9 +82,6 @@ public class AaaManager { |
82 | protected PacketService packetService; | 82 | protected PacketService packetService; |
83 | 83 | ||
84 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 84 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
85 | - protected VoltTenantService voltTenantService; | ||
86 | - | ||
87 | - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
88 | protected NetworkConfigRegistry netCfgService; | 85 | protected NetworkConfigRegistry netCfgService; |
89 | 86 | ||
90 | // Parsed RADIUS server addresses | 87 | // Parsed RADIUS server addresses |
... | @@ -331,7 +328,7 @@ public class AaaManager { | ... | @@ -331,7 +328,7 @@ public class AaaManager { |
331 | String sessionId = deviceId.toString() + portNumber.toString(); | 328 | String sessionId = deviceId.toString() + portNumber.toString(); |
332 | StateMachine stateMachine = StateMachine.lookupStateMachineBySessionId(sessionId); | 329 | StateMachine stateMachine = StateMachine.lookupStateMachineBySessionId(sessionId); |
333 | if (stateMachine == null) { | 330 | if (stateMachine == null) { |
334 | - stateMachine = new StateMachine(sessionId, voltTenantService); | 331 | + stateMachine = new StateMachine(sessionId); |
335 | } | 332 | } |
336 | 333 | ||
337 | 334 | ... | ... |
... | @@ -23,8 +23,6 @@ import java.util.Map; | ... | @@ -23,8 +23,6 @@ import java.util.Map; |
23 | 23 | ||
24 | import org.onlab.packet.MacAddress; | 24 | import org.onlab.packet.MacAddress; |
25 | import org.onosproject.net.ConnectPoint; | 25 | import org.onosproject.net.ConnectPoint; |
26 | -import org.onosproject.xosintegration.VoltTenant; | ||
27 | -import org.onosproject.xosintegration.VoltTenantService; | ||
28 | import org.slf4j.Logger; | 26 | import org.slf4j.Logger; |
29 | 27 | ||
30 | import com.google.common.collect.Maps; | 28 | import com.google.common.collect.Maps; |
... | @@ -52,7 +50,6 @@ class StateMachine { | ... | @@ -52,7 +50,6 @@ class StateMachine { |
52 | 50 | ||
53 | //map of access identifiers (issued at EAPOL START) | 51 | //map of access identifiers (issued at EAPOL START) |
54 | static BitSet bitSet = new BitSet(); | 52 | static BitSet bitSet = new BitSet(); |
55 | - private final VoltTenantService voltService; | ||
56 | 53 | ||
57 | private int identifier = -1; | 54 | private int identifier = -1; |
58 | private byte challengeIdentifier; | 55 | private byte challengeIdentifier; |
... | @@ -137,12 +134,10 @@ class StateMachine { | ... | @@ -137,12 +134,10 @@ class StateMachine { |
137 | * State Machine Constructor. | 134 | * State Machine Constructor. |
138 | * | 135 | * |
139 | * @param sessionId session Id represented by the switch dpid + port number | 136 | * @param sessionId session Id represented by the switch dpid + port number |
140 | - * @param voltService volt service reference | ||
141 | */ | 137 | */ |
142 | - public StateMachine(String sessionId, VoltTenantService voltService) { | 138 | + public StateMachine(String sessionId) { |
143 | log.info("Creating a new state machine for {}", sessionId); | 139 | log.info("Creating a new state machine for {}", sessionId); |
144 | this.sessionId = sessionId; | 140 | this.sessionId = sessionId; |
145 | - this.voltService = voltService; | ||
146 | sessionIdMap.put(sessionId, this); | 141 | sessionIdMap.put(sessionId, this); |
147 | } | 142 | } |
148 | 143 | ||
... | @@ -387,16 +382,7 @@ class StateMachine { | ... | @@ -387,16 +382,7 @@ class StateMachine { |
387 | //move to the next state | 382 | //move to the next state |
388 | next(TRANSITION_AUTHORIZE_ACCESS); | 383 | next(TRANSITION_AUTHORIZE_ACCESS); |
389 | 384 | ||
390 | - if (voltService != null) { | 385 | + // TODO: put in calls to launch vSG here |
391 | - voltService.addTenant( | ||
392 | - VoltTenant.builder() | ||
393 | - .withHumanReadableName("VCPE-" + this.identifier) | ||
394 | - .withId(this.identifier) | ||
395 | - .withProviderService(1) | ||
396 | - .withServiceSpecificId(String.valueOf(this.identifier)) | ||
397 | - .withPort(this.supplicantConnectpoint) | ||
398 | - .withVlanId(String.valueOf(this.vlanId)).build()); | ||
399 | - } | ||
400 | 386 | ||
401 | deleteIdentifier(); | 387 | deleteIdentifier(); |
402 | } | 388 | } | ... | ... |
... | @@ -34,7 +34,7 @@ public class StateMachineTest { | ... | @@ -34,7 +34,7 @@ public class StateMachineTest { |
34 | System.out.println("Set Up."); | 34 | System.out.println("Set Up."); |
35 | StateMachine.bitSet.clear(); | 35 | StateMachine.bitSet.clear(); |
36 | StateMachine.initializeMaps(); | 36 | StateMachine.initializeMaps(); |
37 | - stateMachine = new StateMachine("session0", null); | 37 | + stateMachine = new StateMachine("session0"); |
38 | } | 38 | } |
39 | 39 | ||
40 | @After | 40 | @After |
... | @@ -233,7 +233,7 @@ public class StateMachineTest { | ... | @@ -233,7 +233,7 @@ public class StateMachineTest { |
233 | 233 | ||
234 | //create 255 others state machines | 234 | //create 255 others state machines |
235 | for (int i = 1; i <= 255; i++) { | 235 | for (int i = 1; i <= 255; i++) { |
236 | - StateMachine sm = new StateMachine("session" + i, null); | 236 | + StateMachine sm = new StateMachine("session" + i); |
237 | sm.start(); | 237 | sm.start(); |
238 | byte id = sm.identifier(); | 238 | byte id = sm.identifier(); |
239 | Assert.assertEquals(i, Byte.toUnsignedInt(id)); | 239 | Assert.assertEquals(i, Byte.toUnsignedInt(id)); |
... | @@ -259,13 +259,13 @@ public class StateMachineTest { | ... | @@ -259,13 +259,13 @@ public class StateMachineTest { |
259 | sm3.authorizeAccess(); | 259 | sm3.authorizeAccess(); |
260 | sm3.logoff(); | 260 | sm3.logoff(); |
261 | 261 | ||
262 | - StateMachine otherSM3 = new StateMachine("session3b", null); | 262 | + StateMachine otherSM3 = new StateMachine("session3b"); |
263 | otherSM3.start(); | 263 | otherSM3.start(); |
264 | otherSM3.requestAccess(); | 264 | otherSM3.requestAccess(); |
265 | byte id3 = otherSM3.identifier(); | 265 | byte id3 = otherSM3.identifier(); |
266 | Assert.assertEquals(3, Byte.toUnsignedInt(id3)); | 266 | Assert.assertEquals(3, Byte.toUnsignedInt(id3)); |
267 | 267 | ||
268 | - StateMachine otherSM247 = new StateMachine("session247b", null); | 268 | + StateMachine otherSM247 = new StateMachine("session247b"); |
269 | otherSM247.start(); | 269 | otherSM247.start(); |
270 | otherSM247.requestAccess(); | 270 | otherSM247.requestAccess(); |
271 | byte id247 = otherSM247.identifier(); | 271 | byte id247 = otherSM247.identifier(); |
... | @@ -285,8 +285,8 @@ public class StateMachineTest { | ... | @@ -285,8 +285,8 @@ public class StateMachineTest { |
285 | StateMachine.lookupStateMachineBySessionId(sessionId2); | 285 | StateMachine.lookupStateMachineBySessionId(sessionId2); |
286 | assertNull(machine2ShouldBeNull); | 286 | assertNull(machine2ShouldBeNull); |
287 | 287 | ||
288 | - StateMachine stateMachine1 = new StateMachine(sessionId1, null); | 288 | + StateMachine stateMachine1 = new StateMachine(sessionId1); |
289 | - StateMachine stateMachine2 = new StateMachine(sessionId2, null); | 289 | + StateMachine stateMachine2 = new StateMachine(sessionId2); |
290 | 290 | ||
291 | assertEquals(stateMachine1, | 291 | assertEquals(stateMachine1, |
292 | StateMachine.lookupStateMachineBySessionId(sessionId1)); | 292 | StateMachine.lookupStateMachineBySessionId(sessionId1)); |
... | @@ -307,9 +307,9 @@ public class StateMachineTest { | ... | @@ -307,9 +307,9 @@ public class StateMachineTest { |
307 | StateMachine.lookupStateMachineById((byte) 2); | 307 | StateMachine.lookupStateMachineById((byte) 2); |
308 | assertNull(machine2ShouldBeNull); | 308 | assertNull(machine2ShouldBeNull); |
309 | 309 | ||
310 | - StateMachine stateMachine1 = new StateMachine(sessionId1, null); | 310 | + StateMachine stateMachine1 = new StateMachine(sessionId1); |
311 | stateMachine1.start(); | 311 | stateMachine1.start(); |
312 | - StateMachine stateMachine2 = new StateMachine(sessionId2, null); | 312 | + StateMachine stateMachine2 = new StateMachine(sessionId2); |
313 | stateMachine2.start(); | 313 | stateMachine2.start(); |
314 | 314 | ||
315 | assertEquals(stateMachine1, | 315 | assertEquals(stateMachine1, | ... | ... |
-
Please register or login to post a comment