libosmogsm  0.9.3
Osmocom GSM library
include/osmocom/gsm/rsl.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <stdint.h>
00004 #include <osmocom/core/utils.h>
00005 #include <osmocom/core/msgb.h>
00006 #include <osmocom/gsm/protocol/gsm_08_58.h>
00007 
00014 void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type);
00015 
00016 void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type);
00017 
00018 extern const struct tlv_definition rsl_att_tlvdef;
00019 
00021 #define rsl_tlv_parse(dec, buf, len)     \
00022                         tlv_parse(dec, &rsl_att_tlvdef, buf, len, 0, 0)
00023 
00024 /* encode channel number as per Section 9.3.1 */
00025 uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot);
00026 /* decode channel number as per Section 9.3.1 */
00027 int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *timeslot);
00028 /* Turns channel number into a string */
00029 const char *rsl_chan_nr_str(uint8_t chan_nr);
00030 
00031 
00032 const char *rsl_err_name(uint8_t err);
00033 const char *rsl_rlm_cause_name(uint8_t err);
00034 const char *rsl_msg_name(uint8_t err);
00035 const char *rsl_ipac_msg_name(uint8_t msg_type);
00036 
00037 /* Section 3.3.2.3 TS 05.02. I think this looks like a table */
00038 int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf);
00039 
00040 /* Push a RSL RLL header */
00041 void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
00042                       uint8_t link_id, int transparent);
00043 
00044 /* Push a RSL RLL header with L3_INFO IE */
00045 void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr,
00046                      uint8_t link_id, int transparent);
00047 
00048 /* Allocate msgb and fill with simple RSL RLL header */
00049 struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr,
00050                             uint8_t link_id, int transparent);
00051