class documentation

class IdentServer(basic.LineOnlyReceiver): (source)

View In Hierarchy

The Identification Protocol (a.k.a., "ident", a.k.a., "the Ident Protocol") provides a means to determine the identity of a user of a particular TCP connection. Given a TCP port number pair, it returns a character string which identifies the owner of that connection on the server's system.

Server authors should subclass this class and override the lookup method. The default implementation returns an UNKNOWN-ERROR response for every query.

Method invalid​Query Undocumented
Method line​Received Override this for when each line is received.
Method lookup Lookup user information about the specified address pair.
Method valid​Query Called when a valid query is received to look up and deliver the response.
Method _cb​Lookup Undocumented
Method _eb​Lookup Undocumented

Inherited from LineOnlyReceiver:

Method data​Received Translates bytes into lines, and calls lineReceived.
Method line​Length​Exceeded Called when the maximum line length has been reached. Override if it needs to be dealt with in some special way.
Method send​Line Sends a line to the other end of the connection.
Constant MAX​_LENGTH The maximum length of a line to allow (If a sent line is longer than this, the connection is dropped). Default is 16384.
Class Variable delimiter The line-ending delimiter to use. By default this is b'\r\n'.
Instance Variable _buffer Undocumented

Inherited from Protocol (via LineOnlyReceiver):

Method connection​Lost Called when the connection is shut down.
Method log​Prefix Return a prefix matching the class name, to identify log messages related to this protocol instance.
Class Variable factory Undocumented

Inherited from BaseProtocol (via LineOnlyReceiver, Protocol):

Method connection​Made Called when a connection is made.
Method make​Connection Make a connection to a transport and a server.
Instance Variable connected Undocumented
Instance Variable transport Undocumented
def invalidQuery(self): (source)

Undocumented

def lineReceived(self, line): (source)
Override this for when each line is received.
Parameters
line:bytesThe line which was received with the delimiter removed.
def lookup(self, serverAddress, clientAddress): (source)

Lookup user information about the specified address pair.

Return value should be a two-tuple of system name and username. Acceptable values for the system name may be found online at:

    U{http://www.iana.org/assignments/operating-system-names}

This method may also raise any IdentError subclass (or IdentError itself) to indicate user information will not be provided for the given query.

A Deferred may also be returned.

Parameters
server​AddressA two-tuple representing the server endpoint of the address being queried. The first element is a string holding a dotted-quad IP address. The second element is an integer representing the port.
client​AddressLike serverAddress, but represents the client endpoint of the address being queried.
def validQuery(self, portOnServer, portOnClient): (source)
Called when a valid query is received to look up and deliver the response.
Parameters
port​On​ServerThe server port from the query.
port​On​ClientThe client port from the query.
def _cbLookup(self, result, sport, cport): (source)

Undocumented

def _ebLookup(self, failure, sport, cport): (source)

Undocumented