db: add GPL headers and integrate with autofoo
diff --git a/src/Makefile.am b/src/Makefile.am
index 868ac7b..bf55f26 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 904281a..1c412c2 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 edf1655..0000000
--- 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 82dde49..ebfae2f 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>