blob: 9501ec8f3d8a6e641aaf8b82b96b1dc9f7aceecb [file] [log] [blame]
Jan Luebbefaaa49c2008-12-27 01:07:07 +00001/* (C) 2008 by Jan Luebbe <jluebbe@debian.org>
2 * All Rights Reserved
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 */
19
20#ifndef _DB_H
21#define _DB_H
22
23#include <stdint.h>
24
25#define NUMBER_LENGTH 32
26
27typedef struct {
28 uint64_t imsi;
29 uint64_t tmsi;
30 char number[NUMBER_LENGTH];
31 uint16_t lac;
32} db_subscriber;
33
34int db_init();
35int db_prepare();
36int db_fini();
37
38int db_insert_imei(uint64_t imei);
39
40int db_insert_imsi(uint64_t imsi);
41int db_imsi_set_tmsi(uint64_t imsi, uint64_t tmsi);
42int db_imsi_set_lac(uint64_t imsi, uint16_t lac);
43int db_imsi_get_subscriber(uint64_t imsi, db_subscriber* subscriber);
44int db_tmsi_get_subscriber(uint64_t tmsi, db_subscriber* subscriber);
45
46#endif /* _DB_H */