Holger Hans Peter Freyther | 4f448c9 | 2010-07-05 16:02:04 +0800 | [diff] [blame] | 1 | /* OpenBSC BSC code */ |
| 2 | |
| 3 | #ifndef OSMO_BSC_H |
| 4 | #define OSMO_BSC_H |
| 5 | |
| 6 | #include "bsc_api.h" |
| 7 | |
Holger Hans Peter Freyther | d2361d9 | 2012-12-03 15:32:54 +0100 | [diff] [blame] | 8 | #define BSS_SEND_USSD 1 |
| 9 | |
Jacob Erlbeck | 56595f8 | 2013-09-11 10:46:55 +0200 | [diff] [blame^] | 10 | enum bsc_con { |
| 11 | BSC_CON_SUCCESS, |
| 12 | BSC_CON_REJECT_NO_LINK, |
| 13 | BSC_CON_REJECT_RF_GRACE, |
| 14 | BSC_CON_NO_MEM, |
| 15 | }; |
| 16 | |
Holger Hans Peter Freyther | b8781d2 | 2010-11-06 18:08:43 +0100 | [diff] [blame] | 17 | struct sccp_connection; |
Holger Hans Peter Freyther | 4cdb050 | 2011-06-04 14:51:51 +0200 | [diff] [blame] | 18 | struct osmo_msc_data; |
| 19 | struct bsc_msc_connection; |
Holger Hans Peter Freyther | b8781d2 | 2010-11-06 18:08:43 +0100 | [diff] [blame] | 20 | |
Holger Hans Peter Freyther | d65305f | 2010-11-05 11:31:08 +0100 | [diff] [blame] | 21 | struct osmo_bsc_sccp_con { |
Holger Hans Peter Freyther | b8781d2 | 2010-11-06 18:08:43 +0100 | [diff] [blame] | 22 | struct llist_head entry; |
| 23 | |
Holger Hans Peter Freyther | fae3c65 | 2010-11-10 09:44:34 +0100 | [diff] [blame] | 24 | int ciphering_handled; |
Holger Hans Peter Freyther | 50c579b | 2010-11-10 10:07:30 +0100 | [diff] [blame] | 25 | int rtp_port; |
Holger Hans Peter Freyther | fae3c65 | 2010-11-10 09:44:34 +0100 | [diff] [blame] | 26 | |
Holger Hans Peter Freyther | b8781d2 | 2010-11-06 18:08:43 +0100 | [diff] [blame] | 27 | /* SCCP connection realted */ |
| 28 | struct sccp_connection *sccp; |
Holger Hans Peter Freyther | 4cdb050 | 2011-06-04 14:51:51 +0200 | [diff] [blame] | 29 | struct osmo_msc_data *msc; |
Pablo Neira Ayuso | bf540cb | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 30 | struct osmo_timer_list sccp_it_timeout; |
| 31 | struct osmo_timer_list sccp_cc_timeout; |
Holger Hans Peter Freyther | b8781d2 | 2010-11-06 18:08:43 +0100 | [diff] [blame] | 32 | |
Holger Hans Peter Freyther | b4e72f8 | 2010-11-15 10:31:53 +0100 | [diff] [blame] | 33 | struct llist_head sccp_queue; |
| 34 | unsigned int sccp_queue_size; |
| 35 | |
Holger Hans Peter Freyther | 7e90108 | 2010-11-06 20:15:17 +0100 | [diff] [blame] | 36 | struct gsm_subscriber_connection *conn; |
Holger Hans Peter Freyther | d65305f | 2010-11-05 11:31:08 +0100 | [diff] [blame] | 37 | uint8_t new_subscriber; |
| 38 | }; |
| 39 | |
Holger Hans Peter Freyther | 4f448c9 | 2010-07-05 16:02:04 +0800 | [diff] [blame] | 40 | struct bsc_api *osmo_bsc_api(); |
| 41 | |
Holger Hans Peter Freyther | 863a55d | 2010-11-10 09:31:41 +0100 | [diff] [blame] | 42 | int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg); |
Holger Hans Peter Freyther | 7e90108 | 2010-11-06 20:15:17 +0100 | [diff] [blame] | 43 | int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg); |
Jacob Erlbeck | 56595f8 | 2013-09-11 10:46:55 +0200 | [diff] [blame^] | 44 | enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, |
| 45 | struct osmo_msc_data *msc); |
Holger Hans Peter Freyther | 7e90108 | 2010-11-06 20:15:17 +0100 | [diff] [blame] | 46 | int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp); |
Holger Hans Peter Freyther | 4582586 | 2010-11-04 11:48:49 +0100 | [diff] [blame] | 47 | |
Holger Hans Peter Freyther | 076af1c | 2011-06-07 19:57:02 +0200 | [diff] [blame] | 48 | struct osmo_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *); |
Holger Hans Peter Freyther | 5bb874d | 2010-11-05 11:21:18 +0100 | [diff] [blame] | 49 | int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); |
Holger Hans Peter Freyther | a54732d | 2010-11-05 18:11:19 +0100 | [diff] [blame] | 50 | int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); |
Holger Hans Peter Freyther | d2361d9 | 2012-12-03 15:32:54 +0100 | [diff] [blame] | 51 | int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn); |
Holger Hans Peter Freyther | 5bb874d | 2010-11-05 11:21:18 +0100 | [diff] [blame] | 52 | |
Holger Hans Peter Freyther | 644b0bf | 2011-06-08 15:52:07 +0200 | [diff] [blame] | 53 | int bsc_handle_udt(struct osmo_msc_data *msc, struct msgb *msg, unsigned int length); |
Holger Hans Peter Freyther | 3485feb | 2010-11-09 23:28:33 +0100 | [diff] [blame] | 54 | int bsc_handle_dt1(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len); |
| 55 | |
Daniel Willmann | 5e95f45 | 2011-08-05 12:22:35 +0200 | [diff] [blame] | 56 | int bsc_ctrl_cmds_install(); |
Holger Hans Peter Freyther | 00f4cc2 | 2010-11-06 23:50:06 +0100 | [diff] [blame] | 57 | |
Holger Hans Peter Freyther | 4f448c9 | 2010-07-05 16:02:04 +0800 | [diff] [blame] | 58 | #endif |