def __init__(self, backend, session_key): self.backend = backend self.session_key = session_key self.secure_client = secure.SecureConnectionClient( backend.secure_client) self.transport = MessageTransport(self) self.resending_transport = ResendingTransport(self.transport) self.nat_protocol = NATTraversalProtocol(self) self.station_protocol = StationProtocol(self) self.mesh_protocol = MeshProtocol(self) self.keep_alive_protocol = KeepAliveProtocol(self) self.unreliable_protocol = UnreliableProtocol(self) self.rtt_protocol = RttProtocol(self) self.protocols = { NATTraversalProtocol.PROTOCOL_ID: self.nat_protocol, StationProtocol.PROTOCOL_ID: self.station_protocol, MeshProtocol.PROTOCOL_ID: self.mesh_protocol, KeepAliveProtocol.PROTOCOL_ID: self.keep_alive_protocol, UnreliableProtocol.PROTOCOL_ID: self.unreliable_protocol, RttProtocol.PROTOCOL_ID: self.rtt_protocol } self.station_mgr = StationMgr(self) self.nat_mgr = NATTraversalMgr(self) self.connection_mgr = ConnectionMgr(self) self.mesh_mgr = MeshMgr(self) self.keep_alive_mgr = KeepAliveMgr(self)
def __init__(self, settings=None): if isinstance(settings, Settings): self.settings = settings.copy() else: self.settings = Settings(settings) self.auth_client = service.RMCClient(self.settings) self.secure_client = service.RMCClient(self.settings) self.auth_proto = authentication.AuthenticationClient(self.auth_client) self.secure_proto = secure.SecureConnectionClient(self.secure_client) if self.settings.get("kerberos.key_derivation") == 0: self.key_derivation = kerberos.KeyDerivationOld(65000, 1024) else: self.key_derivation = kerberos.KeyDerivationNew(1, 1) self.pid = None self.local_station = None self.public_station = None
def __init__(self, access_key, version, settings=None): if settings: self.settings = settings.copy() else: self.settings = Settings() self.settings.set("server.access_key", access_key) self.settings.set("server.version", version) self.auth_client = service.RMCClient(self.settings) self.secure_client = service.RMCClient(self.settings) self.auth_proto = authentication.AuthenticationClient(self.auth_client) self.secure_proto = secure.SecureConnectionClient(self.secure_client) if self.settings.get("kerberos.key_derivation") == 0: self.key_derivation = kerberos.KeyDerivationOld(65000, 1024) else: self.key_derivation = kerberos.KeyDerivationNew(1, 1) self.my_pid = None self.local_station = None self.public_station = None