diff options
author | Stefan Sperling <ssperling@sysmocom.de> | 2018-12-26 16:36:02 +0100 |
---|---|---|
committer | Stefan Sperling <ssperling@sysmocom.de> | 2018-12-28 13:26:19 +0100 |
commit | ab8821793fd1add03d32ff91f7cfc2696eea66ae (patch) | |
tree | 930c56717835d676ee6aff060d78182c29753600 /include/osmocom/msc/neighbor_ident.h | |
parent | c9029a62996bac557cc75b8513ebc7135038ab92 (diff) |
basic conversion to MSC situation; vty parts still todostsp/neighbor_ident
Change-Id: Ia0dd08b087bfd4aa22e234917669d003150a4cd4
Depends: I5535f0d149c2173294538df75764dd181b023312
Diffstat (limited to 'include/osmocom/msc/neighbor_ident.h')
-rw-r--r-- | include/osmocom/msc/neighbor_ident.h | 75 |
1 files changed, 44 insertions, 31 deletions
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); |