Loading...
Searching...
No Matches
bssmap_le.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.
*
*/
#pragma once
#include <osmocom/gsm/protocol/gsm_49_031.h>
struct osmo_bsslap_err;
struct osmo_gad_err;
struct osmo_bssmap_le_err {
int rc;
enum bssmap_le_msgt msg_type;
enum bssmap_le_iei iei;
enum lcs_cause cause;
struct osmo_bsslap_err *bsslap_err;
struct osmo_gad_err *gad_err;
char *logmsg;
};
struct osmo_bssap_le_err {
int rc;
struct osmo_bssmap_le_err *bssmap_le_err;
void *dtap_err;
char *logmsg;
};
enum bssmap_le_msgt osmo_bssmap_le_msgt(const uint8_t *data, uint8_t len);
extern const struct value_string osmo_bssmap_le_msgt_names[];
static inline const char *osmo_bssmap_le_msgt_name(enum bssmap_le_msgt val)
{ return get_value_string(osmo_bssmap_le_msgt_names, val); }
extern const struct value_string osmo_bssmap_le_iei_names[];
static inline const char *osmo_bssmap_le_iei_name(enum bssmap_le_iei val)
{ return get_value_string(osmo_bssmap_le_iei_names, val); }
int osmo_lcs_cause_enc(struct msgb *msg, const struct lcs_cause_ie *lcs_cause);
int osmo_lcs_cause_dec(struct lcs_cause_ie *lcs_cause,
enum bssmap_le_msgt msgt, enum bssmap_le_iei iei,
struct osmo_bssmap_le_err **err, void *err_ctx,
const uint8_t *data, uint8_t len);
int osmo_bssap_le_pdu_to_str_buf(char *buf, size_t buflen, const struct bssap_le_pdu *bssap_le);
char *osmo_bssap_le_pdu_to_str_c(void *ctx, const struct bssap_le_pdu *bssap_le);
struct msgb *osmo_bssap_le_enc(const struct bssap_le_pdu *pdu);
int osmo_bssap_le_dec(struct bssap_le_pdu *pdu, struct osmo_bssap_le_err **err, void *err_ctx, struct msgb *msg);
uint8_t osmo_bssmap_le_ie_enc_location_type(struct msgb *msg, const struct bssmap_le_location_type *location_type);
int osmo_bssmap_le_ie_dec_location_type(struct bssmap_le_location_type *lt,
enum bssmap_le_msgt msgt, enum bssmap_le_iei iei,
struct osmo_bssmap_le_err **err, void *err_ctx,
const uint8_t *elem, uint8_t len);
osmo_bssap_le_enc
struct msgb * osmo_bssap_le_enc(const struct bssap_le_pdu *pdu)
Encode BSSAP-LE PDU returned in new msgb (3GPP TS 49.031).
Definition bssmap_le.c:752
bssmap_le_msgt
bssmap_le_msgt
Definition gsm_49_031.h:82
osmo_bssmap_le_iei_name
static const char * osmo_bssmap_le_iei_name(enum bssmap_le_iei val)
Definition bssmap_le.h:56
bssmap_le_iei
bssmap_le_iei
Definition gsm_49_031.h:95
osmo_bssmap_le_iei_names
const struct value_string osmo_bssmap_le_iei_names[]
Definition bssmap_le.c:843
osmo_lcs_cause_enc
int osmo_lcs_cause_enc(struct msgb *msg, const struct lcs_cause_ie *lcs_cause)
Encode the value part of 3GPP TS 49.031 10.13 LCS Cause, without IEI and len.
Definition bssmap_le.c:328
osmo_bssmap_le_ie_enc_location_type
uint8_t osmo_bssmap_le_ie_enc_location_type(struct msgb *msg, const struct bssmap_le_location_type *location_type)
Encode full BSSMAP-LE Location Type IE, including IEI tag and length.
Definition bssmap_le.c:147
osmo_bssap_le_pdu_to_str_buf
int osmo_bssap_le_pdu_to_str_buf(char *buf, size_t buflen, const struct bssap_le_pdu *bssap_le)
Return a human readable string describing a BSSAP-LE PDU.
Definition bssmap_le.c:893
osmo_bssap_le_dec
int osmo_bssap_le_dec(struct bssap_le_pdu *pdu, struct osmo_bssap_le_err **err, void *err_ctx, struct msgb *msg)
Decode BSSAP-LE PDU (3GPP TS 49.031).
Definition bssmap_le.c:783
osmo_bssmap_le_msgt
enum bssmap_le_msgt osmo_bssmap_le_msgt(const uint8_t *data, uint8_t len)
Return the BSSMAP-LE msg_type from a BSSAP-LE PDU, e.g.
Definition bssmap_le.c:483
osmo_bssmap_le_msgt_name
static const char * osmo_bssmap_le_msgt_name(enum bssmap_le_msgt val)
Definition bssmap_le.h:52
osmo_lcs_cause_dec
int osmo_lcs_cause_dec(struct lcs_cause_ie *lcs_cause, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *data, uint8_t len)
Decode the value part of 3GPP TS 49.031 10.13 LCS Cause, without IEI and len.
Definition bssmap_le.c:346
osmo_bssmap_le_msgt_names
const struct value_string osmo_bssmap_le_msgt_names[]
Definition bssmap_le.c:829
osmo_bssap_le_pdu_to_str_c
char * osmo_bssap_le_pdu_to_str_c(void *ctx, const struct bssap_le_pdu *bssap_le)
Return a human readable string describing a BSSAP-LE PDU.
Definition bssmap_le.c:931
osmo_bssmap_le_ie_dec_location_type
int osmo_bssmap_le_ie_dec_location_type(struct bssmap_le_location_type *lt, enum bssmap_le_msgt msgt, enum bssmap_le_iei iei, struct osmo_bssmap_le_err **err, void *err_ctx, const uint8_t *elem, uint8_t len)
Decode BSSMAP-LE Location Type IE value part.
Definition bssmap_le.c:178
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:36
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
iei
uint8_t iei
Definition gsm_08_58.h:2
gsm_49_031.h
bssap_le_pdu
Definition gsm_49_031.h:225
bssmap_le_location_type
Definition gsm_49_031.h:158
lcs_cause_ie
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:56
msgb
osmo_bssap_le_err
Definition bssmap_le.h:42
osmo_bssap_le_err::dtap_err
void * dtap_err
Definition bssmap_le.h:45
osmo_bssap_le_err::bssmap_le_err
struct osmo_bssmap_le_err * bssmap_le_err
Definition bssmap_le.h:44
osmo_bssap_le_err::logmsg
char * logmsg
Definition bssmap_le.h:46
osmo_bssap_le_err::rc
int rc
Definition bssmap_le.h:43
osmo_bsslap_err
Definition bsslap.h:32
osmo_bssmap_le_err
Definition bssmap_le.h:32
osmo_bssmap_le_err::iei
enum bssmap_le_iei iei
Definition bssmap_le.h:35
osmo_bssmap_le_err::logmsg
char * logmsg
Definition bssmap_le.h:39
osmo_bssmap_le_err::gad_err
struct osmo_gad_err * gad_err
Definition bssmap_le.h:38
osmo_bssmap_le_err::cause
enum lcs_cause cause
Definition bssmap_le.h:36
osmo_bssmap_le_err::msg_type
enum bssmap_le_msgt msg_type
Definition bssmap_le.h:34
osmo_bssmap_le_err::rc
int rc
Definition bssmap_le.h:33
osmo_bssmap_le_err::bsslap_err
struct osmo_bsslap_err * bsslap_err
Definition bssmap_le.h:37
osmo_gad_err
Definition gad.h:165
value_string