Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 1 | #pragma once |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 2 | |
| 3 | #include <stdint.h> |
Pablo Neira Ayuso | 8341934 | 2011-03-22 16:36:13 +0100 | [diff] [blame] | 4 | #include <osmocom/core/utils.h> |
Harald Welte | ea19c97 | 2011-06-26 14:47:16 +0200 | [diff] [blame] | 5 | #include <osmocom/core/msgb.h> |
Pablo Neira Ayuso | 8341934 | 2011-03-22 16:36:13 +0100 | [diff] [blame] | 6 | #include <osmocom/gsm/protocol/gsm_08_58.h> |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 7 | |
Harald Welte | e881b1b | 2011-08-17 18:52:30 +0200 | [diff] [blame] | 8 | /*! \defgroup rsl RSL |
| 9 | * @{ |
| 10 | */ |
| 11 | |
| 12 | /*! \file rsl.h */ |
| 13 | |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 14 | void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type); |
| 15 | |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 16 | void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type); |
| 17 | |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 18 | extern const struct tlv_definition rsl_att_tlvdef; |
Harald Welte | e881b1b | 2011-08-17 18:52:30 +0200 | [diff] [blame] | 19 | |
| 20 | /*! \brief Parse RSL TLV structure using \ref tlv_parse */ |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 21 | #define rsl_tlv_parse(dec, buf, len) \ |
| 22 | tlv_parse(dec, &rsl_att_tlvdef, buf, len, 0, 0) |
| 23 | |
| 24 | /* encode channel number as per Section 9.3.1 */ |
| 25 | uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot); |
Harald Welte | ecf9dd0 | 2010-03-04 14:27:48 +0100 | [diff] [blame] | 26 | /* decode channel number as per Section 9.3.1 */ |
| 27 | int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *timeslot); |
Sylvain Munaut | 27af075 | 2010-07-25 12:25:17 +0200 | [diff] [blame] | 28 | /* Turns channel number into a string */ |
| 29 | const char *rsl_chan_nr_str(uint8_t chan_nr); |
| 30 | |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 31 | |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 32 | const char *rsl_err_name(uint8_t err); |
Harald Welte | 52b4abd | 2010-03-25 12:11:38 +0800 | [diff] [blame] | 33 | const char *rsl_rlm_cause_name(uint8_t err); |
Harald Welte | cf7e5da | 2011-06-23 20:43:13 +0200 | [diff] [blame] | 34 | const char *rsl_msg_name(uint8_t err); |
Harald Welte | a24026a | 2011-09-02 12:26:50 +0200 | [diff] [blame] | 35 | const char *rsl_ipac_msg_name(uint8_t msg_type); |
Harald Welte | d284cd9 | 2010-03-01 21:58:31 +0100 | [diff] [blame] | 36 | |
| 37 | /* Section 3.3.2.3 TS 05.02. I think this looks like a table */ |
| 38 | int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); |
| 39 | |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 40 | /* Push a RSL RLL header */ |
| 41 | void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, |
| 42 | uint8_t link_id, int transparent); |
| 43 | |
Harald Welte | f08eabf | 2010-03-02 21:59:20 +0100 | [diff] [blame] | 44 | /* Push a RSL RLL header with L3_INFO IE */ |
Harald Welte | eb8bf39 | 2010-03-04 10:32:09 +0100 | [diff] [blame] | 45 | void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, |
| 46 | uint8_t link_id, int transparent); |
Harald Welte | f08eabf | 2010-03-02 21:59:20 +0100 | [diff] [blame] | 47 | |
| 48 | /* Allocate msgb and fill with simple RSL RLL header */ |
| 49 | struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr, |
Harald Welte | eb8bf39 | 2010-03-04 10:32:09 +0100 | [diff] [blame] | 50 | uint8_t link_id, int transparent); |
Harald Welte | e881b1b | 2011-08-17 18:52:30 +0200 | [diff] [blame] | 51 | |
Sylvain Munaut | dca7d2c | 2012-04-18 21:53:23 +0200 | [diff] [blame] | 52 | /*! @} */ |