2010-07-05 08:02:04 +00:00
|
|
|
/* OpenBSC BSC code */
|
|
|
|
|
|
|
|
#ifndef OSMO_BSC_H
|
|
|
|
#define OSMO_BSC_H
|
|
|
|
|
|
|
|
#include "bsc_api.h"
|
2015-04-05 17:46:20 +00:00
|
|
|
#include "bsc_msg_filter.h"
|
2010-07-05 08:02:04 +00:00
|
|
|
|
2012-12-03 14:32:54 +00:00
|
|
|
#define BSS_SEND_USSD 1
|
|
|
|
|
2013-09-11 08:46:55 +00:00
|
|
|
enum bsc_con {
|
|
|
|
BSC_CON_SUCCESS,
|
|
|
|
BSC_CON_REJECT_NO_LINK,
|
|
|
|
BSC_CON_REJECT_RF_GRACE,
|
|
|
|
BSC_CON_NO_MEM,
|
|
|
|
};
|
|
|
|
|
2010-11-06 17:08:43 +00:00
|
|
|
struct sccp_connection;
|
2017-02-23 20:57:23 +00:00
|
|
|
struct bsc_msc_data;
|
2011-06-04 12:51:51 +00:00
|
|
|
struct bsc_msc_connection;
|
2010-11-06 17:08:43 +00:00
|
|
|
|
2010-11-05 10:31:08 +00:00
|
|
|
struct osmo_bsc_sccp_con {
|
2010-11-06 17:08:43 +00:00
|
|
|
struct llist_head entry;
|
|
|
|
|
2010-11-10 08:44:34 +00:00
|
|
|
int ciphering_handled;
|
2014-08-08 19:06:30 +00:00
|
|
|
|
|
|
|
/* for audio handling */
|
|
|
|
uint16_t cic;
|
2017-04-09 10:32:51 +00:00
|
|
|
uint32_t rtp_ip;
|
2010-11-10 09:07:30 +00:00
|
|
|
int rtp_port;
|
2010-11-10 08:44:34 +00:00
|
|
|
|
2014-09-02 15:28:40 +00:00
|
|
|
/* for advanced ping/pong */
|
|
|
|
int send_ping;
|
|
|
|
|
2010-11-06 17:08:43 +00:00
|
|
|
/* SCCP connection realted */
|
|
|
|
struct sccp_connection *sccp;
|
2017-02-23 20:57:23 +00:00
|
|
|
struct bsc_msc_data *msc;
|
2011-05-06 10:11:06 +00:00
|
|
|
struct osmo_timer_list sccp_it_timeout;
|
|
|
|
struct osmo_timer_list sccp_cc_timeout;
|
2010-11-06 17:08:43 +00:00
|
|
|
|
2010-11-15 09:31:53 +00:00
|
|
|
struct llist_head sccp_queue;
|
|
|
|
unsigned int sccp_queue_size;
|
|
|
|
|
2010-11-06 19:15:17 +00:00
|
|
|
struct gsm_subscriber_connection *conn;
|
2010-11-05 10:31:08 +00:00
|
|
|
uint8_t new_subscriber;
|
2015-04-05 17:46:20 +00:00
|
|
|
|
|
|
|
struct bsc_filter_state filter_state;
|
2017-04-09 10:32:51 +00:00
|
|
|
|
|
|
|
/* Sigtran connection ID */
|
|
|
|
int conn_id;
|
2010-11-05 10:31:08 +00:00
|
|
|
};
|
|
|
|
|
2010-07-05 08:02:04 +00:00
|
|
|
struct bsc_api *osmo_bsc_api();
|
|
|
|
|
2010-11-10 08:31:41 +00:00
|
|
|
int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg);
|
2010-11-06 19:15:17 +00:00
|
|
|
int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg);
|
2013-09-11 08:46:55 +00:00
|
|
|
enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn,
|
2017-02-23 20:57:23 +00:00
|
|
|
struct bsc_msc_data *msc, int send_ping);
|
2010-11-06 19:15:17 +00:00
|
|
|
int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp);
|
2010-11-04 10:48:49 +00:00
|
|
|
|
2017-02-23 20:57:23 +00:00
|
|
|
struct bsc_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *);
|
2010-11-05 10:21:18 +00:00
|
|
|
int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
2010-11-05 17:11:19 +00:00
|
|
|
int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
2012-12-03 14:32:54 +00:00
|
|
|
int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn);
|
2010-11-05 10:21:18 +00:00
|
|
|
|
2017-02-23 20:57:23 +00:00
|
|
|
int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length);
|
2017-04-09 10:32:51 +00:00
|
|
|
int bsc_handle_dt(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len);
|
2010-11-09 22:28:33 +00:00
|
|
|
|
2011-08-05 10:22:35 +00:00
|
|
|
int bsc_ctrl_cmds_install();
|
2010-11-06 22:50:06 +00:00
|
|
|
|
2014-02-22 09:30:32 +00:00
|
|
|
void bsc_gen_location_state_trap(struct gsm_bts *bts);
|
|
|
|
|
2015-04-05 18:53:42 +00:00
|
|
|
struct llist_head *bsc_access_lists(void);
|
|
|
|
|
2010-07-05 08:02:04 +00:00
|
|
|
#endif
|