diff options
author | Jan Luebbe <jluebbe@lasnet.de> | 2008-12-27 01:07:07 +0000 |
---|---|---|
committer | Jan Luebbe <jluebbe@lasnet.de> | 2008-12-27 01:07:07 +0000 |
commit | faaa49ca5136bc805b26240e783a09115b8ce075 (patch) | |
tree | 05020ef271e9b2f8b460397a4306d56aa69d87c0 /include | |
parent | 5b6cfaf93348d492ef0a01e2935b7285d5981de2 (diff) |
db: add GPL headers and integrate with autofoo
Diffstat (limited to 'include')
-rw-r--r-- | include/openbsc/Makefile.am | 2 | ||||
-rw-r--r-- | include/openbsc/db.h | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 73e93309f..a779cb99e 100644 --- a/include/openbsc/Makefile.am +++ b/include/openbsc/Makefile.am @@ -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 diff --git a/include/openbsc/db.h b/include/openbsc/db.h new file mode 100644 index 000000000..9501ec8f3 --- /dev/null +++ b/include/openbsc/db.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 */ |