libosmogsm  1.5.1
Osmocom GSM library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bssmap_le.h
Go to the documentation of this file.
1 
6 /*
7  * (C) 2020 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
8  * All Rights Reserved
9  *
10  * Author: Neels Hofmeyr <neels@hofmeyr.de>
11  *
12  * SPDX-License-Identifier: GPL-2.0+
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27  *
28  */
29 #pragma once
30 
32 
33 struct osmo_bsslap_err;
34 struct osmo_gad_err;
35 
37  int rc;
43  char *logmsg;
44 };
45 
47  int rc;
49  void *dtap_err;
50  char *logmsg;
51 };
52 
53 enum bssmap_le_msgt osmo_bssmap_le_msgt(const uint8_t *data, uint8_t len);
54 
55 extern const struct value_string osmo_bssmap_le_msgt_names[];
56 static inline const char *osmo_bssmap_le_msgt_name(enum bssmap_le_msgt val)
58 
59 extern const struct value_string osmo_bssmap_le_iei_names[];
60 static inline const char *osmo_bssmap_le_iei_name(enum bssmap_le_iei val)
62 
63 int osmo_lcs_cause_enc(struct msgb *msg, const struct lcs_cause_ie *lcs_cause);
65  enum bssmap_le_msgt msgt, enum bssmap_le_iei iei,
66  struct osmo_bssmap_le_err **err, void *err_ctx,
67  const uint8_t *data, uint8_t len);
68 
69 int osmo_bssap_le_pdu_to_str_buf(char *buf, size_t buflen, const struct bssap_le_pdu *bssap_le);
70 char *osmo_bssap_le_pdu_to_str_c(void *ctx, const struct bssap_le_pdu *bssap_le);
71 
72 struct msgb *osmo_bssap_le_enc(const struct bssap_le_pdu *pdu);
73 int osmo_bssap_le_dec(struct bssap_le_pdu *pdu, struct osmo_bssap_le_err **err, void *err_ctx, struct msgb *msg);
74 
75 uint8_t osmo_bssmap_le_ie_enc_location_type(struct msgb *msg, const struct bssmap_le_location_type *location_type);
77  enum bssmap_le_msgt msgt, enum bssmap_le_iei iei,
78  struct osmo_bssmap_le_err **err, void *err_ctx,
79  const uint8_t *elem, uint8_t len);
80 
enum bssmap_le_iei iei
Definition: bssmap_le.h:39
struct osmo_bsslap_err * bsslap_err
Definition: bssmap_le.h:41
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:692
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:182
struct osmo_gad_err * gad_err
Definition: bssmap_le.h:42
const char * get_value_string(const struct value_string *vs, uint32_t val)
Definition: bssmap_le.h:36
int rc
Definition: bssmap_le.h:47
Definition: gsm_49_031.h:204
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:723
bssmap_le_iei
Definition: gsm_49_031.h:82
void * dtap_err
Definition: bssmap_le.h:49
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:281
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
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:436
Definition: gad.h:165
Definition: gsm_49_031.h:145
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:833
uint8_t data[0]
Definition: bssmap_le.h:46
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:58
uint8_t iei
Definition: gsm_08_58.h:528
enum lcs_cause cause
Definition: bssmap_le.h:40
struct osmo_bssmap_le_err * bssmap_le_err
Definition: bssmap_le.h:48
bssmap_le_msgt
Definition: gsm_49_031.h:69
enum bssmap_le_msgt msg_type
Definition: bssmap_le.h:38
uint8_t len
Definition: gsm_04_11.h:466
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:871
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:299
uint8_t msg[0]
Definition: gsm_08_08.h:525
char * logmsg
Definition: bssmap_le.h:43
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:151
const struct value_string osmo_bssmap_le_iei_names[]
Definition: bssmap_le.c:783
Definition: bsslap.h:36
static const char * osmo_bssmap_le_iei_name(enum bssmap_le_iei val)
Definition: bssmap_le.h:60
const struct value_string osmo_bssmap_le_msgt_names[]
Definition: bssmap_le.c:769
static const char * osmo_bssmap_le_msgt_name(enum bssmap_le_msgt val)
Definition: bssmap_le.h:56
int rc
Definition: bssmap_le.h:37
char * logmsg
Definition: bssmap_le.h:50