blob: f2160c1e01a911f18e5420aa926af9b170096fa1 [file] [log] [blame]
Andreas Eversbergcd605f32023-06-21 15:03:37 +02001/* Group Call Register (GCR) */
2/*
3 * (C) 2023 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
4 * All Rights Reserved
5 *
6 * SPDX-License-Identifier: AGPL-3.0+
7 *
8 * Author: Andreas Eversberg
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
19 *
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23#pragma once
24
25/* Group Call Register */
26struct gcr {
27 struct llist_head list;
28 enum trans_type trans_type;
29 char group_id[9];
30 uint16_t timeout;
31 bool mute_talker;
32 struct llist_head bss_list;
33};
34
35struct gcr_bss {
36 struct llist_head list;
37 int pc;
38 struct llist_head cell_list;
39};
40
41struct gcr_cell {
42 struct llist_head list;
43 uint16_t cell_id;
44};
45
46struct gcr_cell *gcr_add_cell(struct gcr_bss *bss, uint16_t cell_id);
47struct gcr_cell *gcr_find_cell(struct gcr_bss *bss, uint16_t cell_id);
48void gcr_rm_cell(struct gcr_bss *bss, uint16_t cell_id);
49struct gcr_bss *gcr_add_bss(struct gcr *gcr, int pc);
50struct gcr_bss *gcr_find_bss(struct gcr *gcr, int pc);
51void gcr_rm_bss(struct gcr *gcr, int pc);
52struct gcr *gcr_create(struct gsm_network *gsmnet, enum trans_type trans_type, const char *group_id);
53void gcr_destroy(struct gcr *gcr);
54struct gcr *gcr_by_group_id(struct gsm_network *gsmnet, enum trans_type trans_type, const char *group_id);
55struct gcr *gcr_by_callref(struct gsm_network *gsmnet, enum trans_type trans_type, uint32_t callref);