private void updatePhysicalPort(OFPhysicalPort port) { Short portNumber = port.getPortNumber(); physicalPorts.put(portNumber, port); portBandwidth .put(portNumber, port.getCurrentFeatures() & (OFPortFeatures.OFPPF_10MB_FD.getValue() | OFPortFeatures.OFPPF_10MB_HD.getValue() | OFPortFeatures.OFPPF_100MB_FD.getValue() | OFPortFeatures.OFPPF_100MB_HD.getValue() | OFPortFeatures.OFPPF_1GB_FD.getValue() | OFPortFeatures.OFPPF_1GB_HD.getValue() | OFPortFeatures.OFPPF_10GB_FD .getValue())); }
public static Set<Property> OFPortToProps(OFPhysicalPort port) { Set<Property> props = new HashSet<Property>(); Bandwidth bw = InventoryServiceHelper.OFPortToBandWidth(port .getCurrentFeatures()); if (bw != null) { props.add(bw);
/** * 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(); }