|
- Method resolution order:
- AgentProtocol
- ConnectedDatagramProtocol
- DatagramProtocol
- AbstractDatagramProtocol
Methods defined here:
- __init__(self, interface=None, port=161, community='public', snmpVersion='v2', agent=None)
- Initialize the SNMPProtocol object
interface -- interface (IP) on which to bind
port -- port for the connection
community -- community to use for SNMP conversations
snmpVersion -- '1' or '2', indicating the supported version,
normally you would want a real-world Agent to use the
highest available version (v2c, at the moment), but for
testing purposes it is occasionally useful to set the
version to v1.
- datagramReceived(self, datagram, address)
- Process a newly received datagram
Converts the message to a pysnmp request
object, then dispatches it to the appropriate
handler(s) based on the requested OIDs, collects
the results and returns them in a response object
XXX Needs to do minimal authentication at least!
- requestType(self, request)
- Retrieve the request-type from the request
- send(self, response, address)
- Send a request (string) to the network
- setAgent(self, agent)
- Set the agent implementation for this protocol
- verifyIdentity(self, request, address)
- Verify that the address and message-community are valid
XXX I believe v3 has proper authentication available.
XXX This *should* be part of the Agent class!
Data and other attributes defined here:
- agent = None
Methods inherited from ConnectedDatagramProtocol:
- connectionFailed(self, failure)
- Called if connecting failed.
Usually this will be due to a DNS lookup failure.
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
|