db: add GPL headers and integrate with autofoo
parent
5b6cfaf933
commit
faaa49ca51
|
@ -1,2 +1,2 @@
|
|||
noinst_HEADERS = abis_nm.h abis_rsl.h debug.h gsm_04_08.h gsm_data.h \
|
||||
noinst_HEADERS = abis_nm.h abis_rsl.h debug.h db.h gsm_04_08.h gsm_data.h \
|
||||
gsm_subscriber.h linuxlist.h msgb.h select.h tlv.h
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/* (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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DB_H
|
||||
#define _DB_H
|
||||
|
||||
#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);
|
||||
|
||||
#endif /* _DB_H */
|
|
@ -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
|
||||
|
|
21
src/db.c
21
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>
|
||||
|
|
23
src/db.h
23
src/db.h
|
@ -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);
|
||||
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue