Holger Hans Peter Freyther | ec32b58 | 2010-03-23 07:40:46 +0100 | [diff] [blame] | 1 | /* GSM 08.08 like API for OpenBSC */ |
| 2 | |
Holger Hans Peter Freyther | 05a379b | 2010-06-14 15:50:35 +0800 | [diff] [blame] | 3 | #ifndef OPENBSC_BSC_API_H |
| 4 | #define OPENBSC_BSC_API_H |
| 5 | |
Holger Hans Peter Freyther | ec32b58 | 2010-03-23 07:40:46 +0100 | [diff] [blame] | 6 | #include "gsm_data.h" |
| 7 | |
Holger Hans Peter Freyther | 9764331 | 2010-06-17 16:41:25 +0800 | [diff] [blame] | 8 | #define BSC_API_CONN_POL_ACCEPT 0 |
| 9 | #define BSC_API_CONN_POL_REJECT 1 |
| 10 | |
Holger Hans Peter Freyther | 05a379b | 2010-06-14 15:50:35 +0800 | [diff] [blame] | 11 | struct bsc_api { |
| 12 | void (*sapi_n_reject)(struct gsm_subscriber_connection *conn, int dlci); |
| 13 | void (*cipher_mode_compl)(struct gsm_subscriber_connection *conn, |
Holger Hans Peter Freyther | dbc62db | 2010-07-23 16:55:24 +0800 | [diff] [blame^] | 14 | struct msgb *msg, uint16_t chosen_encr); |
Holger Hans Peter Freyther | 9764331 | 2010-06-17 16:41:25 +0800 | [diff] [blame] | 15 | int (*compl_l3)(struct gsm_subscriber_connection *conn, |
| 16 | struct msgb *msg, uint16_t chosen_channel); |
| 17 | void (*dtap)(struct gsm_subscriber_connection *conn, struct msgb *msg); |
Holger Hans Peter Freyther | c354de8 | 2010-07-23 16:49:38 +0800 | [diff] [blame] | 18 | void (*assign_compl)(struct gsm_subscriber_connection *conn, |
Holger Hans Peter Freyther | 05a379b | 2010-06-14 15:50:35 +0800 | [diff] [blame] | 19 | uint16_t rr_cause); |
Holger Hans Peter Freyther | c354de8 | 2010-07-23 16:49:38 +0800 | [diff] [blame] | 20 | void (*assign_fail)(struct gsm_subscriber_connection *conn, |
Holger Hans Peter Freyther | 05a379b | 2010-06-14 15:50:35 +0800 | [diff] [blame] | 21 | uint16_t rr_cause); |
| 22 | void (*clear_request)(struct gsm_subscriber_connection *conn, |
| 23 | uint32_t cause); |
| 24 | void (*clear_compl)(struct gsm_subscriber_connection *conn); |
| 25 | }; |
Holger Hans Peter Freyther | ec32b58 | 2010-03-23 07:40:46 +0100 | [diff] [blame] | 26 | |
Holger Hans Peter Freyther | abcddf1 | 2010-06-14 18:20:15 +0800 | [diff] [blame] | 27 | int bsc_api_init(struct gsm_network *network, struct bsc_api *api); |
Holger Hans Peter Freyther | ec32b58 | 2010-03-23 07:40:46 +0100 | [diff] [blame] | 28 | int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id); |
Holger Hans Peter Freyther | c354de8 | 2010-07-23 16:49:38 +0800 | [diff] [blame] | 29 | int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_type, int audio); |
Holger Hans Peter Freyther | dbc62db | 2010-07-23 16:55:24 +0800 | [diff] [blame^] | 30 | int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, |
| 31 | uint8_t *key, int len); |
Holger Hans Peter Freyther | 7700846 | 2010-06-16 14:10:45 +0800 | [diff] [blame] | 32 | int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, |
| 33 | unsigned int mi_len, uint8_t *mi, int chan_type); |
Holger Hans Peter Freyther | 4049455 | 2010-06-28 17:09:29 +0800 | [diff] [blame] | 34 | int gsm0808_clear(struct gsm_subscriber_connection *conn); |
Holger Hans Peter Freyther | 05a379b | 2010-06-14 15:50:35 +0800 | [diff] [blame] | 35 | |
| 36 | #endif |