bsslap.h
Go to the documentation of this file.
/*
* (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
* All Rights Reserved
*
* Author: Neels Hofmeyr <neels@hofmeyr.de>
*
* SPDX-License-Identifier: GPL-2.0+
*
* 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/gsm/protocol/gsm_48_071.h>
#include <osmocom/gsm/protocol/gsm_49_031.h>
struct msgb;
struct osmo_bsslap_err {
int rc;
enum bsslap_msgt msg_type;
enum bsslap_iei iei;
enum lcs_cause cause;
char *logmsg;
};
extern const struct value_string osmo_bsslap_msgt_names[];
static inline const char *osmo_bsslap_msgt_name(enum bsslap_msgt val)
{ return get_value_string(osmo_bsslap_msgt_names, val); }
extern const struct value_string osmo_bsslap_iei_names[];
static inline const char *osmo_bsslap_iei_name(enum bsslap_iei val)
{ return get_value_string(osmo_bsslap_iei_names, val); }
int osmo_bsslap_enc(struct msgb *msg, const struct bsslap_pdu *pdu);
int osmo_bsslap_dec(struct bsslap_pdu *pdu,
struct osmo_bsslap_err **err, void *err_ctx,
const uint8_t *data, size_t len);
osmo_bsslap_enc
int osmo_bsslap_enc(struct msgb *msg, const struct bsslap_pdu *pdu)
Encode BSSLAP PDU and append to msgb (3GPP TS 48.071).
Definition: bsslap.c:167
osmo_bsslap_msgt_names
const struct value_string osmo_bsslap_msgt_names[]
Definition: bsslap.c:285
osmo_bsslap_iei_name
static const char * osmo_bsslap_iei_name(enum bsslap_iei val)
Definition: bsslap.h:49
osmo_bsslap_dec
int osmo_bsslap_dec(struct bsslap_pdu *pdu, struct osmo_bsslap_err **err, void *err_ctx, const uint8_t *data, size_t len)
Decode BSSLAP PDU (3GPP TS 48.071).
Definition: bsslap.c:216
osmo_bsslap_msgt_name
static const char * osmo_bsslap_msgt_name(enum bsslap_msgt val)
Definition: bsslap.h:45
osmo_bsslap_iei_names
const struct value_string osmo_bsslap_iei_names[]
Definition: bsslap.c:299
bsslap_msgt
bsslap_msgt
Definition: gsm_48_071.h:32
bsslap_iei
bsslap_iei
Definition: gsm_48_071.h:59
lcs_cause
lcs_cause
3GPP TS 49.031 10.13 LCS Cause, also in 3GPP TS 48.008 3.2.2.66, which simply refers to the former.
Definition: gsm_49_031.h:38
data
uint8_t data[0]
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
len
uint8_t len
Definition: gsm_04_11.h:0
msg
uint8_t msg[0]
Definition: gsm_08_08.h:8
gsm_48_071.h
gsm_49_031.h
bsslap_pdu
Definition: gsm_48_071.h:110
msgb
osmo_bsslap_err
Definition: bsslap.h:36
osmo_bsslap_err::rc
int rc
Definition: bsslap.h:37
osmo_bsslap_err::iei
enum bsslap_iei iei
Definition: bsslap.h:39
osmo_bsslap_err::msg_type
enum bsslap_msgt msg_type
Definition: bsslap.h:38
osmo_bsslap_err::cause
enum lcs_cause cause
Definition: bsslap.h:40
osmo_bsslap_err::logmsg
char * logmsg
Definition: bsslap.h:41
value_string