aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/msc/Makefile.am2
-rw-r--r--include/osmocom/msc/gsm_data.h5
-rw-r--r--include/osmocom/msc/neighbor_ident.h75
3 files changed, 50 insertions, 32 deletions
diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am
index c035a2d79..e821993f7 100644
--- a/include/osmocom/msc/Makefile.am
+++ b/include/osmocom/msc/Makefile.am
@@ -19,7 +19,7 @@ noinst_HEADERS = \
msc_common.h \
msc_ifaces.h \
msc_mgcp.h \
- neighor_ident.h \
+ neighbor_ident.h \
a_reset.h \
ran_conn.h \
rrlp.h \
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index d2511cb7b..8930380e3 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -16,6 +16,7 @@
#include <osmocom/mgcp_client/mgcp_client.h>
#include <osmocom/msc/msc_common.h>
+#include <osmocom/msc/neighbor_ident.h>
#include "gsm_data_shared.h"
@@ -208,6 +209,10 @@ struct gsm_network {
struct osmo_sccp_instance *sccp;
} a;
+ /* A list of neighbor BSCs. This list is defined statically via VTY and does not
+ * necessarily correspond to BSCs attached to the A interface at a given moment. */
+ struct neighbor_ident_list *neighbor_list;
+
struct {
/* MSISDN to which to route MO emergency calls */
char *route_to_msisdn;
diff --git a/include/osmocom/msc/neighbor_ident.h b/include/osmocom/msc/neighbor_ident.h
index 17bffbc14..d79d2626f 100644
--- a/include/osmocom/msc/neighbor_ident.h
+++ b/include/osmocom/msc/neighbor_ident.h
@@ -5,54 +5,67 @@
#include <stdbool.h>
#include <osmocom/core/linuxlist.h>
+#include <osmocom/gsm/gsm0808.h>
struct vty;
struct gsm_network;
-struct gsm_bts;
-struct neighbor_ident_list;
-struct gsm0808_cell_id_list2;
-#define NEIGHBOR_IDENT_KEY_ANY_BTS -1
+enum msc_neighbor_type {
+ /* Neighboring BSC reachable via SCCP. */
+ MSC_NEIGHBOR_TYPE_BSC,
+
+ /* Neighboring MSC reachable via GSUP. */
+ MSC_NEIGHBOR_TYPE_MSC
+};
+
+struct neighbor_ident_addr {
+ enum msc_neighbor_type type;
+ union {
+ int point_code; /* BSC */
+ const char *ipa_name; /* MSC */
+ } a;
+};
+
+struct neighbor_ident_list {
+ struct llist_head list;
+};
+
+struct neighbor_ident {
+ struct llist_head entry;
-#define BSIC_ANY 0xff
+ /* Address of a neighboring BSC or MSC. */
+ struct neighbor_ident_addr addr;
-struct neighbor_ident_key {
- int from_bts; /*< BTS nr 0..255 or NEIGHBOR_IDENT_KEY_ANY_BTS */
- uint16_t arfcn;
- uint8_t bsic;
+ /* IDs of cells in this neighbor's domain. */
+ struct gsm0808_cell_id_list2 cell_ids;
};
-const char *neighbor_ident_key_name(const struct neighbor_ident_key *ni_key);
+struct gsm0808_cell_id;
+struct gsm0808_cell_id_list2;
+
+const char *neighbor_ident_addr_name(struct gsm_network *net, const struct neighbor_ident_addr *ni_addr);
struct neighbor_ident_list *neighbor_ident_init(void *talloc_ctx);
void neighbor_ident_free(struct neighbor_ident_list *nil);
-bool neighbor_ident_key_match(const struct neighbor_ident_key *entry,
- const struct neighbor_ident_key *search_for,
- bool exact_match);
+bool neighbor_ident_addr_match(const struct neighbor_ident_addr *entry,
+ const struct neighbor_ident_addr *search_for,
+ bool exact_match);
-int neighbor_ident_add(struct neighbor_ident_list *nil, const struct neighbor_ident_key *key,
- const struct gsm0808_cell_id_list2 *val);
+int neighbor_ident_add(struct neighbor_ident_list *nil, const struct neighbor_ident_addr *addr,
+ const struct gsm0808_cell_id_list2 *cell_ids);
const struct gsm0808_cell_id_list2 *neighbor_ident_get(const struct neighbor_ident_list *nil,
- const struct neighbor_ident_key *key);
-bool neighbor_ident_del(struct neighbor_ident_list *nil, const struct neighbor_ident_key *key);
+ const struct neighbor_ident_addr *addr);
+const struct neighbor_ident_addr *neighbor_ident_lookup_cell(const struct neighbor_ident_list *nil,
+ struct gsm0808_cell_id *cell_id);
+bool neighbor_ident_del(struct neighbor_ident_list *nil, const struct neighbor_ident_addr *addr);
void neighbor_ident_clear(struct neighbor_ident_list *nil);
void neighbor_ident_iter(const struct neighbor_ident_list *nil,
- bool (* iter_cb )(const struct neighbor_ident_key *key,
- const struct gsm0808_cell_id_list2 *val,
+ bool (* iter_cb )(const struct neighbor_ident_addr *addr,
+ const struct gsm0808_cell_id_list2 *cell_ids,
void *cb_data),
void *cb_data);
-void neighbor_ident_vty_init(struct gsm_network *net, struct neighbor_ident_list *nil);
-void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct gsm_bts *bts);
-
-#define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)"
-#define NEIGHBOR_IDENT_VTY_KEY_DOC \
- "ARFCN of neighbor cell\n" "ARFCN value\n" \
- "BSIC of neighbor cell\n" "BSIC value\n" \
- "for all BSICs / use any BSIC in this ARFCN\n"
-bool neighbor_ident_vty_parse_key_params(struct vty *vty, const char **argv,
- struct neighbor_ident_key *key);
-bool neighbor_ident_bts_parse_key_params(struct vty *vty, struct gsm_bts *bts, const char **argv,
- struct neighbor_ident_key *key);
+void neighbor_ident_vty_init(struct gsm_network *net);
+void neighbor_ident_vty_write(struct vty *vty);