gsm29205.h
Go to the documentation of this file.
/*
* (C) 2018 by sysmocom - s.f.m.c. GmbH
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#pragma once
#include <osmocom/core/msgb.h>
#include <stdint.h>
#define OSMO_GCR_MIN_LEN 13
struct osmo_gcr_parsed {
uint8_t net[5];
uint8_t net_len;
uint16_t node;
uint8_t cr[5];
};
uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g);
int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t len);
bool osmo_gcr_eq(const struct osmo_gcr_parsed *gcr1, const struct osmo_gcr_parsed *gcr2);
g
struct osmo_tdef_group * g
osmo_enc_gcr
uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g)
Create Global Call Reference.
Definition: gsm29205.c:44
osmo_gcr_parsed::cr
uint8_t cr[5]
Node ID.
Definition: gsm29205.h:37
osmo_dec_gcr
int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t len)
Decode Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1.
Definition: gsm29205.c:70
osmo_gcr_eq
bool osmo_gcr_eq(const struct osmo_gcr_parsed *gcr1, const struct osmo_gcr_parsed *gcr2)
Compare two GCR structs.
Definition: gsm29205.c:102
osmo_gcr_parsed::net_len
uint8_t net_len
Network ID, ITU-T Q.1902.3.
Definition: gsm29205.h:35
osmo_gcr_parsed::node
uint16_t node
length (3-5 octets) of gsm29205_gcr::net
Definition: gsm29205.h:36
osmo_gcr_parsed::net
uint8_t net[5]
Definition: gsm29205.h:34
len
uint8_t len
Definition: gsm_04_11.h:0
msg
uint8_t msg[0]
Definition: gsm_08_08.h:8
msgb.h
msgb
osmo_gcr_parsed
Parsed representation of Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1.
Definition: gsm29205.h:33