| |
- DatagramProtocol(AbstractDatagramProtocol)
-
- SNMPProtocol
class SNMPProtocol(DatagramProtocol) |
|
Base class for SNMP datagram protocol
attributes:
requests -- dictionary holding request-key: df,timer
where request-keys are calculated by our getRequestKey
method, df is the defer for callbacks to the request,
and timer is the timeout timer for the request. |
|
- Method resolution order:
- SNMPProtocol
- DatagramProtocol
- AbstractDatagramProtocol
Methods defined here:
- __init__(self, port=20000)
- Initialize the SNMPProtocol object
port -- port on which we are listening...
- datagramReceived(self, datagram, address)
- Process a newly received datagram
Converts the message to a pysnmp response
object, then dispatches it to the appropriate
callback based on the message ID as determined
by getRequestKey( response, address ).
Passes on the response object itself to the
callback, as the response object is needed for
table download and the like.
- decode(self, message)
- Decode a datagram message
- getRequestKey(self, request, target)
- Get the request key from a request/response
- handleTrap(self, request, address)
- Handle a trap message from an agent
- send(self, request, target)
- Send a request (string) to the network
Methods inherited from DatagramProtocol:
- connectionRefused(self)
- Called due to error from write in connected mode.
Note this is a result of ICMP message generated by *previous*
write.
Methods inherited from AbstractDatagramProtocol:
- __getstate__(self)
- doStart(self)
- Make sure startProtocol is called.
This will be called by makeConnection(), users should not call it.
- doStop(self)
- Make sure stopProtocol is called.
This will be called by the port, users should not call it.
- makeConnection(self, transport)
- Make a connection to a transport and a server.
This sets the 'transport' attribute of this DatagramProtocol, and calls the
doStart() callback.
- startProtocol(self)
- Called when a transport is connected to this protocol.
Will only be called once, even if multiple ports are connected.
- stopProtocol(self)
- Called when the transport is disconnected.
Will only be called once, after all ports are disconnected.
Data and other attributes inherited from AbstractDatagramProtocol:
- noisy = True
- numPorts = 0
- transport = None
| |