/** * Builds list of OFPortOptical ports based on the multi-part circuit ports reply. * * Ensure the optical transport port's signal type is configured correctly. * * @param wPorts OF reply with circuit ports */ private void createOpticalPortList(OFCircuitPortsReply wPorts) { opticalPorts = new ArrayList<>(wPorts.getEntries().size()); for (OFPortOptical p : wPorts.getEntries()) { short signalType; // FIXME: use constants once loxi has full optical extensions if (isOChPort(p.getPortNo().getPortNumber())) { signalType = 5; // OCH port } else { signalType = 2; // OMS port } opticalPorts.add(createOpticalPort(p, signalType)); } }
private void processHandshakeOFExperimenterPortDescRequest( OFCircuitPortsReply sr) { Collection<OFPortOptical> entries = sr.getEntries(); List<OFPortDesc> ofPortDescList = new ArrayList<>(entries.size()); for (OFPortOptical entry : entries) { log.warn("LINC:OE port message {}", entry.toString()); ofPortDescList.add(factory().buildPortDesc(). setPortNo(entry.getPortNo()) .setConfig(entry.getConfig()) .setState(entry.getState()) .setHwAddr(entry.getHwAddr()) .setName(entry.getName()) .build()); } setExperimenterPortDescReply(factory().buildPortDescStatsReply(). setEntries(ofPortDescList).build()); }
/** * Builds list of OFPortOptical ports based on the multi-part circuit ports reply. * * Ensure the optical transport port's signal type is configured correctly. * * @param wPorts OF reply with circuit ports */ private void createOpticalPortList(OFCircuitPortsReply wPorts) { opticalPorts = new ArrayList<>(wPorts.getEntries().size()); for (OFPortOptical p : wPorts.getEntries()) { short signalType; // FIXME: use constants once loxi has full optical extensions if (isOChPort(p.getPortNo())) { signalType = 5; // OCH port } else { signalType = 2; // OMS port } opticalPorts.add(createOpticalPort(p, signalType)); } }
@Override public void processDriverHandshakeMessage(OFMessage m) { if (!startDriverHandshakeCalled) { throw new SwitchDriverSubHandshakeNotStarted(); } if (driverHandshakeComplete.get()) { throw new SwitchDriverSubHandshakeCompleted(m); } switch (m.getType()) { case BARRIER_REPLY: log.debug("OPLK EDFA Received barrier response"); break; case ERROR: log.error("Switch {} Error {}", getStringId(), m); break; case PORT_STATUS: processOFPortStatus((OFCircuitPortStatus) m); break; case STATS_REPLY: OFStatsReply stats = (OFStatsReply) m; if (stats.getStatsType() == OFStatsType.EXPERIMENTER) { log.debug("OPLK EDFA : Received multipart (port desc) reply message {}", m); //OTN Optical extension 1.0 port-desc createOpticalPortList((OFCircuitPortsReply) m); driverHandshakeComplete.set(true); } break; default: log.warn("Received message {} during switch-driver " + "subhandshake from switch {} ... " + "Ignoring message", m, getStringId()); } }
@Override public void processDriverHandshakeMessage(OFMessage m) { if (!startDriverHandshakeCalled) { throw new SwitchDriverSubHandshakeNotStarted(); } if (driverHandshakeComplete.get()) { throw new SwitchDriverSubHandshakeCompleted(m); } switch (m.getType()) { case BARRIER_REPLY: log.debug("OPLK ROADM Received barrier response"); break; case ERROR: log.error("Switch {} Error {}", getStringId(), m); break; case FEATURES_REPLY: break; case FLOW_REMOVED: break; case GET_ASYNC_REPLY: break; case PACKET_IN: break; case PORT_STATUS: processOFPortStatus((OFCircuitPortStatus) m); break; case QUEUE_GET_CONFIG_REPLY: break; case ROLE_REPLY: break; case STATS_REPLY: OFStatsReply stats = (OFStatsReply) m; if (stats.getStatsType() == OFStatsType.EXPERIMENTER) { log.warn("OPLK ROADM : Received multipart (port desc) reply message {}", m); //OTN Optical extension 1.0 port-desc createOpticalPortList((OFCircuitPortsReply) m); driverHandshakeComplete.set(true); } break; default: log.warn("Received message {} during switch-driver " + "subhandshake " + "from switch {} ... " + "Ignoring message", m, getStringId()); } }
@Override public void processDriverHandshakeMessage(OFMessage m) { if (!startDriverHandshakeCalled) { throw new SwitchDriverSubHandshakeNotStarted(); } if (driverHandshakeComplete.get()) { throw new SwitchDriverSubHandshakeCompleted(m); } switch (m.getType()) { case BARRIER_REPLY: if (m.getXid() == barrierXidToWaitFor) { log.debug("LINC-OE Received barrier response"); } break; case ERROR: log.error("Switch {} Error {}", getStringId(), m); break; case FEATURES_REPLY: break; case FLOW_REMOVED: break; case GET_ASYNC_REPLY: break; case PACKET_IN: break; case PORT_STATUS: log.warn("****LINC-OE Port Status {} {}", getStringId(), m); processOFPortStatus((OFCircuitPortStatus) m); break; case QUEUE_GET_CONFIG_REPLY: break; case ROLE_REPLY: break; case STATS_REPLY: OFStatsReply stats = (OFStatsReply) m; if (stats.getStatsType() == OFStatsType.EXPERIMENTER) { log.warn("LINC-OE : Received stats reply message {}", m); createOpticalPortList((OFCircuitPortsReply) m); driverHandshakeComplete.set(true); } break; default: log.warn("Received message {} during switch-driver " + "subhandshake " + "from switch {} ... " + "Ignoring message", m, getStringId()); } }
@Override public void processDriverHandshakeMessage(OFMessage m) { if (!startDriverHandshakeCalled) { throw new SwitchDriverSubHandshakeNotStarted(); } if (driverHandshakeComplete.get()) { throw new SwitchDriverSubHandshakeCompleted(m); } switch (m.getType()) { case BARRIER_REPLY: if (m.getXid() == barrierXidToWaitFor) { log.debug("LINC-OE Received barrier response"); } break; case ERROR: log.error("Switch {} Error {}", getStringId(), m); break; case FEATURES_REPLY: break; case FLOW_REMOVED: break; case GET_ASYNC_REPLY: break; case PACKET_IN: break; case PORT_STATUS: log.warn("****LINC-OE Port Status {} {}", getStringId(), m); processOFPortStatus((OFCircuitPortStatus) m); break; case QUEUE_GET_CONFIG_REPLY: break; case ROLE_REPLY: break; case STATS_REPLY: OFStatsReply stats = (OFStatsReply) m; if (stats.getStatsType() == OFStatsType.EXPERIMENTER) { log.warn("LINC-OE : Received stats reply message {}", m); processHandshakeOFExperimenterPortDescRequest( (OFCircuitPortsReply) m); driverHandshakeComplete.set(true); } break; default: log.warn("Received message {} during switch-driver " + "subhandshake " + "from switch {} ... " + "Ignoring message", m, getStringId()); } }
@Override public void processDriverHandshakeMessage(OFMessage m) { if (!startDriverHandshakeCalled) { throw new SwitchDriverSubHandshakeNotStarted(); } if (driverHandshakeComplete.get()) { throw new SwitchDriverSubHandshakeCompleted(m); } switch (m.getType()) { case BARRIER_REPLY: log.debug("OPLK ROADM Received barrier response"); break; case ERROR: log.error("Switch {} Error {}", getStringId(), m); break; case FEATURES_REPLY: break; case FLOW_REMOVED: break; case GET_ASYNC_REPLY: break; case PACKET_IN: break; case PORT_STATUS: processOFPortStatus((OFCircuitPortStatus) m); break; case QUEUE_GET_CONFIG_REPLY: break; case ROLE_REPLY: break; case STATS_REPLY: OFStatsReply stats = (OFStatsReply) m; if (stats.getStatsType() == OFStatsType.EXPERIMENTER) { log.debug("OPLK ROADM : Received multipart (port desc) reply message {}", m); //OTN Optical extension 1.0 port-desc createOpticalPortList((OFCircuitPortsReply) m); driverHandshakeComplete.set(true); } break; default: log.warn("Received message {} during switch-driver " + "subhandshake from switch {} ... " + "Ignoring message", m, getStringId()); } }
@Override public void processDriverHandshakeMessage(OFMessage m) { if (!startDriverHandshakeCalled) { throw new SwitchDriverSubHandshakeNotStarted(); } if (driverHandshakeComplete.get()) { throw new SwitchDriverSubHandshakeCompleted(m); } switch (m.getType()) { case BARRIER_REPLY: if (m.getXid() == barrierXidToWaitFor) { log.debug("LINC-OE Received barrier response"); } break; case ERROR: log.error("Switch {} Error {}", getStringId(), m); break; case FEATURES_REPLY: break; case FLOW_REMOVED: break; case GET_ASYNC_REPLY: break; case PACKET_IN: break; case PORT_STATUS: log.debug("****LINC-OE Port Status {} {}", getStringId(), m); processOFPortStatus((OFCircuitPortStatus) m); break; case QUEUE_GET_CONFIG_REPLY: break; case ROLE_REPLY: break; case STATS_REPLY: OFStatsReply stats = (OFStatsReply) m; if (stats.getStatsType() == OFStatsType.EXPERIMENTER) { log.debug("LINC-OE : Received stats reply message {}", m); createOpticalPortList((OFCircuitPortsReply) m); driverHandshakeComplete.set(true); } break; default: log.warn("Received message {} during switch-driver " + "subhandshake " + "from switch {} ... " + "Ignoring message", m, getStringId()); } }
/** * Builds list of OFPortOptical ports based on the multi-part circuit ports reply. * Ensure the optical transport port's signal type is configured correctly. * * @param wPorts OF reply with circuit ports */ private void createOpticalPortList(OFCircuitPortsReply wPorts) { opticalPorts = new ArrayList<>(); opticalPorts.addAll(wPorts.getEntries()); }
/** * Builds list of OFPortOptical ports based on the multi-part circuit ports reply. * Ensure the optical transport port's signal type is configured correctly. * * @param wPorts OF reply with circuit ports */ private void createOpticalPortList(OFCircuitPortsReply wPorts) { opticalPorts.addAll(wPorts.getEntries()); }