blob: 56f2e6c8423281a4b2d79d6efc1483f1d7902ba2 [file] [log] [blame]
Neels Hofmeyrc6848f42020-09-18 18:00:50 +02001/*! \addtogroup bsslap
2 * @{
3 * \file bsslap.h
4 * Message encoding and decoding for 3GPP TS 48.071 BSS LCS Assistance Protocol (BSSLAP).
5 */
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 *
Neels Hofmeyrc6848f42020-09-18 18:00:50 +020024 */
25#pragma once
26
27#include <osmocom/gsm/protocol/gsm_48_071.h>
28#include <osmocom/gsm/protocol/gsm_49_031.h>
29
30struct msgb;
31
32struct osmo_bsslap_err {
33 int rc;
34 enum bsslap_msgt msg_type;
35 enum bsslap_iei iei;
36 enum lcs_cause cause;
37 char *logmsg;
38};
39
40extern const struct value_string osmo_bsslap_msgt_names[];
41static inline const char *osmo_bsslap_msgt_name(enum bsslap_msgt val)
42{ return get_value_string(osmo_bsslap_msgt_names, val); }
43
44extern const struct value_string osmo_bsslap_iei_names[];
45static inline const char *osmo_bsslap_iei_name(enum bsslap_iei val)
46{ return get_value_string(osmo_bsslap_iei_names, val); }
47
48int osmo_bsslap_enc(struct msgb *msg, const struct bsslap_pdu *pdu);
49int osmo_bsslap_dec(struct bsslap_pdu *pdu,
50 struct osmo_bsslap_err **err, void *err_ctx,
51 const uint8_t *data, size_t len);
52
53/*! @} */