@Override public OFPortDesc readFrom(ByteBuf bb) throws OFParseError { OFPort portNo = OFPort.read4Bytes(bb); // pad: 4 bytes bb.skipBytes(4); MacAddress hwAddr = MacAddress.read6Bytes(bb); // pad: 2 bytes bb.skipBytes(2); String name = ChannelUtils.readFixedLengthString(bb, 16); Set<OFPortConfig> config = OFPortConfigSerializerVer12.readFrom(bb); Set<OFPortState> state = OFPortStateSerializerVer12.readFrom(bb); Set<OFPortFeatures> curr = OFPortFeaturesSerializerVer12.readFrom(bb); Set<OFPortFeatures> advertised = OFPortFeaturesSerializerVer12.readFrom(bb); Set<OFPortFeatures> supported = OFPortFeaturesSerializerVer12.readFrom(bb); Set<OFPortFeatures> peer = OFPortFeaturesSerializerVer12.readFrom(bb); long currSpeed = U32.f(bb.readInt()); long maxSpeed = U32.f(bb.readInt()); OFPortDescVer12 portDescVer12 = new OFPortDescVer12( portNo, hwAddr, name, config, state, curr, advertised, supported, peer, currSpeed, maxSpeed); if (logger.isTraceEnabled()) logger.trace("readFrom - read={}", portDescVer12); return portDescVer12; }