Package twistedsnmp :: Module snmpprotocol :: Class SNMPProtocol
[show private | hide private]
[frames | no frames]

Class SNMPProtocol

AbstractDatagramProtocol --+    
                           |    
            DatagramProtocol --+
                               |
                              SNMPProtocol

Known Subclasses:
ZenTrap

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 Summary
  __init__(self, port)
Initialize the SNMPProtocol object
  datagramReceived(self, datagram, address)
Process a newly received datagram
  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
Inherited from DatagramProtocol: connectionRefused
Inherited from AbstractDatagramProtocol: __getstate__, doStart, doStop, makeConnection, startProtocol, stopProtocol

Class Variable Summary
Inherited from AbstractDatagramProtocol: noisy, numPorts, transport

Method Details

__init__(self, port=20000)
(Constructor)

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 self.getRequestKey( response, address ).

Passes on the response object itself to the callback, as the response object is needed for table download and the like.
Overrides:
twisted.internet.protocol.AbstractDatagramProtocol.datagramReceived

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

Generated by Epydoc 2.1 on Thu Aug 16 09:55:09 2007 http://epydoc.sf.net