public DataStructure createDataStructure() throws DataFormatException { CreateSessionMessage msg = new CreateSessionMessage(); msg.setSessionConfig((SessionConfig)(new SessionConfigTest()).createDataStructure()); return msg; } public DataStructure createStructureToRead() { return new CreateSessionMessage(); }
public DataStructure createStructureToRead() { return new CreateSessionMessage(); } }
@Override protected void doReadMessage(InputStream in, int size) throws I2CPMessageException, IOException { SessionConfig config = new SessionConfig(); try { config.readBytes(in); } catch (DataFormatException dfe) { throw new I2CPMessageException("Unable to load the session configuration", dfe); } setSessionConfig(config); }
SessionConfig in = message.getSessionConfig(); Destination dest = in.getDestination(); if (in.verifySignature()) {
return new CreateLeaseSetMessage(); case CreateSessionMessage.MESSAGE_TYPE: return new CreateSessionMessage(); case DestroySessionMessage.MESSAGE_TYPE: return new DestroySessionMessage();
/** * Send all the messages that a client needs to send to a router to establish * a new session. */ public void connect(I2PSessionImpl session) throws I2PSessionException { updateBandwidth(session); CreateSessionMessage msg = new CreateSessionMessage(); SessionConfig cfg = new SessionConfig(session.getMyDestination()); cfg.setOptions(getRouterOptions(session)); if (session.isOffline()) { cfg.setOfflineSignature(session.getOfflineExpiration(), session.getTransientSigningPublicKey(), session.getOfflineSignature()); } try { cfg.signSessionConfig(session.getPrivateKey()); } catch (DataFormatException dfe) { throw new I2PSessionException("Unable to sign the session config", dfe); } msg.setSessionConfig(cfg); session.sendMessage_unchecked(msg); }