Have osmo-bts request OML routes for all its MOs at startup
During OML link start-up, osmo-bts now requests a OML route for each of the managed objects that it currently implements. This is done via the 'ORC' (OML Router Control) protocol, which is encapsulated in the extended IPA_PROTO_OSMO multiplex. The responses (ACK/NACK) are not yet processed inside osmo-bts.
This commit is contained in:
parent
3d836bcf30
commit
54cbbb1450
|
@ -27,4 +27,11 @@ struct osmo_omlrctrl_register_req {
|
|||
char name[0];
|
||||
} __attribute__((packed));
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmo-bts/oml_routing.h>
|
||||
|
||||
struct msgb *gen_orc_route_add(const struct oml_route *rt_in);
|
||||
struct msgb *gen_orc_route_del(const struct oml_route *rt_in);
|
||||
int abis_orc_sendmsg(struct msgb *msg);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,10 +7,10 @@ libbts_a_SOURCES = gsm_data_shared.c sysinfo.c logging.c abis.c oml.c bts.c \
|
|||
rsl.c vty.c paging.c measurement.c amr.c lchan.c \
|
||||
load_indication.c pcu_sock.c handover.c msg_utils.c \
|
||||
load_indication.c pcu_sock.c handover.c msg_utils.c \
|
||||
tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c
|
||||
tx_power.c bts_ctrl_commands.c bts_ctrl_lookup.c \
|
||||
oml_router_ctrl.c
|
||||
|
||||
bin_PROGRAMS = osmobts-omlrouter
|
||||
|
||||
osmobts_omlrouter_SOURCES = oml_router.c msg_utils.c oml_routing.c
|
||||
osmobts_omlrouter_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOGSM_LIBS)
|
||||
|
||||
|
|
|
@ -77,6 +77,15 @@ static struct e1inp_sign_link *sign_link_up(void *unit, struct e1inp_line *line,
|
|||
case E1INP_SIGN_OML:
|
||||
LOGP(DABIS, LOGL_INFO, "OML Signalling link up\n");
|
||||
e1inp_ts_config_sign(&line->ts[E1INP_SIGN_OML-1], line);
|
||||
/* Create OSMO signalling link to talk with OML router */
|
||||
/* Create this first, before the OML link, to ensure OSMO
|
||||
* messages get dequeued on transmit before OML messages */
|
||||
g_bts->osmo_link =
|
||||
e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML-1],
|
||||
E1INP_SIGN_OSMO, g_bts->c0,
|
||||
IPAC_PROTO_OSMO, 0);
|
||||
|
||||
/* Create OML signalling link */
|
||||
sign_link = g_bts->oml_link =
|
||||
e1inp_sign_link_create(&line->ts[E1INP_SIGN_OML-1],
|
||||
E1INP_SIGN_OML, NULL, 255, 0);
|
||||
|
|
|
@ -199,25 +199,35 @@ int bts_link_estab(struct gsm_bts *bts)
|
|||
LOGP(DSUM, LOGL_INFO, "Main link established, sending Status'.\n");
|
||||
|
||||
/* BTS and SITE MGR are EAABLED, BTS is DEPENDENCY */
|
||||
orc_add_route_mo(&bts->site_mgr.mo);
|
||||
oml_tx_state_changed(&bts->site_mgr.mo);
|
||||
orc_add_route_mo(&bts->mo);
|
||||
oml_tx_state_changed(&bts->mo);
|
||||
|
||||
/* those should all be in DEPENDENCY */
|
||||
orc_add_route_mo(&bts->gprs.nse.mo);
|
||||
oml_tx_state_changed(&bts->gprs.nse.mo);
|
||||
orc_add_route_mo(&bts->gprs.cell.mo);
|
||||
oml_tx_state_changed(&bts->gprs.cell.mo);
|
||||
orc_add_route_mo(&bts->gprs.nsvc[0].mo);
|
||||
oml_tx_state_changed(&bts->gprs.nsvc[0].mo);
|
||||
orc_add_route_mo(&bts->gprs.nsvc[1].mo);
|
||||
oml_tx_state_changed(&bts->gprs.nsvc[1].mo);
|
||||
|
||||
/* All other objects start off-line until the BTS Model code says otherwise */
|
||||
for (i = 0; i < bts->num_trx; i++) {
|
||||
struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, i);
|
||||
|
||||
orc_add_route_mo(&trx->mo);
|
||||
oml_tx_state_changed(&trx->mo);
|
||||
|
||||
orc_add_route_mo(&trx->bb_transc.mo);
|
||||
oml_tx_state_changed(&trx->bb_transc.mo);
|
||||
|
||||
for (j = 0; j < ARRAY_SIZE(trx->ts); j++) {
|
||||
struct gsm_bts_trx_ts *ts = &trx->ts[j];
|
||||
|
||||
orc_add_route_mo(&ts->mo);
|
||||
oml_tx_state_changed(&ts->mo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <osmo-bts/bts_model.h>
|
||||
#include <osmo-bts/bts.h>
|
||||
#include <osmo-bts/signal.h>
|
||||
#include <osmo-bts/oml_router_ctrl.h>
|
||||
|
||||
/* FIXME: move this to libosmocore */
|
||||
static struct tlv_definition abis_nm_att_tlvdef_ipa = {
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
/* OML Router Control (client side) */
|
||||
|
||||
/* (C) 2014 by Harald Welte <laforge@gnumonks.org>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <osmocom/core/msgb.h>
|
||||
#include <osmocom/gsm/protocol/ipaccess.h>
|
||||
|
@ -6,11 +27,13 @@
|
|||
#include <osmo-bts/oml_router_ctrl.h>
|
||||
#include <osmo-bts/gsm_data.h>
|
||||
|
||||
/* send a OML Router Control message via Abis */
|
||||
int abis_orc_sendmsg(struct msgb *msg)
|
||||
{
|
||||
struct gsm_bts *bts = msg->trx->bts;
|
||||
struct ipaccess_head_ext *he;
|
||||
|
||||
/* push the extended IPA header to the front of the msgb */
|
||||
he = (struct ipaccess_head_ext *) msgb_push(msg, sizeof(*he));
|
||||
he->proto = IPAC_PROTO_EXT_ORC;
|
||||
|
||||
|
@ -46,16 +69,19 @@ static struct msgb *__gen_orc_route(const struct oml_route *rt_in, int del)
|
|||
return msg;
|
||||
}
|
||||
|
||||
/* generate msgb with OML Router Control ROUTE_ADD_REQ */
|
||||
struct msgb *gen_orc_route_add(const struct oml_route *rt_in)
|
||||
{
|
||||
return __gen_orc_route(rt_in, 0);
|
||||
}
|
||||
|
||||
/* generate msgb with OML Router Control ROUTE_DEL_REQ */
|
||||
struct msgb *gen_orc_route_del(const struct oml_route *rt_in)
|
||||
{
|
||||
return __gen_orc_route(rt_in, 1);
|
||||
}
|
||||
|
||||
/* Request a route for the given MO from the OML router */
|
||||
int orc_add_route_mo(struct gsm_abis_mo *mo)
|
||||
{
|
||||
struct oml_route rt;
|
||||
|
|
Loading…
Reference in New Issue