Max | 7918f84 | 2018-12-10 10:57:59 +0100 | [diff] [blame] | 1 | /*! \defgroup gsm29205 3GPP TS 29.205 |
| 2 | * @{ |
| 3 | * \file gsm29205.h */ |
| 4 | /* |
| 5 | * (C) 2018 by sysmocom - s.f.m.c. GmbH |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 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 General Public License for more details. |
| 17 | * |
Max | 7918f84 | 2018-12-10 10:57:59 +0100 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include <osmocom/core/msgb.h> |
| 23 | |
| 24 | #include <stdint.h> |
| 25 | |
| 26 | #define OSMO_GCR_MIN_LEN 13 |
| 27 | |
| 28 | /*! Parsed representation of Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1. */ |
| 29 | struct osmo_gcr_parsed { |
| 30 | uint8_t net[5]; /** Network ID, ITU-T Q.1902.3 */ |
| 31 | uint8_t net_len; /** length (3-5 octets) of gsm29205_gcr#net */ |
| 32 | uint16_t node; /** Node ID */ |
| 33 | uint8_t cr[5]; /** Call Reference ID */ |
| 34 | }; |
| 35 | |
Vadim Yanitskiy | 7044d20 | 2021-10-27 15:04:20 +0300 | [diff] [blame] | 36 | uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g); |
| 37 | int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t len); |
Max | 1bec390 | 2019-01-14 19:31:42 +0100 | [diff] [blame] | 38 | bool osmo_gcr_eq(const struct osmo_gcr_parsed *gcr1, const struct osmo_gcr_parsed *gcr2); |