blob: e02bb6246d38bf7a2c245f60b691706c76f23c9e [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
Jan Luebbe5c15c852008-12-27 15:59:25 +000023#include <sys/types.h>
Jan Luebbefaaa49c2008-12-27 01:07:07 +000024
Jan Luebbe5c15c852008-12-27 15:59:25 +000025#include <openbsc/gsm_subscriber.h>
Jan Luebbefaaa49c2008-12-27 01:07:07 +000026
27int db_init();
28int db_prepare();
29int db_fini();
30
Jan Luebbe5c15c852008-12-27 15:59:25 +000031struct gsm_subscriber* db_create_subscriber(char imsi[GSM_IMSI_LENGTH]);
32int db_get_subscriber(enum gsm_subscriber_field field, struct gsm_subscriber* subscriber);
33int db_set_subscriber(struct gsm_subscriber* subscriber);
34int db_subscriber_alloc_tmsi(struct gsm_subscriber* subscriber);
Jan Luebbefac25fc2008-12-27 18:04:34 +000035int db_subscriber_assoc_imei(struct gsm_subscriber* subscriber, char imei[GSM_IMEI_LENGTH]);
Jan Luebbefaaa49c2008-12-27 01:07:07 +000036
37#endif /* _DB_H */