diff options
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/include/openbsc/a_iface.h | 19 | ||||
-rw-r--r-- | openbsc/include/openbsc/gsm_data.h | 3 | ||||
-rw-r--r-- | openbsc/src/gprs/Makefile.am | 2 | ||||
-rw-r--r-- | openbsc/src/libcommon-cs/common_cs.c | 1 | ||||
-rw-r--r-- | openbsc/src/libcommon/common_vty.c | 22 | ||||
-rw-r--r-- | openbsc/src/libmsc/a_iface.c | 27 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc_mgcp/Makefile.am | 1 | ||||
-rw-r--r-- | openbsc/src/osmo-msc/msc_main.c | 1 |
8 files changed, 49 insertions, 27 deletions
diff --git a/openbsc/include/openbsc/a_iface.h b/openbsc/include/openbsc/a_iface.h index f40356ab4..1d63571f1 100644 --- a/openbsc/include/openbsc/a_iface.h +++ b/openbsc/include/openbsc/a_iface.h @@ -18,6 +18,23 @@ * */ +#pragma once + +#include <openbsc/a_reset.h> + +/* A struct to keep a context information about the BSCs we are associated with */ +struct bsc_context { + struct llist_head list; + + /* To be filled up by the user (VTY) */ + struct osmo_sccp_addr called_addr; /* BSC (remote) */ + struct osmo_sccp_addr calling_addr; /* MSC (local) */ + + /* Automatically filled up by a_init() */ + struct a_reset_ctx reset; /* Reset FSM (one per BSC) */ + struct osmo_sccp_user *sccp_user; /* SCCP user (the same for all) */ +}; + /* Initalize A interface connection between to MSC and BSC */ int a_init(void *ctx, struct osmo_sccp_instance *sccp, struct gsm_network *network); @@ -39,5 +56,3 @@ void a_clear_all(struct osmo_sccp_user *scu, struct osmo_sccp_addr *bsc_addr); /* Delete info of a closed connection from the active connection list */ void a_delete_bsc_con(uint32_t conn_id); - -#pragma once diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 13178ae6c..be583d958 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -483,6 +483,9 @@ struct gsm_network { } iu; struct osmo_sccp_instance *sccp; + + /* A list with all associated BSCs */ + struct llist_head bscs; }; struct osmo_esme; diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am index cb0997902..e05eb79ff 100644 --- a/openbsc/src/gprs/Makefile.am +++ b/openbsc/src/gprs/Makefile.am @@ -34,6 +34,7 @@ OSMO_LIBS = \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOGB_LIBS) \ $(LIBGTP_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ $(NULL) bin_PROGRAMS = \ @@ -128,5 +129,6 @@ osmo_gtphub_LDADD = \ $(LIBOSMOVTY_LIBS) \ $(LIBCARES_LIBS) \ $(LIBGTP_LIBS) \ + $(LIBOSMOSIGTRAN_LIBS) \ -lrt \ $(NULL) diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index d94381b4c..59d496d28 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -65,6 +65,7 @@ struct gsm_network *gsm_network_init(void *ctx, INIT_LLIST_HEAD(&net->trans_list); INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); + INIT_LLIST_HEAD(&net->bscs); net->bsc_subscribers = talloc_zero(net, struct llist_head); INIT_LLIST_HEAD(net->bsc_subscribers); diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index 6e1c10b00..fcda91841 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -34,6 +34,7 @@ #include <osmocom/vty/command.h> #include <osmocom/vty/buffer.h> #include <osmocom/vty/vty.h> +#include <osmocom/sigtran/osmo_ss7.h> int bsc_vty_go_parent(struct vty *vty) @@ -108,6 +109,7 @@ int bsc_vty_go_parent(struct vty *vty) vty->node = SMPP_NODE; vty->index = NULL; break; + case SMPP_NODE: case MGCP_NODE: case GBPROXY_NODE: @@ -117,13 +119,15 @@ int bsc_vty_go_parent(struct vty *vty) case MSC_NODE: case MNCC_INT_NODE: case NITB_NODE: - default: - if (bsc_vty_is_config_node(vty, vty->node)) - vty->node = CONFIG_NODE; - else - vty->node = ENABLE_NODE; - + vty->node = CONFIG_NODE; vty->index = NULL; + break; + case SUBSCR_NODE: + vty->node = ENABLE_NODE; + vty->index = NULL; + break; + default: + osmo_ss7_vty_go_parent(vty); } return vty->node; @@ -131,6 +135,11 @@ int bsc_vty_go_parent(struct vty *vty) int bsc_vty_is_config_node(struct vty *vty, int node) { + /* Check if libosmo-sccp declares the node in + * question as config node */ + if (osmo_ss7_is_config_node(vty, node)) + return 1; + switch (node) { /* add items that are not config */ case OML_NODE: @@ -138,7 +147,6 @@ int bsc_vty_is_config_node(struct vty *vty, int node) case SUBSCR_NODE: case CONFIG_NODE: return 0; - default: return 1; } diff --git a/openbsc/src/libmsc/a_iface.c b/openbsc/src/libmsc/a_iface.c index 19d853c88..3a17daa78 100644 --- a/openbsc/src/libmsc/a_iface.c +++ b/openbsc/src/libmsc/a_iface.c @@ -62,20 +62,6 @@ struct bsc_conn { * list is of type struct bsc_conn (see above) */ static LLIST_HEAD(active_connections); -/* Context information about the BSC, will be used only internally in this - * file to manage the BSCs we are associated with */ -struct bsc_context { - struct llist_head list; - struct a_reset_ctx reset; /* Reset FSM (one per BSC) */ - struct osmo_sccp_addr called_addr; /* BSC (remote) */ - struct osmo_sccp_addr calling_addr; /* MSC (local) */ - struct osmo_sccp_user *sccp_user; /* SCCP user (the same for all) */ -}; - -/* List with BSCs we are associated with. This list is of type - * struct bsc_context (see above) */ -static LLIST_HEAD(bsc_context_list); - /* Record info of a new active connection in the active connection list */ static void record_bsc_con(void *ctx, struct osmo_sccp_addr *called_addr, struct osmo_sccp_addr *calling_addr, uint32_t conn_id) @@ -129,7 +115,7 @@ static struct a_reset_ctx *get_reset_ctx_by_sccp_addr(struct osmo_sccp_addr *add if (!addr) return NULL; - llist_for_each_entry(bsc_ctx, &bsc_context_list, list) { + llist_for_each_entry(bsc_ctx, &gsm_network->bscs, list) { if (memcmp(&bsc_ctx->called_addr, addr, sizeof(*addr)) == 0) return &bsc_ctx->reset; } @@ -213,7 +199,7 @@ int a_iface_tx_paging(const char *imsi, uint32_t tmsi, uint16_t lac) cil.id_list_len = 1; /* Deliver paging request to all known BSCs */ - llist_for_each_entry(bsc_ctx, &bsc_context_list, list) { + llist_for_each_entry(bsc_ctx, &gsm_network->bscs, list) { if (a_reset_conn_ready(&bsc_ctx->reset)) { LOGP(DMSC, LOGL_DEBUG, "Passing paging message from MSC %s to BSC %s (imsi=%s, tmsi=0x%08x, lac=%u)\n", @@ -513,6 +499,11 @@ static void a_reset_cb(void *priv) /* Initalize A interface connection between to MSC and BSC */ int a_init(void *ctx, struct osmo_sccp_instance *sccp, struct gsm_network *network) { + + +#define SSN_BSSAP 254 /* SCCP_SSN_BSSAP */ +#define SENDER_PC 1 /* Our local point code */ + /* FIXME: Remove hardcoded parameters, use parameters in parameter list */ struct osmo_sccp_user *scu; struct bsc_context *bsc_ctx; @@ -529,7 +520,7 @@ int a_init(void *ctx, struct osmo_sccp_instance *sccp, struct gsm_network *netwo bsc_ctx = talloc_zero(NULL, struct bsc_context); bsc_ctx->reset.priv = bsc_ctx; bsc_ctx->reset.cb = a_reset_cb; - llist_add_tail(&bsc_ctx->list, &bsc_context_list); + llist_add_tail(&bsc_ctx->list, &gsm_network->bscs); bsc_ctx->called_addr.presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC; bsc_ctx->called_addr.ssn = SCCP_SSN_BSSAP; bsc_ctx->called_addr.ri = OSMO_SCCP_RI_SSN_PC; @@ -542,7 +533,7 @@ int a_init(void *ctx, struct osmo_sccp_instance *sccp, struct gsm_network *netwo bsc_ctx = NULL; /* Start reset procedure for all BSC connections */ - llist_for_each_entry(bsc_ctx, &bsc_context_list, list) { + llist_for_each_entry(bsc_ctx, &gsm_network->bscs, list) { a_reset_start(&bsc_ctx->reset); } diff --git a/openbsc/src/osmo-bsc_mgcp/Makefile.am b/openbsc/src/osmo-bsc_mgcp/Makefile.am index a19a4ebc0..b4e0d8564 100644 --- a/openbsc/src/osmo-bsc_mgcp/Makefile.am +++ b/openbsc/src/osmo-bsc_mgcp/Makefile.am @@ -31,5 +31,6 @@ osmo_bsc_mgcp_LDADD = \ $(LIBOSMONETIF_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ + $(LIBOSMOSIGTRAN_LIBS) \ -lrt \ $(NULL) diff --git a/openbsc/src/osmo-msc/msc_main.c b/openbsc/src/osmo-msc/msc_main.c index 5b4acd2bc..5fc185da5 100644 --- a/openbsc/src/osmo-msc/msc_main.c +++ b/openbsc/src/osmo-msc/msc_main.c @@ -354,6 +354,7 @@ int main(int argc, char **argv) vty_init(&msc_vty_info); osmo_ss7_init(); + osmo_ss7_vty_init_sg(); /* Parse options */ handle_options(argc, argv); |