aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-03-03 18:23:34 +0100
committerpiotr <Piotr Krysik pkrysik@elka.pw.edu.pl>2014-03-03 18:23:34 +0100
commit6629251062b404677b05eb5e43be1c60f1dcd110 (patch)
treec1a626133a9f69388fe73a0eb02a1c27e970fe61 /lib
parent7211ff3e511594abee974c97c305721b6e578ba3 (diff)
corrected .gitignore
Diffstat (limited to 'lib')
-rw-r--r--lib/gsmtap.h72
-rw-r--r--lib/qa_gsm.cc40
-rw-r--r--lib/qa_gsm.h40
-rw-r--r--lib/qa_receiver.cc40
-rw-r--r--lib/qa_receiver.h47
5 files changed, 239 insertions, 0 deletions
diff --git a/lib/gsmtap.h b/lib/gsmtap.h
new file mode 100644
index 0000000..bf8226b
--- /dev/null
+++ b/lib/gsmtap.h
@@ -0,0 +1,72 @@
+#ifndef _GSMTAP_H
+#define _GSMTAP_H
+
+/* gsmtap header, pseudo-header in front of the actua GSM payload */
+
+/* GSMTAP is a generic header format for GSM protocol captures,
+ * it uses the IANA-assigned UDP port number 4729 and carries
+ * payload in various formats of GSM interfaces such as Um MAC
+ * blocks or Um bursts.
+ *
+ * Example programs generating GSMTAP data are airprobe
+ * (http://airprobe.org/) or OsmocomBB (http://bb.osmocom.org/)
+ */
+
+#include <stdint.h>
+
+#define GSMTAP_VERSION 0x02
+
+#define GSMTAP_TYPE_UM 0x01 /* A Layer 2 MAC block (23 bytes) */
+#define GSMTAP_TYPE_ABIS 0x02
+#define GSMTAP_TYPE_UM_BURST 0x03 /* raw burst bits */
+
+#define GSMTAP_BURST_UNKNOWN 0x00
+#define GSMTAP_BURST_FCCH 0x01
+#define GSMTAP_BURST_PARTIAL_SCH 0x02
+#define GSMTAP_BURST_SCH 0x03
+#define GSMTAP_BURST_CTS_SCH 0x04
+#define GSMTAP_BURST_COMPACT_SCH 0x05
+#define GSMTAP_BURST_NORMAL 0x06
+#define GSMTAP_BURST_DUMMY 0x07
+#define GSMTAP_BURST_ACCESS 0x08
+#define GSMTAP_BURST_NONE 0x09
+
+#define GSMTAP_CHANNEL_UNKNOWN 0x00
+#define GSMTAP_CHANNEL_BCCH 0x01
+#define GSMTAP_CHANNEL_CCCH 0x02
+#define GSMTAP_CHANNEL_RACH 0x03
+#define GSMTAP_CHANNEL_AGCH 0x04
+#define GSMTAP_CHANNEL_PCH 0x05
+#define GSMTAP_CHANNEL_SDCCH 0x06
+#define GSMTAP_CHANNEL_SDCCH4 0x07
+#define GSMTAP_CHANNEL_SDCCH8 0x08
+#define GSMTAP_CHANNEL_TCH_F 0x09
+#define GSMTAP_CHANNEL_TCH_H 0x0a
+#define GSMTAP_CHANNEL_ACCH 0x80
+
+#define GSMTAP_ARFCN_F_PCS 0x8000
+#define GSMTAP_ARFCN_F_UPLINK 0x4000
+#define GSMTAP_ARFCN_MASK 0x3fff
+
+#define GSMTAP_UDP_PORT 4729 /* officially registered with IANA */
+
+struct gsmtap_hdr {
+ uint8_t version; /* version, set to GSMTAP_VERSION */
+ uint8_t hdr_len; /* length in number of 32bit words */
+ uint8_t type; /* see GSMTAP_TYPE_* */
+ uint8_t timeslot; /* timeslot (0..7 on Um) */
+
+ uint16_t arfcn; /* ARFCN (frequency) */
+ int8_t signal_dbm; /* signal level in dBm */
+ int8_t snr_db; /* signal/noise ratio in dB */
+
+ uint32_t frame_number; /* GSM Frame Number (FN) */
+
+ uint8_t sub_type; /* Type of burst/channel, see above */
+ uint8_t antenna_nr; /* Antenna Number */
+ uint8_t sub_slot; /* sub-slot within timeslot */
+ uint8_t res; /* reserved for future use (RFU) */
+
+} __attribute__((packed));
+
+#endif /* _GSMTAP_H */
diff --git a/lib/qa_gsm.cc b/lib/qa_gsm.cc
new file mode 100644
index 0000000..b84c0ea
--- /dev/null
+++ b/lib/qa_gsm.cc
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/*
+ * This class gathers together all the test cases for the gr-filter
+ * directory into a single test suite. As you create new test cases,
+ * add them here.
+ */
+
+#include "qa_gsm.h"
+#include "qa_receiver.h"
+
+//this is just a stub created by gr_modtool
+
+CppUnit::TestSuite *
+qa_gsm::suite()
+{
+ CppUnit::TestSuite *s = new CppUnit::TestSuite("gsm");
+ s->addTest(gr::gsm::qa_receiver::suite());
+
+ return s;
+}
diff --git a/lib/qa_gsm.h b/lib/qa_gsm.h
new file mode 100644
index 0000000..f5ce6cd
--- /dev/null
+++ b/lib/qa_gsm.h
@@ -0,0 +1,40 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _QA_GSM_H_
+#define _QA_GSM_H_
+
+#include <gnuradio/attributes.h>
+#include <cppunit/TestSuite.h>
+
+//this is just a stub created by gr_modtool
+
+//! collect all the tests for the gr-filter directory
+
+class __GR_ATTR_EXPORT qa_gsm
+{
+ public:
+ //! return suite of tests for all of gr-filter directory
+ static CppUnit::TestSuite *suite();
+};
+
+#endif /* _QA_GSM_H_ */
diff --git a/lib/qa_receiver.cc b/lib/qa_receiver.cc
new file mode 100644
index 0000000..34949dd
--- /dev/null
+++ b/lib/qa_receiver.cc
@@ -0,0 +1,40 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2014 <+YOU OR YOUR COMPANY+>.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#include <gnuradio/attributes.h>
+#include <cppunit/TestAssert.h>
+#include "qa_receiver.h"
+#include <gsm/receiver.h>
+
+//this is just a stub created by gr_modtool
+
+namespace gr {
+ namespace gsm {
+
+ void
+ qa_receiver::t1()
+ {
+ // Put test here
+ }
+
+ } /* namespace gsm */
+} /* namespace gr */
+
diff --git a/lib/qa_receiver.h b/lib/qa_receiver.h
new file mode 100644
index 0000000..085b45f
--- /dev/null
+++ b/lib/qa_receiver.h
@@ -0,0 +1,47 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2014 <+YOU OR YOUR COMPANY+>.
+ *
+ * This is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+//this is just a stub created by gr_modtool
+
+#ifndef _QA_RECEIVER_H_
+#define _QA_RECEIVER_H_
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
+
+namespace gr {
+ namespace gsm {
+
+ class qa_receiver : public CppUnit::TestCase
+ {
+ public:
+ CPPUNIT_TEST_SUITE(qa_receiver);
+ CPPUNIT_TEST(t1);
+ CPPUNIT_TEST_SUITE_END();
+
+ private:
+ void t1();
+ };
+
+ } /* namespace gsm */
+} /* namespace gr */
+
+#endif /* _QA_RECEIVER_H_ */
+