objects.logic.network.captureInterface.captureInterface Class Reference

Generic interface to some network capturing API. More...

Inherited by objects.logic.network.pcapyImplementation.pcapyImplementation.

List of all members.

Public Member Functions

def __init__
def getDeviceList
 Returns a list of devices.
def queryDevice
 Queries a generic device.
def openDevice
 Opens a generic device.
def closeDevice
 Closes a generic device.
def startListening
 Starts listening to a generic device.
def stopListening
 Stops listening to a generic device.
def notify
 Notifies the "Single" observer of this interface.
def registerNotifyCallBack
 Registers the observer object.
def registerErrorCallBackFunc
 registers a callback function for reporting errors This is done to separate this interface from any object intercepting error from it.

Public Attributes

 notifyCallbackObject
 errorCallBackFunc
 deviceName


Detailed Description

Generic interface to some network capturing API.

Once the interface 'startListening' method is called notification will happen via an single observer which is registered using the 'registerCallBack' method. Note that since Python does not really support interfaces, this is really just an experiment. Note how all functions simply raise a "not implemented" exception.

Definition at line 24 of file captureInterface.py.


Member Function Documentation

def objects.logic.network.captureInterface.captureInterface.__init__ (   self  ) 

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 26 of file captureInterface.py.

00026                       :
00027         self.notifyCallbackObject = None
00028         
00029         # error call back function, should take 1 string parameter
00030         # representing the actual error
00031         self.errorCallBackFunc    = None
00032         self.deviceName           = None
00033             
    ## Returns a list of devices.

def objects.logic.network.captureInterface.captureInterface.closeDevice (   self,
  device 
)

Closes a generic device.

Parameters:
device Generic device object, defined by its implementors

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 49 of file captureInterface.py.

00049                                  : raise exception("not implemented", True)
00050     
00051     

def objects.logic.network.captureInterface.captureInterface.getDeviceList (   self  ) 

Returns a list of devices.

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 35 of file captureInterface.py.

00035                            : raise exception("not implemented", True)
00036     
00037     

def objects.logic.network.captureInterface.captureInterface.notify (   self,
  header,
  data,
  deviceName 
)

Notifies the "Single" observer of this interface.

Parameters:
header Raw DataLink header
data Raw DataLink frame
deviceName Name of the device which received the above data

Definition at line 67 of file captureInterface.py.

00067                                               :
00068         if self.notifyCallbackObject != None:
00069             self.notifyCallbackObject.newPacketNotification(header, data, deviceName)
00070     
00071     
00072     
00073     
    ## Registers the observer object

def objects.logic.network.captureInterface.captureInterface.openDevice (   self,
  device 
)

Opens a generic device.

Parameters:
device Generic device object, defined by its implementors

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 45 of file captureInterface.py.

00045                                 :  raise exception("not implemented", True)
00046     

def objects.logic.network.captureInterface.captureInterface.queryDevice (   self,
  device 
)

Queries a generic device.

Parameters:
device Generic device object, defined by its implementors

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 40 of file captureInterface.py.

00040                                  : raise exception("not implemented", True)
00041     
00042     

def objects.logic.network.captureInterface.captureInterface.registerErrorCallBackFunc (   self,
  callbackFunc 
)

registers a callback function for reporting errors This is done to separate this interface from any object intercepting error from it.

For example the mainFrame object could used here, so that errors are more easily reported back to the user.

Parameters:
callbackFunc Callback Function

Definition at line 85 of file captureInterface.py.

00085                                                      :
00086         self.errorCallBackFunc = callbackFunc
00087     
00088     
00089     
00090     
    

def objects.logic.network.captureInterface.captureInterface.registerNotifyCallBack (   self,
  callbackObject 
)

Registers the observer object.

Parameters:
callbackObject Observer object

Definition at line 76 of file captureInterface.py.

00076                                                     :
00077         self.notifyCallbackObject = callbackObject
00078     
00079     
00080     
    ## registers a callback function for reporting errors

def objects.logic.network.captureInterface.captureInterface.startListening (   self,
  device 
)

Starts listening to a generic device.

Parameters:
device Generic device object, defined by its implementors

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 54 of file captureInterface.py.

00054                                     : raise exception("not implemented", True)
00055     
00056     
00057     

def objects.logic.network.captureInterface.captureInterface.stopListening (   self  ) 

Stops listening to a generic device.

Reimplemented in objects.logic.network.pcapyImplementation.pcapyImplementation.

Definition at line 59 of file captureInterface.py.

00059                            :  raise exception("not implemented", True)
00060     
00061     
00062     


Member Data Documentation

Definition at line 31 of file captureInterface.py.

Definition at line 27 of file captureInterface.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:43 2009 for EyeSpy by  doxygen 1.5.8