Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame^] | 1 | /* (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 | |
| 27 | typedef struct { |
| 28 | uint64_t imsi; |
| 29 | uint64_t tmsi; |
| 30 | char number[NUMBER_LENGTH]; |
| 31 | uint16_t lac; |
| 32 | } db_subscriber; |
| 33 | |
| 34 | int db_init(); |
| 35 | int db_prepare(); |
| 36 | int db_fini(); |
| 37 | |
| 38 | int db_insert_imei(uint64_t imei); |
| 39 | |
| 40 | int db_insert_imsi(uint64_t imsi); |
| 41 | int db_imsi_set_tmsi(uint64_t imsi, uint64_t tmsi); |
| 42 | int db_imsi_set_lac(uint64_t imsi, uint16_t lac); |
| 43 | int db_imsi_get_subscriber(uint64_t imsi, db_subscriber* subscriber); |
| 44 | int db_tmsi_get_subscriber(uint64_t tmsi, db_subscriber* subscriber); |
| 45 | |
| 46 | #endif /* _DB_H */ |