aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c')
-rw-r--r--src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
index 6d64a4bb4..5ad0f47bc 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
@@ -105,18 +105,19 @@ struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts)
{
struct msgb *msgb;
uint8_t buf[256];
+ struct gsm_bts_sm *bts_sm = bts->site_mgr;
msgb = msgb_alloc(1024, "nanobts_attr_bts");
if (!msgb)
return NULL;
/* NSEI 925 */
- buf[0] = bts->gprs.nse.nsei >> 8;
- buf[1] = bts->gprs.nse.nsei & 0xff;
+ buf[0] = bts_sm->gprs.nse.nsei >> 8;
+ buf[1] = bts_sm->gprs.nse.nsei & 0xff;
msgb_tl16v_put(msgb, NM_ATT_IPACC_NSEI, 2, buf);
/* all timers in seconds */
- OSMO_ASSERT(ARRAY_SIZE(bts->gprs.nse.timer) < sizeof(buf));
- memcpy(buf, bts->gprs.nse.timer, ARRAY_SIZE(bts->gprs.nse.timer));
+ OSMO_ASSERT(ARRAY_SIZE(bts_sm->gprs.nse.timer) < sizeof(buf));
+ memcpy(buf, bts_sm->gprs.nse.timer, ARRAY_SIZE(bts_sm->gprs.nse.timer));
msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_CFG, 7, buf);
/* all timers in seconds */
@@ -202,16 +203,17 @@ struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts)
{
struct msgb *msgb;
uint8_t buf[256];
+ struct gsm_bts_sm *bts_sm = bts->site_mgr;
msgb = msgb_alloc(1024, "nanobts_attr_bts");
if (!msgb)
return NULL;
/* 925 */
- buf[0] = bts->gprs.nsvc[0].nsvci >> 8;
- buf[1] = bts->gprs.nsvc[0].nsvci & 0xff;
+ buf[0] = bts_sm->gprs.nsvc[0].nsvci >> 8;
+ buf[1] = bts_sm->gprs.nsvc[0].nsvci & 0xff;
msgb_tl16v_put(msgb, NM_ATT_IPACC_NSVCI, 2, buf);
- switch (bts->gprs.nsvc->remote.u.sa.sa_family) {
+ switch (bts_sm->gprs.nsvc->remote.u.sa.sa_family) {
case AF_INET6:
/* all fields are encoded in network byte order */
/* protocol family */
@@ -219,20 +221,20 @@ struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts)
/* padding */
buf[1] = 0x00;
/* local udp port */
- osmo_store16be(bts->gprs.nsvc[0].local_port, &buf[2]);
+ osmo_store16be(bts_sm->gprs.nsvc[0].local_port, &buf[2]);
/* remote udp port */
- memcpy(&buf[4], &bts->gprs.nsvc[0].remote.u.sin6.sin6_port, sizeof(uint16_t));
+ memcpy(&buf[4], &bts_sm->gprs.nsvc[0].remote.u.sin6.sin6_port, sizeof(uint16_t));
/* remote ip address */
- memcpy(&buf[6], &bts->gprs.nsvc[0].remote.u.sin6.sin6_addr, sizeof(struct in6_addr));
+ memcpy(&buf[6], &bts_sm->gprs.nsvc[0].remote.u.sin6.sin6_addr, sizeof(struct in6_addr));
msgb_tl16v_put(msgb, NM_ATT_OSMO_NS_LINK_CFG, 6 + sizeof(struct in6_addr), buf);
break;
case AF_INET:
/* remote udp port */
- memcpy(&buf[0], &bts->gprs.nsvc[0].remote.u.sin.sin_port, sizeof(uint16_t));
+ memcpy(&buf[0], &bts_sm->gprs.nsvc[0].remote.u.sin.sin_port, sizeof(uint16_t));
/* remote ip address */
- memcpy(&buf[2], &bts->gprs.nsvc[0].remote.u.sin.sin_addr, sizeof(struct in_addr));
+ memcpy(&buf[2], &bts_sm->gprs.nsvc[0].remote.u.sin.sin_addr, sizeof(struct in_addr));
/* local udp port */
- osmo_store16be(bts->gprs.nsvc[0].local_port, &buf[6]);
+ osmo_store16be(bts_sm->gprs.nsvc[0].local_port, &buf[6]);
msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_LINK_CFG, 8, buf);
break;
default: