/** * Changes the attribute of this port according to a MODIFY PortStatus. * * @param portstat the virtual port status */ public void applyPortStatus(OVXPortStatus portstat) { if (portstat.getReason() != OFPortReason.OFPPR_MODIFY.getReasonCode()) { return; } OFPhysicalPort psport = portstat.getDesc(); this.config = psport.getConfig(); this.state = psport.getState(); this.peerFeatures = psport.getPeerFeatures(); }
Bandwidth pbw = InventoryServiceHelper.OFPortToBandWidth(port.getPeerFeatures()); if (pbw != null) { PeerBandwidth p = new PeerBandwidth(pbw.getValue());
/** * Instantiates a new port. */ protected Port(final OFPhysicalPort ofPort) { super(); this.portNumber = ofPort.getPortNumber(); this.hardwareAddress = ofPort.getHardwareAddress(); this.name = ofPort.getName(); this.config = ofPort.getConfig(); this.state = ofPort.getState(); this.currentFeatures = ofPort.getCurrentFeatures(); this.advertisedFeatures = ofPort.getAdvertisedFeatures(); this.supportedFeatures = ofPort.getSupportedFeatures(); this.peerFeatures = ofPort.getPeerFeatures(); if (this.hardwareAddress == null) { this.hardwareAddress = new byte[] {(byte) 0xDE, (byte) 0xAD, (byte) 0xBE, (byte) 0xEF, (byte) 0xCA, (byte) 0xFE}; } this.mac = new MACAddress(this.hardwareAddress); this.isEdge = false; this.parentSwitch = null; this.portLink = null; }
/** * Changes the attribute of this port according to a MODIFY PortStatus. * * @param portstat * the port status */ public void applyPortStatus(OVXPortStatus portstat) { if (!portstat.isReason(OFPortReason.OFPPR_MODIFY)) { return; } OFPhysicalPort psport = portstat.getDesc(); this.portNumber = psport.getPortNumber(); this.hardwareAddress = psport.getHardwareAddress(); this.name = psport.getName(); this.config = psport.getConfig(); this.state = psport.getState(); this.currentFeatures = psport.getCurrentFeatures(); this.advertisedFeatures = psport.getAdvertisedFeatures(); this.supportedFeatures = psport.getSupportedFeatures(); this.peerFeatures = psport.getPeerFeatures(); }