blob: 45238cfe6a04be6898dc9aebd8d519321c3b7c3f [file] [log] [blame]
Jacob Erlbeck53670862015-05-12 17:54:33 +02001/* gprs_ms_storage.h
2 *
3 * Copyright (C) 2015 by Sysmocom s.f.m.c. GmbH
4 * Author: Jacob Erlbeck <jerlbeck@sysmocom.de>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Jacob Erlbeck53670862015-05-12 17:54:33 +020015 */
16
17#pragma once
18
19#include "gprs_ms.h"
Jacob Erlbeck0e50ce62015-05-21 16:58:22 +020020#include "tbf.h"
Jacob Erlbeck53670862015-05-12 17:54:33 +020021#include <stdint.h>
22#include <stddef.h>
23
Pau Espin Pedrol2182e622021-01-14 16:48:38 +010024struct gprs_rlcmac_bts;
Jacob Erlbeck17214bb2015-06-02 14:06:12 +020025
Pau Espin Pedrol8abe13c2022-10-21 18:49:48 +020026#ifdef __cplusplus
27extern "C" {
28#endif
29struct GprsMsStorage;
30struct GprsMs *ms_store_get_ms(struct GprsMsStorage *ms_store, uint32_t tlli, uint32_t old_tlli, const char *imsi);
31#ifdef __cplusplus
32}
33#endif
34
35#ifdef __cplusplus
36
Pau Espin Pedrol2182e622021-01-14 16:48:38 +010037struct GprsMsStorage {
Jacob Erlbeck53670862015-05-12 17:54:33 +020038public:
Pau Espin Pedrol2182e622021-01-14 16:48:38 +010039 GprsMsStorage(struct gprs_rlcmac_bts *bts);
Jacob Erlbeck53670862015-05-12 17:54:33 +020040 ~GprsMsStorage();
41
Jacob Erlbeckc362df22016-01-20 22:02:19 +010042 void cleanup();
43
Vadim Yanitskiycb988942020-11-08 13:27:35 +070044 GprsMs *get_ms(uint32_t tlli, uint32_t old_tlli = GSM_RESERVED_TMSI, const char *imsi = NULL) const;
Jacob Erlbeckcb1b4942015-06-19 10:59:58 +020045 GprsMs *create_ms();
Jacob Erlbeck53670862015-05-12 17:54:33 +020046
Pau Espin Pedrolda971ee2020-12-16 15:59:45 +010047 const struct llist_head* ms_list() const {return &m_list;}
Jacob Erlbeck53670862015-05-12 17:54:33 +020048private:
Pau Espin Pedrol2182e622021-01-14 16:48:38 +010049 struct gprs_rlcmac_bts *m_bts;
Pau Espin Pedrolda971ee2020-12-16 15:59:45 +010050 struct llist_head m_list; /* list of struct GprsMs */
Jacob Erlbeck53670862015-05-12 17:54:33 +020051};
Pau Espin Pedrol8abe13c2022-10-21 18:49:48 +020052
53#endif