Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 1 | /* (C) 2008 by Jan Luebbe <jluebbe@debian.org> |
Holger Freyther | 12aa50d | 2009-01-01 18:02:05 +0000 | [diff] [blame] | 2 | * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org> |
Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 3 | * All Rights Reserved |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #ifndef _DB_H |
| 22 | #define _DB_H |
| 23 | |
Jan Luebbe | 5c15c85 | 2008-12-27 15:59:25 +0000 | [diff] [blame] | 24 | #include <sys/types.h> |
Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 25 | |
Jan Luebbe | 5c15c85 | 2008-12-27 15:59:25 +0000 | [diff] [blame] | 26 | #include <openbsc/gsm_subscriber.h> |
Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 27 | |
Holger Freyther | 12aa50d | 2009-01-01 18:02:05 +0000 | [diff] [blame] | 28 | /* one time initialisation */ |
Holger Freyther | 36650b8 | 2009-04-19 06:35:16 +0000 | [diff] [blame] | 29 | int db_init(const char *name, struct gsm_network *network); |
Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 30 | int db_prepare(); |
| 31 | int db_fini(); |
| 32 | |
Holger Freyther | 12aa50d | 2009-01-01 18:02:05 +0000 | [diff] [blame] | 33 | /* subscriber management */ |
| 34 | struct gsm_subscriber* db_create_subscriber(char *imsi); |
Holger Freyther | ca362a6 | 2009-01-04 21:05:01 +0000 | [diff] [blame] | 35 | struct gsm_subscriber* db_get_subscriber(enum gsm_subscriber_field field, const char *subscr); |
Holger Freyther | 12aa50d | 2009-01-01 18:02:05 +0000 | [diff] [blame] | 36 | int db_sync_subscriber(struct gsm_subscriber* subscriber); |
Jan Luebbe | 5c15c85 | 2008-12-27 15:59:25 +0000 | [diff] [blame] | 37 | int db_subscriber_alloc_tmsi(struct gsm_subscriber* subscriber); |
Holger Freyther | 12aa50d | 2009-01-01 18:02:05 +0000 | [diff] [blame] | 38 | int db_subscriber_assoc_imei(struct gsm_subscriber* subscriber, char *imei); |
Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 39 | |
Harald Welte | 7e310b1 | 2009-03-30 20:56:32 +0000 | [diff] [blame] | 40 | /* SMS store-and-forward */ |
| 41 | int db_sms_store(struct gsm_sms *sms); |
| 42 | struct gsm_sms *db_sms_get_unsent(int min_id); |
| 43 | int db_sms_mark_sent(struct gsm_sms *sms); |
Jan Luebbe | faaa49c | 2008-12-27 01:07:07 +0000 | [diff] [blame] | 44 | #endif /* _DB_H */ |