/** * @param features switch feature output * @param seed seed value * @return connection cookie key * @see #createConnectionCookie(BigInteger,short, int) */ public static SwitchConnectionDistinguisher createConnectionCookie( GetFeaturesOutput features, int seed) { return createConnectionCookie(features.getDatapathId(), features.getAuxiliaryId(), seed); }
@Override public void serialize(GetFeaturesOutput message, ByteBuf outBuffer) { ByteBufUtils.writeOFHeader(MESSAGE_TYPE, message, outBuffer, EncodeConstants.EMPTY_LENGTH); outBuffer.writeLong(message.getDatapathId().longValue()); outBuffer.writeInt(message.getBuffers().intValue()); outBuffer.writeByte(message.getTables().intValue()); outBuffer.writeByte(message.getAuxiliaryId().intValue()); outBuffer.writeZero(PADDING); writeCapabilities(message.getCapabilities(), outBuffer); outBuffer.writeInt(message.getReserved().intValue()); ByteBufUtils.updateOFHeaderLength(outBuffer); }
@Override public void onSuccess(RpcResult<GetFeaturesOutput> rpcFeatures) { LOG.trace("features are back"); if (rpcFeatures.isSuccessful()) { GetFeaturesOutput featureOutput = rpcFeatures.getResult(); LOG.debug("obtained features: datapathId={}", featureOutput.getDatapathId()); LOG.debug("obtained features: auxiliaryId={}", featureOutput.getAuxiliaryId()); LOG.trace("handshake SETTLED: version={}, datapathId={}, auxiliaryId={}", version, featureOutput.getDatapathId(), featureOutput.getAuxiliaryId()); handshakeListener.onHandshakeSuccessful(featureOutput, proposedVersion); } else { // handshake failed LOG.warn("issuing disconnect during handshake [{}]", connectionAdapter.getRemoteAddress()); for (RpcError rpcError : rpcFeatures.getErrors()) { LOG.debug("handshake - features failure [{}]: i:{} | m:{} | s:{}", xid, rpcError.getInfo(), rpcError.getMessage(), rpcError.getSeverity(), rpcError.getCause() ); } handshakeListener.onHandshakeFailure(); } LOG.debug("postHandshake DONE"); }
if (features.getAuxiliaryId() == null || features.getAuxiliaryId() == 0) { + dumpDataPathId(features.getDatapathId()) + " | " + features.getAuxiliaryId()); getSessionManager().invalidateAuxiliary(sessionKey, auxiliaryKey);