summaryrefslogtreecommitdiffstats
path: root/Src
diff options
context:
space:
mode:
authorTom2011-08-16 13:03:35 +0200
committerTom2011-08-16 13:03:35 +0200
commit30381dbf4bd45b62a8a11100ea60c121a966a73a (patch)
treebdddcc9c7c3c5783b5a7982b35b95c2c5a73f5ba /Src
parentInitial Commit (diff)
downloadimsi-catcher-detection-30381dbf4bd45b62a8a11100ea60c121a966a73a.tar.gz
imsi-catcher-detection-30381dbf4bd45b62a8a11100ea60c121a966a73a.tar.xz
imsi-catcher-detection-30381dbf4bd45b62a8a11100ea60c121a966a73a.zip
need to clean up git
Diffstat (limited to 'Src')
-rw-r--r--Src/PyCatcher/.project17
-rw-r--r--Src/PyCatcher/.pydevproject10
-rw-r--r--Src/PyCatcher/GUI/mainWindow.glade149
-rw-r--r--Src/PyCatcher/src/driverConnector.py26
-rw-r--r--Src/PyCatcher/src/driverConnector.pycbin0 -> 1668 bytes
-rw-r--r--Src/PyCatcher/src/main.py10
-rw-r--r--Src/PyCatcher/src/model.pycbin0 -> 715 bytes
-rw-r--r--Src/PyCatcher/src/pyCatcherController.py23
-rw-r--r--Src/PyCatcher/src/pyCatcherController.pycbin0 -> 1621 bytes
-rw-r--r--Src/PyCatcher/src/pyCatcherModel.py35
-rw-r--r--Src/PyCatcher/src/pyCatcherModel.pycbin0 -> 1995 bytes
-rw-r--r--Src/PyCatcher/src/pyCatcherView.py39
-rw-r--r--Src/PyCatcher/src/pyCatcherView.pycbin0 -> 1883 bytes
-rw-r--r--Src/osmocom-bb/src/host/layer23/src/misc/app_cell_log.c3
14 files changed, 311 insertions, 1 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>PyCatcher</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.python.pydev.PyDevBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.python.pydev.pythonNature</nature>
+ </natures>
+</projectDescription>
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?>
+
+<pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
+<path>/PyCatcher/src</path>
+</pydev_pathproperty>
+</pydev_project>
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.24 -->
+ <!-- interface-naming-policy project-wide -->
+ <widget class="GtkWindow" id="main_window">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">PyCatcher Prototype</property>
+ <property name="default_width">800</property>
+ <property name="default_height">600</property>
+ <signal name="destroy" handler="on_main_window_destroy" swapped="no"/>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkToolbar" id="main_toolbar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkToggleToolButton" id="scan_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="label" translatable="yes">toggle scanning</property>
+ <property name="use_underline">True</property>
+ <property name="icon_name">network-wireless</property>
+ <signal name="toggled" handler="on_scan_toggle_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkImage" id="bs_graph">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-missing-image</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVSeparator" id="vseparator1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkTreeView" id="bs_table">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHSeparator" id="hseparator1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTextView" id="bs_details">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkStatusbar" id="status_bar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
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
--- /dev/null
+++ b/Src/PyCatcher/src/driverConnector.pyc
Binary files 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
--- /dev/null
+++ b/Src/PyCatcher/src/model.pyc
Binary files 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
--- /dev/null
+++ b/Src/PyCatcher/src/pyCatcherController.pyc
Binary files 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
--- /dev/null
+++ b/Src/PyCatcher/src/pyCatcherModel.pyc
Binary files 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
--- /dev/null
+++ b/Src/PyCatcher/src/pyCatcherView.pyc
Binary files 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)