Andreas Eversberg | cd605f3 | 2023-06-21 15:03:37 +0200 | [diff] [blame] | 1 | /* 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 */ |
| 26 | struct 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 | |
| 35 | struct gcr_bss { |
| 36 | struct llist_head list; |
| 37 | int pc; |
| 38 | struct llist_head cell_list; |
| 39 | }; |
| 40 | |
| 41 | struct gcr_cell { |
| 42 | struct llist_head list; |
| 43 | uint16_t cell_id; |
| 44 | }; |
| 45 | |
| 46 | struct gcr_cell *gcr_add_cell(struct gcr_bss *bss, uint16_t cell_id); |
| 47 | struct gcr_cell *gcr_find_cell(struct gcr_bss *bss, uint16_t cell_id); |
| 48 | void gcr_rm_cell(struct gcr_bss *bss, uint16_t cell_id); |
| 49 | struct gcr_bss *gcr_add_bss(struct gcr *gcr, int pc); |
| 50 | struct gcr_bss *gcr_find_bss(struct gcr *gcr, int pc); |
| 51 | void gcr_rm_bss(struct gcr *gcr, int pc); |
| 52 | struct gcr *gcr_create(struct gsm_network *gsmnet, enum trans_type trans_type, const char *group_id); |
| 53 | void gcr_destroy(struct gcr *gcr); |
| 54 | struct gcr *gcr_by_group_id(struct gsm_network *gsmnet, enum trans_type trans_type, const char *group_id); |
| 55 | struct gcr *gcr_by_callref(struct gsm_network *gsmnet, enum trans_type trans_type, uint32_t callref); |