Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 3 | #include <osmocom/gsm/protocol/gsm_04_08.h> |
| 4 | #include <osmocom/gsm/gsm0808.h> |
| 5 | |
Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 6 | struct msgb; |
| 7 | struct gsm_network; |
| 8 | struct vlr_subscr; |
| 9 | |
| 10 | #define MSC_HLR_REMOTE_IP_DEFAULT "127.0.0.1" |
| 11 | #define MSC_HLR_REMOTE_PORT_DEFAULT OSMO_GSUP_PORT |
| 12 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 13 | /* TS 48.008 DLCI containing DCCH/ACCH + SAPI */ |
| 14 | #define OMSC_LINKID_CB(__msgb) (__msgb)->cb[3] |
| 15 | |
Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 16 | enum nsap_addr_enc { |
| 17 | NSAP_ADDR_ENC_X213, |
| 18 | NSAP_ADDR_ENC_V4RAW, |
| 19 | }; |
| 20 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 21 | #define MAX_A5_KEY_LEN (128/8) |
| 22 | |
| 23 | struct geran_encr { |
| 24 | /*! alg_id is in encoded format: |
| 25 | * alg_id == 1 means A5/0 i.e. no encryption, alg_id == 4 means A5/3. |
| 26 | * alg_id == 0 means no such IE was present. */ |
| 27 | uint8_t alg_id; |
| 28 | uint8_t key_len; |
| 29 | uint8_t key[MAX_A5_KEY_LEN]; |
| 30 | }; |
| 31 | |
| 32 | enum complete_layer3_type { |
| 33 | COMPLETE_LAYER3_NONE, |
| 34 | COMPLETE_LAYER3_LU, |
| 35 | COMPLETE_LAYER3_CM_SERVICE_REQ, |
| 36 | COMPLETE_LAYER3_PAGING_RESP, |
| 37 | }; |
| 38 | |
| 39 | extern const struct value_string complete_layer3_type_names[]; |
| 40 | static inline const char *complete_layer3_type_name(enum complete_layer3_type val) |
| 41 | { |
| 42 | return get_value_string(complete_layer3_type_names, val); |
| 43 | } |
| 44 | |
| 45 | struct cell_ids_entry { |
| 46 | struct llist_head entry; |
| 47 | struct gsm0808_cell_id_list2 cell_ids; |
| 48 | }; |
| 49 | |
Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 50 | typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); |
| 51 | |
| 52 | struct gsm_network *gsm_network_init(void *ctx, mncc_recv_cb_t mncc_recv); |
Neels Hofmeyr | 80447eb | 2018-12-05 01:11:28 +0100 | [diff] [blame] | 53 | void gsm_network_set_mncc_sock_path(struct gsm_network *net, const char *mncc_sock_path); |
Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 54 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 55 | extern const struct vlr_ops msc_vlr_ops; |
Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 56 | int msc_vlr_alloc(struct gsm_network *net); |
| 57 | int msc_vlr_start(struct gsm_network *net); |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 58 | int msc_gsup_client_start(struct gsm_network *net); |
Neels Hofmeyr | 7992122 | 2018-11-30 01:46:51 +0100 | [diff] [blame] | 59 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 60 | uint32_t msc_cc_next_outgoing_callref(); |