blob: 2eb045f23c80414bb654aba4074be1504d4c0ba7 [file] [log] [blame]
Harald Welted284cd92010-03-01 21:58:31 +01001#ifndef _OSMOCORE_RSL_H
2#define _OSMOCORE_RSL_H
3
4#include <stdint.h>
Pablo Neira Ayuso83419342011-03-22 16:36:13 +01005#include <osmocom/core/utils.h>
6#include <osmocom/gsm/protocol/gsm_08_58.h>
Harald Welted284cd92010-03-01 21:58:31 +01007
8void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type);
9
Harald Welte6eb7d6c2010-07-13 13:48:13 +020010void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type);
11
Harald Welted284cd92010-03-01 21:58:31 +010012extern const struct tlv_definition rsl_att_tlvdef;
13#define rsl_tlv_parse(dec, buf, len) \
14 tlv_parse(dec, &rsl_att_tlvdef, buf, len, 0, 0)
15
16/* encode channel number as per Section 9.3.1 */
17uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot);
Harald Welteecf9dd02010-03-04 14:27:48 +010018/* decode channel number as per Section 9.3.1 */
19int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *timeslot);
Sylvain Munaut27af0752010-07-25 12:25:17 +020020/* Turns channel number into a string */
21const char *rsl_chan_nr_str(uint8_t chan_nr);
22
Harald Welted284cd92010-03-01 21:58:31 +010023
Harald Welted284cd92010-03-01 21:58:31 +010024const char *rsl_err_name(uint8_t err);
Harald Welte52b4abd2010-03-25 12:11:38 +080025const char *rsl_rlm_cause_name(uint8_t err);
Harald Weltecf7e5da2011-06-23 20:43:13 +020026const char *rsl_msg_name(uint8_t err);
Harald Welted284cd92010-03-01 21:58:31 +010027
28/* Section 3.3.2.3 TS 05.02. I think this looks like a table */
29int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
30
Harald Welte6eb7d6c2010-07-13 13:48:13 +020031/* Push a RSL RLL header */
32void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
33 uint8_t link_id, int transparent);
34
Harald Weltef08eabf2010-03-02 21:59:20 +010035/* Push a RSL RLL header with L3_INFO IE */
Harald Welteeb8bf392010-03-04 10:32:09 +010036void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
37 uint8_t link_id, int transparent);
Harald Weltef08eabf2010-03-02 21:59:20 +010038
39/* Allocate msgb and fill with simple RSL RLL header */
40struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr,
Harald Welteeb8bf392010-03-04 10:32:09 +010041 uint8_t link_id, int transparent);
Harald Welted284cd92010-03-01 21:58:31 +010042#endif /* _OSMOCORE_RSL_H */