} else if (!isState(OFPortState.OFPPS_LINK_DOWN) && ((p.getState() & OFPortState.OFPPS_LINK_DOWN .getValue()) == 0)) {
features.setPeerOVXPortFeatures(); this.peerFeatures = features.getOVXFeatures(); this.state = OFPortState.OFPPS_LINK_DOWN.getValue(); this.config = OFPortConfig.OFPPC_NO_STP.getValue(); this.isActive = false;
@Override public boolean isPortEnabled(SNMPPhysicalPort port) { if (port == null) { return false; } int portConfig = port.getConfig(); int portState = port.getState(); if ((portConfig & OFPortConfig.OFPPC_PORT_DOWN.getValue()) > 0) { return false; } if ((portState & OFPortState.OFPPS_LINK_DOWN.getValue()) > 0) { return false; } if ((portState & OFPortState.OFPPS_STP_MASK.getValue()) == OFPortState.OFPPS_STP_BLOCK .getValue()) { return false; } return true; }
@Override public boolean isPortEnabled(OFPhysicalPort port) { if (port == null) { return false; } int portConfig = port.getConfig(); int portState = port.getState(); if ((portConfig & OFPortConfig.OFPPC_PORT_DOWN.getValue()) > 0) { return false; } if ((portState & OFPortState.OFPPS_LINK_DOWN.getValue()) > 0) { return false; } if ((portState & OFPortState.OFPPS_STP_MASK.getValue()) == OFPortState.OFPPS_STP_BLOCK.getValue()) { return false; } return true; }
public void tearDown() { if (!this.isActive) { return; } this.isActive = false; this.state = OFPortState.OFPPS_LINK_DOWN.getValue(); this.parentSwitch.generateFeaturesReply(); if (this.parentSwitch.isActive()) { sendStatusMsg(OFPortReason.OFPPR_MODIFY); } if (this.isLink()) { this.getLink().getOutLink().getDstPort().tearDown(); } cleanUpFlowMods(); }
public boolean isState(OFPortState state) { return this.desc.getState() == state.getValue(); }
public void boot() { if (this.isActive) { return; } this.isActive = true; this.state = OFPortState.OFPPS_STP_FORWARD.getValue(); this.parentSwitch.generateFeaturesReply(); if (this.parentSwitch.isActive()) { sendStatusMsg(OFPortReason.OFPPR_MODIFY); } if (this.isLink()) { this.getLink().getOutLink().getDstPort().boot(); } }
public static State OFPortToState(int portState) { State state; if ((OFPortState.OFPPS_LINK_DOWN.getValue() & portState) != 0) state = new State(State.EDGE_DOWN); else state = new State(State.EDGE_UP); return state; }