2008-12-23 20:25:15 +00:00
|
|
|
#ifndef _GSM_04_08_H
|
|
|
|
#define _GSM_04_08_H
|
|
|
|
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/gsm/gsm48.h>
|
2011-07-23 08:53:30 +00:00
|
|
|
#include <osmocom/gsm/gsm_utils.h>
|
|
|
|
#include <osmocom/gsm/protocol/gsm_04_08.h>
|
|
|
|
|
|
|
|
#include <openbsc/meas_rep.h>
|
2009-08-01 05:26:59 +00:00
|
|
|
|
2008-12-25 23:28:35 +00:00
|
|
|
struct msgb;
|
|
|
|
struct gsm_bts;
|
2009-06-10 15:11:52 +00:00
|
|
|
struct gsm_network;
|
2009-07-23 19:13:03 +00:00
|
|
|
struct gsm_trans;
|
2010-06-15 05:16:52 +00:00
|
|
|
struct gsm_subscriber_connection;
|
2014-01-19 10:47:44 +00:00
|
|
|
struct amr_multirate_conf;
|
2015-09-24 09:30:58 +00:00
|
|
|
struct amr_mode;
|
add struct bsc_subscr, separating libbsc from gsm_subscriber
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will
not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC
subscriber: struct bsc_subscr.
Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no
longer have a backpointer to gsm_network (used to be via subscr->group).
Create a separate logging filter for the new BSC subscriber. The implementation
of adjusting the filter context is added in libbsc to not introduce
bsc_subscr_get/_put() dependencies to libcommon.
During Paging Response, fetch a bsc_subscr from the mobile identity, like we do
for the gsm_subscriber. It looks like a duplication now, but will make sense
for the VLR as well as for future MSC split patches.
Naming: it was requested to not name the new struct bsc_sub, because 'sub' is
too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function
prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to
match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast
to type, relatively short, unambiguous, and the naming is consistent.
Add bsc_subscr unit test.
Related: OS#1592, OS#1594
Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-02-18 21:20:46 +00:00
|
|
|
struct bsc_subscr;
|
2008-12-25 23:28:35 +00:00
|
|
|
|
2010-12-23 22:00:21 +00:00
|
|
|
#define GSM48_ALLOC_SIZE 2048
|
|
|
|
#define GSM48_ALLOC_HEADROOM 256
|
2010-05-01 12:22:44 +00:00
|
|
|
|
2016-01-25 21:03:25 +00:00
|
|
|
static inline struct msgb *gsm48_msgb_alloc_name(const char *name)
|
2010-05-01 12:22:44 +00:00
|
|
|
{
|
|
|
|
return msgb_alloc_headroom(GSM48_ALLOC_SIZE, GSM48_ALLOC_HEADROOM,
|
2016-01-25 21:03:25 +00:00
|
|
|
name);
|
2010-05-01 12:22:44 +00:00
|
|
|
}
|
|
|
|
|
2016-06-19 16:06:02 +00:00
|
|
|
void cm_service_request_concludes(struct gsm_subscriber_connection *conn,
|
|
|
|
struct msgb *msg);
|
|
|
|
|
2008-12-31 18:52:11 +00:00
|
|
|
/* config options controlling the behaviour of the lower leves */
|
2008-12-30 16:18:18 +00:00
|
|
|
void gsm0408_allow_everyone(int allow);
|
2010-12-22 22:17:50 +00:00
|
|
|
void gsm0408_clear_all_trans(struct gsm_network *net, int protocol);
|
2010-06-17 08:41:25 +00:00
|
|
|
int gsm0408_dispatch(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
2008-12-31 18:52:11 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id);
|
|
|
|
enum gsm_chan_t get_ctype_by_chreq(struct gsm_network *bts, uint8_t ra);
|
2011-07-23 08:53:30 +00:00
|
|
|
/* don't use "enum gsm_chreq_reason_t" to avoid circular dependency */
|
|
|
|
int get_reason_by_chreq(uint8_t ra, int neci);
|
2010-09-06 01:36:02 +00:00
|
|
|
void gsm_net_update_ctype(struct gsm_network *net);
|
2008-12-25 23:28:35 +00:00
|
|
|
|
2010-06-15 06:16:02 +00:00
|
|
|
int gsm48_tx_mm_info(struct gsm_subscriber_connection *conn);
|
2017-01-26 23:25:47 +00:00
|
|
|
int gsm48_tx_mm_auth_req(struct gsm_subscriber_connection *conn, uint8_t *rand,
|
|
|
|
uint8_t *autn, int key_seq);
|
2010-06-16 04:30:50 +00:00
|
|
|
int gsm48_tx_mm_auth_rej(struct gsm_subscriber_connection *conn);
|
2013-10-31 14:36:41 +00:00
|
|
|
int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
|
|
|
|
int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
|
|
|
|
enum gsm48_reject_value value);
|
2009-02-06 21:55:37 +00:00
|
|
|
int gsm48_send_rr_release(struct gsm_lchan *lchan);
|
2009-10-05 12:00:14 +00:00
|
|
|
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
|
2011-04-18 15:04:00 +00:00
|
|
|
int gsm48_send_rr_app_info(struct gsm_subscriber_connection *conn, uint8_t apdu_id,
|
|
|
|
uint8_t apdu_len, const uint8_t *apdu);
|
|
|
|
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t power_class);
|
2009-12-16 23:25:18 +00:00
|
|
|
int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t power_command, uint8_t ho_ref);
|
2008-12-25 23:28:35 +00:00
|
|
|
|
2010-12-22 22:57:45 +00:00
|
|
|
int mncc_tx_to_cc(struct gsm_network *net, int msg_type, void *arg);
|
2009-06-10 15:11:52 +00:00
|
|
|
|
2009-02-16 22:53:52 +00:00
|
|
|
/* convert a ASCII phone number to call-control BCD */
|
2011-04-18 15:04:00 +00:00
|
|
|
int encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len,
|
2009-06-10 04:08:54 +00:00
|
|
|
int h_len, const char *input);
|
2011-04-18 15:04:00 +00:00
|
|
|
int decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv,
|
2009-06-10 04:08:54 +00:00
|
|
|
int h_len);
|
2009-02-16 22:53:52 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv);
|
2010-05-15 17:07:20 +00:00
|
|
|
int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type);
|
2011-04-18 15:04:00 +00:00
|
|
|
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type);
|
2009-08-21 02:57:35 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode);
|
2009-10-22 13:23:11 +00:00
|
|
|
int gsm48_rx_rr_modif_ack(struct msgb *msg);
|
2009-11-29 18:07:28 +00:00
|
|
|
int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg);
|
|
|
|
|
2010-06-15 11:39:27 +00:00
|
|
|
struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
|
2010-06-15 11:40:05 +00:00
|
|
|
struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
|
2010-06-14 20:26:10 +00:00
|
|
|
void gsm48_lchan2chan_desc(struct gsm48_chan_desc *cd,
|
|
|
|
const struct gsm_lchan *lchan);
|
2009-10-22 13:13:00 +00:00
|
|
|
|
2012-01-23 15:40:24 +00:00
|
|
|
void release_security_operation(struct gsm_subscriber_connection *conn);
|
|
|
|
void allocate_security_operation(struct gsm_subscriber_connection *conn);
|
|
|
|
|
2017-05-27 11:18:50 +00:00
|
|
|
int gsm48_multirate_config(uint8_t *lv, const struct amr_multirate_conf *mr, const struct amr_mode *modes);
|
2014-01-19 10:47:44 +00:00
|
|
|
|
2017-04-09 10:32:51 +00:00
|
|
|
int gsm48_tch_rtp_create(struct gsm_trans *trans);
|
|
|
|
|
2008-12-23 20:25:15 +00:00
|
|
|
#endif
|