blob: ebfae2f5dc4dbce445f15fddb1f3e9a84a0ec53d [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#include <openbsc/db.h>
Jan Luebbe7398eb92008-12-27 00:45:41 +000021
22#include <stdio.h>
23
24int main() {
25
26 if (db_init()) {
27 printf("DB: Failed to init database. Please check the option settings.\n");
28 return 1;
29 }
30 printf("DB: Database initialized.\n");
31
32 if (db_prepare()) {
33 printf("DB: Failed to prepare database.\n");
34 return 1;
35 }
36 printf("DB: Database prepared.\n");
37
38 db_insert_imsi(3243245432351LLU);
39 db_insert_imsi(3243245432352LLU);
40 db_imsi_set_tmsi(3243245432345LLU, 99999999LLU);
41 db_imsi_set_lac(3243245432345LLU, 42);
42
43 db_subscriber alice;
44 db_imsi_get_subscriber(3243245432345LLU, &alice);
45 db_tmsi_get_subscriber(99999999LLU, &alice);
46
47 db_fini();
48
49 return 0;
50}