aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Luebbe <jluebbe@lasnet.de>2008-12-27 01:07:07 +0000
committerJan Luebbe <jluebbe@lasnet.de>2008-12-27 01:07:07 +0000
commitfaaa49ca5136bc805b26240e783a09115b8ce075 (patch)
tree05020ef271e9b2f8b460397a4306d56aa69d87c0 /src
parent5b6cfaf93348d492ef0a01e2935b7285d5981de2 (diff)
db: add GPL headers and integrate with autofoo
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am5
-rw-r--r--src/db.c21
-rw-r--r--src/db.h23
-rw-r--r--src/db_test.c21
4 files changed, 44 insertions, 26 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 868ac7b2e..bf55f2656 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,10 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS=-Wall
-sbin_PROGRAMS = bsc_hack
+sbin_PROGRAMS = bsc_hack db_test
bsc_hack_SOURCES = bsc_hack.c misdn.c abis_rsl.c abis_nm.c gsm_04_08.c gsm_data.c \
gsm_subscriber.c msgb.c select.c chan_alloc.c
+
+db_test_SOURCES = db_test.c db.c
+db_test_LDADD = -ldl -ldbi
diff --git a/src/db.c b/src/db.c
index 904281ae9..1c412c2f2 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1,4 +1,23 @@
-#include "db.h"
+/* (C) 2008 by Jan Luebbe <jluebbe@debian.org>
+ * All Rights Reserved
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <openbsc/db.h>
#include <stdio.h>
#include <dbi/dbi.h>
diff --git a/src/db.h b/src/db.h
deleted file mode 100644
index edf1655c6..000000000
--- a/src/db.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdint.h>
-
-#define NUMBER_LENGTH 32
-
-typedef struct {
- uint64_t imsi;
- uint64_t tmsi;
- char number[NUMBER_LENGTH];
- uint16_t lac;
-} db_subscriber;
-
-int db_init();
-int db_prepare();
-int db_fini();
-
-int db_insert_imei(uint64_t imei);
-
-int db_insert_imsi(uint64_t imsi);
-int db_imsi_set_tmsi(uint64_t imsi, uint64_t tmsi);
-int db_imsi_set_lac(uint64_t imsi, uint16_t lac);
-int db_imsi_get_subscriber(uint64_t imsi, db_subscriber* subscriber);
-int db_tmsi_get_subscriber(uint64_t tmsi, db_subscriber* subscriber);
-
diff --git a/src/db_test.c b/src/db_test.c
index 82dde494c..ebfae2f5d 100644
--- a/src/db_test.c
+++ b/src/db_test.c
@@ -1,4 +1,23 @@
-#include "db.h"
+/* (C) 2008 by Jan Luebbe <jluebbe@debian.org>
+ * All Rights Reserved
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#include <openbsc/db.h>
#include <stdio.h>