blob: 58856002a42b8c3fa834479d097f840be6f90031 [file] [log] [blame]
Maxd4bebbd2017-03-02 12:00:19 +01001/* OsmoHLR generic header */
2
3/* (C) 2017 sysmocom s.f.m.c. GmbH <info@sysmocom.de>
4 * All Rights Reserved
5 *
6 * Author: Max Suraev <msuraev@sysmocom.de>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#pragma once
24
25#include <stdbool.h>
Harald Welte4956ae12018-06-15 22:04:28 +020026#include <osmocom/core/linuxlist.h>
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010027#include <osmocom/gsm/ipa.h>
28#include <osmocom/core/tdef.h>
Harald Welte4956ae12018-06-15 22:04:28 +020029
Neels Hofmeyr5857c592019-04-02 04:24:49 +020030#define HLR_DEFAULT_DB_FILE_PATH "hlr.db"
31
Harald Welte4956ae12018-06-15 22:04:28 +020032struct hlr_euse;
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010033struct osmo_gsup_conn;
34enum osmo_gsup_message_type;
35
36extern struct osmo_tdef g_hlr_tdefs[];
Maxd4bebbd2017-03-02 12:00:19 +010037
38struct hlr {
39 /* GSUP server pointer */
40 struct osmo_gsup_server *gs;
41
42 /* DB context */
Neels Hofmeyr5857c592019-04-02 04:24:49 +020043 char *db_file_path;
Maxd4bebbd2017-03-02 12:00:19 +010044 struct db_context *dbc;
Max372868b2017-03-02 12:12:00 +010045
46 /* Control Interface */
47 struct ctrl_handle *ctrl;
48 const char *ctrl_bind_addr;
Pau Espin Pedrolce9bc402017-05-31 13:19:22 +020049
50 /* Local bind addr */
51 char *gsup_bind_addr;
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010052 struct ipaccess_unit gsup_unit_name;
Harald Welte4956ae12018-06-15 22:04:28 +020053
54 struct llist_head euse_list;
55 struct hlr_euse *euse_default;
Harald Weltedab544e2018-07-29 16:14:48 +020056
Vadim Yanitskiyd157a562018-12-01 00:03:39 +070057 /* NCSS (call independent) session guard timeout value */
58 int ncss_guard_timeout;
59
Harald Weltedab544e2018-07-29 16:14:48 +020060 struct llist_head ussd_routes;
Harald Weltebb779392018-06-16 20:21:10 +020061
62 struct llist_head ss_sessions;
Oliver Smith851814a2019-01-11 15:30:21 +010063
64 bool store_imei;
Oliver Smithc7f17872019-03-04 15:10:44 +010065
66 bool subscr_create_on_demand;
67 /* Bitmask of DB_SUBSCR_FLAG_* */
68 uint8_t subscr_create_on_demand_flags;
69 unsigned int subscr_create_on_demand_rand_msisdn_len;
Maxd4bebbd2017-03-02 12:00:19 +010070};
Stefan Sperlingf1622522018-04-09 11:39:16 +020071
Harald Welted5807b82018-07-29 12:27:41 +020072extern struct hlr *g_hlr;
73
Stefan Sperlingf1622522018-04-09 11:39:16 +020074struct hlr_subscriber;
75
76void osmo_hlr_subscriber_update_notify(struct hlr_subscriber *subscr);
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010077int hlr_subscr_nam(struct hlr *hlr, struct hlr_subscriber *subscr, bool nam_val, bool is_ps);