Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 1 | /* Manage identity of neighboring BSS cells for inter-BSC handover */ |
| 2 | #pragma once |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <stdbool.h> |
| 6 | |
| 7 | #include <osmocom/core/linuxlist.h> |
| 8 | #include <osmocom/gsm/gsm0808.h> |
| 9 | #include <osmocom/sigtran/sccp_sap.h> |
| 10 | |
| 11 | struct vty; |
| 12 | struct gsm_network; |
| 13 | |
| 14 | enum msc_neighbor_type { |
| 15 | MSC_NEIGHBOR_TYPE_NONE = 0, |
| 16 | MSC_NEIGHBOR_TYPE_LOCAL_RAN_PEER, |
| 17 | MSC_NEIGHBOR_TYPE_REMOTE_MSC, |
| 18 | }; |
| 19 | |
| 20 | struct msc_ipa_name { |
| 21 | char buf[64]; |
| 22 | size_t len; |
| 23 | }; |
| 24 | |
| 25 | int msc_ipa_name_from_str(struct msc_ipa_name *min, const char *name); |
| 26 | int msc_ipa_name_cmp(const struct msc_ipa_name *a, const struct msc_ipa_name *b); |
| 27 | |
| 28 | struct neighbor_ident_addr { |
| 29 | enum osmo_rat_type ran_type; |
| 30 | enum msc_neighbor_type type; |
| 31 | union { |
| 32 | char local_ran_peer_pc_str[23]; |
| 33 | struct msc_ipa_name remote_msc_ipa_name; |
| 34 | }; |
| 35 | }; |
| 36 | |
| 37 | struct neighbor_ident_entry { |
| 38 | struct llist_head entry; |
| 39 | |
| 40 | struct neighbor_ident_addr addr; |
| 41 | |
| 42 | /* A list of struct cell_ids_entry. A gsm0808_cell_id_list2 would in principle suffice, but to support |
| 43 | * storing more than 127 cell ids and to allow storing IDs of differing types, have a list of any number of |
| 44 | * gsm0808_cell_id_list2. */ |
| 45 | struct llist_head cell_ids; |
| 46 | }; |
| 47 | |
| 48 | void neighbor_ident_init(struct gsm_network *net); |
| 49 | const char *neighbor_ident_addr_name(const struct neighbor_ident_addr *nia); |
| 50 | |
| 51 | const struct neighbor_ident_entry *neighbor_ident_add(struct llist_head *ni_list, |
| 52 | const struct neighbor_ident_addr *nia, |
| 53 | const struct gsm0808_cell_id *cid); |
| 54 | |
| 55 | const struct neighbor_ident_entry *neighbor_ident_find_by_cell(const struct llist_head *ni_list, |
| 56 | enum osmo_rat_type ran_type, |
| 57 | const struct gsm0808_cell_id *cell_id); |
| 58 | |
| 59 | const struct neighbor_ident_entry *neighbor_ident_find_by_addr(const struct llist_head *ni_list, |
| 60 | const struct neighbor_ident_addr *nia); |
| 61 | |
| 62 | void neighbor_ident_del(const struct neighbor_ident_entry *nie); |
| 63 | |
| 64 | void neighbor_ident_clear(struct llist_head *ni_list); |
| 65 | |
| 66 | void neighbor_ident_vty_init(struct gsm_network *net); |
| 67 | void neighbor_ident_vty_write(struct vty *vty); |
| 68 | |