2014-06-16 08:13:40 +00:00
|
|
|
#pragma once
|
2010-03-01 20:58:31 +00:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2011-03-22 15:36:13 +00:00
|
|
|
#include <osmocom/core/utils.h>
|
2011-06-26 12:47:16 +00:00
|
|
|
#include <osmocom/core/msgb.h>
|
2011-03-22 15:36:13 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_08_58.h>
|
2010-03-01 20:58:31 +00:00
|
|
|
|
2011-08-17 16:52:30 +00:00
|
|
|
/*! \defgroup rsl RSL
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*! \file rsl.h */
|
|
|
|
|
2010-03-01 20:58:31 +00:00
|
|
|
void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type);
|
|
|
|
|
2010-07-13 11:48:13 +00:00
|
|
|
void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type);
|
|
|
|
|
2010-03-01 20:58:31 +00:00
|
|
|
extern const struct tlv_definition rsl_att_tlvdef;
|
2011-08-17 16:52:30 +00:00
|
|
|
|
|
|
|
/*! \brief Parse RSL TLV structure using \ref tlv_parse */
|
2010-03-01 20:58:31 +00:00
|
|
|
#define rsl_tlv_parse(dec, buf, len) \
|
|
|
|
tlv_parse(dec, &rsl_att_tlvdef, buf, len, 0, 0)
|
|
|
|
|
2015-12-13 10:56:36 +00:00
|
|
|
extern const struct tlv_definition rsl_ipac_eie_tlvdef;
|
|
|
|
|
|
|
|
/*! \brief Parse RSL IPAC EIE TLV structure using \ref tlv_parse */
|
|
|
|
#define rsl_ipac_eie_tlv_parse(dec, buf, len) \
|
|
|
|
tlv_parse(dec, &rsl_ipac_eie_tlvdef, buf, len, 0, 0)
|
|
|
|
|
2010-03-01 20:58:31 +00:00
|
|
|
/* encode channel number as per Section 9.3.1 */
|
|
|
|
uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot);
|
2010-03-04 13:27:48 +00:00
|
|
|
/* decode channel number as per Section 9.3.1 */
|
|
|
|
int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *timeslot);
|
2010-07-25 10:25:17 +00:00
|
|
|
/* Turns channel number into a string */
|
|
|
|
const char *rsl_chan_nr_str(uint8_t chan_nr);
|
|
|
|
|
2010-03-01 20:58:31 +00:00
|
|
|
|
|
|
|
const char *rsl_err_name(uint8_t err);
|
2010-03-25 04:11:38 +00:00
|
|
|
const char *rsl_rlm_cause_name(uint8_t err);
|
2011-06-23 18:43:13 +00:00
|
|
|
const char *rsl_msg_name(uint8_t err);
|
2011-09-02 10:26:50 +00:00
|
|
|
const char *rsl_ipac_msg_name(uint8_t msg_type);
|
2016-06-06 16:10:38 +00:00
|
|
|
const char *rsl_or_ipac_msg_name(uint8_t msg_type);
|
2010-03-01 20:58:31 +00:00
|
|
|
|
|
|
|
/* Section 3.3.2.3 TS 05.02. I think this looks like a table */
|
|
|
|
int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
|
|
|
|
|
2010-07-13 11:48:13 +00:00
|
|
|
/* Push a RSL RLL header */
|
|
|
|
void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
|
|
|
|
uint8_t link_id, int transparent);
|
|
|
|
|
2010-03-02 20:59:20 +00:00
|
|
|
/* Push a RSL RLL header with L3_INFO IE */
|
2010-03-04 09:32:09 +00:00
|
|
|
void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
|
|
|
|
uint8_t link_id, int transparent);
|
2010-03-02 20:59:20 +00:00
|
|
|
|
|
|
|
/* Allocate msgb and fill with simple RSL RLL header */
|
|
|
|
struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr,
|
2010-03-04 09:32:09 +00:00
|
|
|
uint8_t link_id, int transparent);
|
2011-08-17 16:52:30 +00:00
|
|
|
|
2016-07-18 21:54:01 +00:00
|
|
|
extern const struct value_string rsl_act_type_names[];
|
|
|
|
|
|
|
|
/*! \brief Return a human readable name for GSM 08.58 RSL_ACT_* constants. */
|
|
|
|
static inline const char *rsl_act_type_name(uint8_t act_type)
|
|
|
|
{
|
|
|
|
return get_value_string(rsl_act_type_names, act_type);
|
|
|
|
}
|
|
|
|
|
2012-04-18 19:53:23 +00:00
|
|
|
/*! @} */
|