# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The parent class for all the SSH services. Currently implemented services are ssh-userauth and ssh-connection. Maintainer: Paul Swartz """ from __future__ import division, absolute_import from twisted.python import log class SSHService(log.Logger): name = None # this is the ssh name for the service protocolMessages = {} # these map #'s -> protocol names transport = None # gets set later def serviceStarted(self): """ called when the service is active on the transport. """ def serviceStopped(self): """ called when the service is stopped, either by the connection ending or by another service being started """ def logPrefix(self): return "SSHService %r on %s" % (self.name, self.transport.transport.logPrefix()) def packetReceived(self, messageNum, packet): """ called when we receive a packet on the transport """ #print self.protocolMessages if messageNum in self.protocolMessages: messageType = self.protocolMessages[messageNum] f = getattr(self,'ssh_%s' % messageType[4:], None) if f is not None: return f(packet) log.msg("couldn't handle %r" % messageNum) log.msg(repr(packet)) self.transport.sendUnimplemented()
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 183 B | 0644 |
|
_kex.py | File | 7.49 KB | 0644 |
|
address.py | File | 1.13 KB | 0644 |
|
agent.py | File | 9.46 KB | 0644 |
|
channel.py | File | 9.62 KB | 0644 |
|
common.py | File | 2.12 KB | 0644 |
|
connection.py | File | 25.12 KB | 0644 |
|
factory.py | File | 3.73 KB | 0644 |
|
filetransfer.py | File | 33.53 KB | 0644 |
|
forwarding.py | File | 7.98 KB | 0644 |
|
keys.py | File | 52.35 KB | 0644 |
|
service.py | File | 1.42 KB | 0644 |
|
session.py | File | 10.95 KB | 0644 |
|
sexpy.py | File | 1.03 KB | 0644 |
|
transport.py | File | 70.94 KB | 0644 |
|
userauth.py | File | 26.7 KB | 0644 |
|