aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-03-10 17:10:59 +0100
committerHarald Welte <laforge@gnumonks.org>2017-04-10 06:57:39 +0000
commitdafb3635333d3754864de86cb89d78ee5bf0c013 (patch)
treeb3784681ec0d245fc26064541aa7da1e80ede0a0 /src/common
parentbbe90fd6511c9a0abdb5f41d13c5ab0135b903f7 (diff)
Handle TXT indication from OsmoPCU
* handle OML message * handle OsmoPCU version message * show stored PCU version in 'show bts ..' vty command Requires OpenBSc with I6710d53115f34634a7b70969cc05fd5c72ff8ab2. Change-Id: I16e73198501487a5b1076bf83390b85538d5af73 Related: OS#1614, 1615
Diffstat (limited to 'src/common')
-rw-r--r--src/common/pcu_sock.c25
-rw-r--r--src/common/vty.c3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 85bc8806..fa2c5851 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -538,6 +538,28 @@ static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type,
return rc;
}
+static int pcu_rx_txt_ind(struct gsm_bts *bts,
+ struct gsm_pcu_if_txt_ind *txt)
+{
+ switch (txt->type) {
+ case PCU_VERSION:
+ LOGP(DPCU, LOGL_INFO, "OsmoPCU version %s connected\n",
+ txt->text);
+ osmo_signal_dispatch(SS_FAIL, OSMO_EVT_PCU_VERS, txt->text);
+ osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH);
+ break;
+ case PCU_OML_ALERT:
+ osmo_signal_dispatch(SS_FAIL, OSMO_EVT_EXT_ALARM, txt->text);
+ break;
+ default:
+ LOGP(DPCU, LOGL_ERROR, "Unknown TXT_IND type %u received\n",
+ txt->type);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
static int pcu_rx_act_req(struct gsm_bts *bts,
struct gsm_pcu_if_act_req *act_req)
{
@@ -586,6 +608,9 @@ static int pcu_rx(struct gsm_network *net, uint8_t msg_type,
case PCU_IF_MSG_ACT_REQ:
rc = pcu_rx_act_req(bts, &pcu_prim->u.act_req);
break;
+ case PCU_IF_MSG_TXT_IND:
+ rc = pcu_rx_txt_ind(bts, &pcu_prim->u.txt_ind);
+ break;
default:
LOGP(DPCU, LOGL_ERROR, "Received unknwon PCU msg type %d\n",
msg_type);
diff --git a/src/common/vty.c b/src/common/vty.c
index 3f736c97..a48f8095 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -744,6 +744,9 @@ static void bts_dump_vty(struct vty *vty, struct gsm_bts *bts)
net_dump_nmstate(vty, &bts->mo.nm_state);
vty_out(vty, " Site Mgr NM State: ");
net_dump_nmstate(vty, &bts->site_mgr.mo.nm_state);
+ if (strnlen(bts->pcu_version, MAX_VERSION_LENGTH))
+ vty_out(vty, " PCU version %s connected%s",
+ bts->pcu_version, VTY_NEWLINE);
vty_out(vty, " Paging: Queue size %u, occupied %u, lifetime %us%s",
paging_get_queue_max(btsb->paging_state), paging_queue_length(btsb->paging_state),
paging_get_lifetime(btsb->paging_state), VTY_NEWLINE);