def __init__(self, netzob, plugin): """Constructor of IpcCapturerController: @type netzob: netzob.NetzobGUI.NetzobGUI @param netzob: the main netzob project. """ view = IpcCapturerView(plugin, self) super(IpcCapturerController, self).__init__(netzob, plugin, view) self.model = IpcCapturer(netzob) self.updateProcessList_cb(None)
class IpcCapturerController(AbstractCapturerController): """IpcCapturerController: A controller linking the IPC capturer and its view in the netzob GUI. """ COLUMN_ID = 0 COLUMN_SELECTED = 1 def __init__(self, netzob, plugin): """Constructor of IpcCapturerController: @type netzob: netzob.NetzobGUI.NetzobGUI @param netzob: the main netzob project. """ super(IpcCapturerController, self).__init__(netzob, plugin) self.netzob = netzob self.model = IpcCapturer(netzob) self.view = IpcCapturerView(plugin, self) self.updateProcessList_cb(None) def updateProcessList_cb(self, button): """updateProcessList_cb: Called when user wants to update the process list """ self.view.processCombo.get_model().clear() for process in self.model.getProcessList(): self.view.processCombo.append_text(process) def updateFlowList_cb(self, button): """updateFlowList_cb: Called when user wants to update the flow list """ self.view.fdStore.clear() processSelected = self.view.processCombo.get_active_text() if processSelected is None or processSelected == "": return self.model.pid = int(processSelected.split()[0]) filter_fs = self.view.fsFilterButton.get_active() filter_net = self.view.networkFilterButton.get_active() filter_proc = self.view.ipcFilterButton.get_active() for fd in self.model.retrieveFDs(filter_fs, filter_net, filter_proc): self.view.fdStore.append(fd) def doReadMessages(self): # Launch packets capturing try: self.model.startSniff(self.callback_readMessage) except NetzobImportException, importEx: if importEx.statusCode == WARNING: self.view.showWarning(importEx.message) else: NetzobErrorMessage(importEx.message)
class IpcCapturerController(AbstractCapturerController): """IpcCapturerController: A controller linking the IPC capturer and its view in the netzob GUI. """ COLUMN_ID = 0 COLUMN_SELECTED = 1 def __init__(self, netzob, plugin): """Constructor of IpcCapturerController: @type netzob: netzob.NetzobGUI.NetzobGUI @param netzob: the main netzob project. """ view = IpcCapturerView(plugin, self) super(IpcCapturerController, self).__init__(netzob, plugin, view) self.model = IpcCapturer(netzob) self.updateProcessList_cb(None) def updateProcessList_cb(self, button): """updateProcessList_cb: Called when user wants to update the process list """ self.view.processCombo.get_model().clear() for process in self.model.getProcessList(): self.view.processCombo.append_text(process) def updateFlowList_cb(self, button): """updateFlowList_cb: Called when user wants to update the flow list """ self.view.fdStore.clear() processSelected = self.view.processCombo.get_active_text() if processSelected is None or processSelected == "": return self.model.pid = int(processSelected.split()[0]) filter_fs = self.view.fsFilterButton.get_active() filter_net = self.view.networkFilterButton.get_active() filter_proc = self.view.ipcFilterButton.get_active() for fd in self.model.retrieveFDs(filter_fs, filter_net, filter_proc): self.view.fdStore.append(fd) def doReadMessages(self): # Launch packets capturing try: self.model.startSniff(self.callback_readMessage) except NetzobImportException, importEx: if importEx.statusCode == WARNING: self.view.showWarning(importEx.message) else: NetzobErrorMessage(importEx.message)