//---------------------------------------
// Switch 1
// no actual IOFSwitch here because we simply add features reply
// and desc stats to store
OFFeaturesReply fr1a = createOFFeaturesReply();
fr1a.setDatapathId(1L);
OFPhysicalPort p = createOFPhysicalPort("P1", 1);
ImmutablePort sw1p1 = ImmutablePort.fromOFPhysicalPort(p);
List<OFPhysicalPort> ports1a = Collections.singletonList(p);
fr1a.setPorts(ports1a);
List<ImmutablePort> ports1aImmutable =
ImmutablePort.immutablePortListOf(ports1a);
// an alternative featuers reply
OFFeaturesReply fr1b = createOFFeaturesReply();
fr1b.setDatapathId(1L);
p = new OFPhysicalPort();
p = createOFPhysicalPort("P1", 1); // same port as above
List<OFPhysicalPort> ports1b = new ArrayList<OFPhysicalPort>();
ports1b.add(p);
p = createOFPhysicalPort("P2", 42000);
ImmutablePort sw1p2 = ImmutablePort.fromOFPhysicalPort(p);
ports1b.add(p);
fr1b.setPorts(ports1b);
List<ImmutablePort> ports1bImmutable =
ImmutablePort.immutablePortListOf(ports1b);
// Switch 2
// no actual IOFSwitch here because we simply add features reply
// and desc stats to store
OFFeaturesReply fr2a = createOFFeaturesReply();
fr2a.setDatapathId(2L);
ImmutablePort sw2p1 = sw1p1;
List<OFPhysicalPort> ports2a = new ArrayList<OFPhysicalPort>(ports1a);
fr2a.setPorts(ports2a);
List<ImmutablePort> ports2aImmutable =
ImmutablePort.immutablePortListOf(ports2a);
// an alternative features reply
OFFeaturesReply fr2b = createOFFeaturesReply();
fr2b.setDatapathId(2L);
p = new OFPhysicalPort();
p = createOFPhysicalPort("P1", 2); // port number changed
ImmutablePort sw2p1Changed = ImmutablePort.fromOFPhysicalPort(p);
List<OFPhysicalPort> ports2b = Collections.singletonList(p);
fr2b.setPorts(ports2b);
// Switches 3 and 4 are create with default features reply and desc
// so nothing to do here
//---------------------------------------