libosmogsm
0.11.0-dirty
Osmocom GSM library
|
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 00012 void rsl_init_rll_hdr(struct abis_rsl_rll_hdr *dh, uint8_t msg_type); 00013 00014 void rsl_init_cchan_hdr(struct abis_rsl_cchan_hdr *ch, uint8_t msg_type); 00015 00016 extern const struct tlv_definition rsl_att_tlvdef; 00017 00019 #define rsl_tlv_parse(dec, buf, len) \ 00020 tlv_parse(dec, &rsl_att_tlvdef, buf, len, 0, 0) 00021 00022 extern const struct tlv_definition rsl_ipac_eie_tlvdef; 00023 00025 #define rsl_ipac_eie_tlv_parse(dec, buf, len) \ 00026 tlv_parse(dec, &rsl_ipac_eie_tlvdef, buf, len, 0, 0) 00027 00028 /* encode channel number as per Section 9.3.1 */ 00029 uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot); 00030 /* decode channel number as per Section 9.3.1 */ 00031 int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *timeslot); 00032 /* Turns channel number into a string */ 00033 const char *rsl_chan_nr_str(uint8_t chan_nr); 00034 00035 00036 const char *rsl_err_name(uint8_t err); 00037 const char *rsl_rlm_cause_name(uint8_t err); 00038 const char *rsl_msg_name(uint8_t err); 00039 const char *rsl_ipac_msg_name(uint8_t msg_type); 00040 const char *rsl_or_ipac_msg_name(uint8_t msg_type); 00041 00042 /* Section 3.3.2.3 TS 05.02. I think this looks like a table */ 00043 int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); 00044 00045 /* Push a RSL RLL header */ 00046 void rsl_rll_push_hdr(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, 00047 uint8_t link_id, int transparent); 00048 00049 /* Push a RSL RLL header with L3_INFO IE */ 00050 void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, 00051 uint8_t link_id, int transparent); 00052 00053 /* Allocate msgb and fill with simple RSL RLL header */ 00054 struct msgb *rsl_rll_simple(uint8_t msg_type, uint8_t chan_nr, 00055 uint8_t link_id, int transparent); 00056 00057 extern const struct value_string rsl_act_type_names[]; 00058 00060 static inline const char *rsl_act_type_name(uint8_t act_type) 00061 { 00062 return get_value_string(rsl_act_type_names, act_type); 00063 } 00064