From 30381dbf4bd45b62a8a11100ea60c121a966a73a Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 16 Aug 2011 13:03:35 +0200 Subject: need to clean up git --- README | 1 - Src/PyCatcher/.project | 17 +++ Src/PyCatcher/.pydevproject | 10 ++ Src/PyCatcher/GUI/mainWindow.glade | 149 +++++++++++++++++++++ Src/PyCatcher/src/driverConnector.py | 26 ++++ Src/PyCatcher/src/driverConnector.pyc | Bin 0 -> 1668 bytes Src/PyCatcher/src/main.py | 10 ++ Src/PyCatcher/src/model.pyc | Bin 0 -> 715 bytes Src/PyCatcher/src/pyCatcherController.py | 23 ++++ Src/PyCatcher/src/pyCatcherController.pyc | Bin 0 -> 1621 bytes Src/PyCatcher/src/pyCatcherModel.py | 35 +++++ Src/PyCatcher/src/pyCatcherModel.pyc | Bin 0 -> 1995 bytes Src/PyCatcher/src/pyCatcherView.py | 39 ++++++ Src/PyCatcher/src/pyCatcherView.pyc | Bin 0 -> 1883 bytes .../src/host/layer23/src/misc/app_cell_log.c | 3 +- 15 files changed, 311 insertions(+), 2 deletions(-) delete mode 100644 README create mode 100644 Src/PyCatcher/.project create mode 100644 Src/PyCatcher/.pydevproject create mode 100644 Src/PyCatcher/GUI/mainWindow.glade create mode 100644 Src/PyCatcher/src/driverConnector.py create mode 100644 Src/PyCatcher/src/driverConnector.pyc create mode 100644 Src/PyCatcher/src/main.py create mode 100644 Src/PyCatcher/src/model.pyc create mode 100644 Src/PyCatcher/src/pyCatcherController.py create mode 100644 Src/PyCatcher/src/pyCatcherController.pyc create mode 100644 Src/PyCatcher/src/pyCatcherModel.py create mode 100644 Src/PyCatcher/src/pyCatcherModel.pyc create mode 100644 Src/PyCatcher/src/pyCatcherView.py create mode 100644 Src/PyCatcher/src/pyCatcherView.pyc diff --git a/README b/README deleted file mode 100644 index 3f8c891..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -Masterarbeit zu IMSI Catcher Detection diff --git a/Src/PyCatcher/.project b/Src/PyCatcher/.project new file mode 100644 index 0000000..e2975d0 --- /dev/null +++ b/Src/PyCatcher/.project @@ -0,0 +1,17 @@ + + + PyCatcher + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/Src/PyCatcher/.pydevproject b/Src/PyCatcher/.pydevproject new file mode 100644 index 0000000..5662323 --- /dev/null +++ b/Src/PyCatcher/.pydevproject @@ -0,0 +1,10 @@ + + + + +Default +python 2.7 + +/PyCatcher/src + + diff --git a/Src/PyCatcher/GUI/mainWindow.glade b/Src/PyCatcher/GUI/mainWindow.glade new file mode 100644 index 0000000..4ccaf4d --- /dev/null +++ b/Src/PyCatcher/GUI/mainWindow.glade @@ -0,0 +1,149 @@ + + + + + + True + False + PyCatcher Prototype + 800 + 600 + + + + True + False + + + True + False + + + True + False + False + toggle scanning + True + network-wireless + + + + False + True + + + + + False + True + 0 + + + + + True + False + + + True + True + automatic + automatic + + + True + False + + + True + False + gtk-missing-image + + + + + + + True + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + False + + + True + True + + + True + True + 0 + + + + + True + False + + + False + True + 1 + + + + + True + True + + + True + True + 2 + + + + + True + True + 2 + + + + + True + True + 1 + + + + + True + False + 2 + + + False + True + 2 + + + + + + diff --git a/Src/PyCatcher/src/driverConnector.py b/Src/PyCatcher/src/driverConnector.py new file mode 100644 index 0000000..d7509e6 --- /dev/null +++ b/Src/PyCatcher/src/driverConnector.py @@ -0,0 +1,26 @@ +from pyCatcherModel import BaseStationInformation +import subprocess +import threading + +class DriverConnector: + def __init__ (self, bs_found_callback): + self._thread_break = False + self._bs_found_callback = bs_found_callback + pass + + def start_scanning (self): + self._thread_break = False + threading.Thread(target= self._do_scan).start() + + def _do_scan(self): + #TODO: insert right command here + ps_object = subprocess.Popen('ps', stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + while not self._thread_break: + base_station_info = BaseStationInformation() + base_station_info.parse_file(ps_object.stdout) + self._bs_found_callback(base_station_info) + ps_object.kill() + + def stop_scanning (self): + self._thread_break = True + \ No newline at end of file diff --git a/Src/PyCatcher/src/driverConnector.pyc b/Src/PyCatcher/src/driverConnector.pyc new file mode 100644 index 0000000..ed713a0 Binary files /dev/null and b/Src/PyCatcher/src/driverConnector.pyc differ diff --git a/Src/PyCatcher/src/main.py b/Src/PyCatcher/src/main.py new file mode 100644 index 0000000..50f3d86 --- /dev/null +++ b/Src/PyCatcher/src/main.py @@ -0,0 +1,10 @@ +from pyCatcherController import PyCatcherController +import time +from pyCatcherView import PyCatcherGUI +import gtk #@UnresolvedImport + +def main (): + controller = PyCatcherController() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/Src/PyCatcher/src/model.pyc b/Src/PyCatcher/src/model.pyc new file mode 100644 index 0000000..3b1da01 Binary files /dev/null and b/Src/PyCatcher/src/model.pyc differ diff --git a/Src/PyCatcher/src/pyCatcherController.py b/Src/PyCatcher/src/pyCatcherController.py new file mode 100644 index 0000000..06d8c8e --- /dev/null +++ b/Src/PyCatcher/src/pyCatcherController.py @@ -0,0 +1,23 @@ +import sys +import pygtk +import gtk #@UnresolvedImport +import gtk.glade #@UnresolvedImport +from driverConnector import DriverConnector +from pyCatcherModel import BaseStationInformation +from pyCatcherView import PyCatcherGUI + +class PyCatcherController: + def __init__(self): + self.gui = PyCatcherGUI(self) + gtk.main() + self.driver_connector = DriverConnector(self._foundBaseStationCallback) + + def start_scan(self): + self.driver_connector.start_scanning() + + def stop_scan(self): + self.driver_connector.stop_scanning() + + def _foundBaseStationCallback(self): + print "found a station" + \ No newline at end of file diff --git a/Src/PyCatcher/src/pyCatcherController.pyc b/Src/PyCatcher/src/pyCatcherController.pyc new file mode 100644 index 0000000..5d9522a Binary files /dev/null and b/Src/PyCatcher/src/pyCatcherController.pyc differ diff --git a/Src/PyCatcher/src/pyCatcherModel.py b/Src/PyCatcher/src/pyCatcherModel.py new file mode 100644 index 0000000..7ece9b6 --- /dev/null +++ b/Src/PyCatcher/src/pyCatcherModel.py @@ -0,0 +1,35 @@ +class BaseStationInformation: + def __init__ (self): + self.arcfn = 0 + self.bsic = 0 + self.rxlev = 0 + self.s1 = [] + self.s2 = [] + self.s2bis = [] + self.s2ter = [] + self.s3 = [] + self.s4 = [] + self.neighbours = [] + + def parse_file(self, fileobject): + self.arcfn = fileobject.readline() + self.bsic = fileobject.readline() + self.rxlev = fileobject.readline() + self.s1 = fileobject.readline().split(' ') + self.s2 = fileobject.readline().split(' ') + self.s2bis = fileobject.readline().split(' ') + self.s2ter = fileobject.readline().split(' ') + self.s3 = fileobject.readline().split(' ') + self.s4 = fileobject.readline().split(' ') + return self + + def __str__ (self): + return 'foo' + self.arcfn + +class BaseStationInformationList: + def __init__(self): + self.base_station_list + + def add_station(self): + pass + \ No newline at end of file diff --git a/Src/PyCatcher/src/pyCatcherModel.pyc b/Src/PyCatcher/src/pyCatcherModel.pyc new file mode 100644 index 0000000..4a0570d Binary files /dev/null and b/Src/PyCatcher/src/pyCatcherModel.pyc differ diff --git a/Src/PyCatcher/src/pyCatcherView.py b/Src/PyCatcher/src/pyCatcherView.py new file mode 100644 index 0000000..de71727 --- /dev/null +++ b/Src/PyCatcher/src/pyCatcherView.py @@ -0,0 +1,39 @@ +import sys +import pygtk +import gtk #@UnresolvedImport +import gtk.glade #@UnresolvedImport + +class PyCatcherGUI: + + def __init__(self, catcher_controller): + self.scan_toggled_on = False + self.catcher_controller = catcher_controller + + self.w_tree = gtk.glade.XML("../GUI/mainWindow.glade") + self.main_window = self.w_tree.get_widget("main_window") + signals = {"on_main_window_destroy": gtk.main_quit, + "on_scan_toggle_toggled": self._toggle_scan + } + self.w_tree.signal_autoconnect(signals) + + self.bs_view = self.w_tree.get_widget("bs_table") + self._add_column("foo", 0) + self._add_column("bar", 1) + + + def _add_column(self, name, index): + column = gtk.TreeViewColumn(name, gtk.CellRendererText(), text=index) + column.set_resizable(True) + column.set_sort_column_id(index) + self.bs_view.append_column(column) + + def _toggle_scan (self, widget): + if(not self.scan_toggled_on): + print "toggle on" + self.catcher_controller.start_scan() + self.scan_toggled_on = True + else: + print "toggle off" + self.catcher_controller.stop_scan() + self.scan_toggled_on = False + \ No newline at end of file diff --git a/Src/PyCatcher/src/pyCatcherView.pyc b/Src/PyCatcher/src/pyCatcherView.pyc new file mode 100644 index 0000000..d30d8e0 Binary files /dev/null and b/Src/PyCatcher/src/pyCatcherView.pyc differ diff --git a/Src/osmocom-bb/src/host/layer23/src/misc/app_cell_log.c b/Src/osmocom-bb/src/host/layer23/src/misc/app_cell_log.c index 22ed021..0def20d 100644 --- a/Src/osmocom-bb/src/host/layer23/src/misc/app_cell_log.c +++ b/Src/osmocom-bb/src/host/layer23/src/misc/app_cell_log.c @@ -38,7 +38,8 @@ extern struct log_target *stderr_target; extern void *l23_ctx; -char *logname = "/var/log/osmocom.log"; +//HACK: /var/log/osmocom.log, - for putting everything to stdout +char *logname = "-"; int RACH_MAX = 2; int _scan_work(struct osmocom_ms *ms) -- cgit v1.2.3-55-g7522