This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/14173
Change subject: Add severity to OML FAILURE EVENT REPORT
......................................................................
Add severity to OML FAILURE EVENT REPORT
Example: The fact that the PCU has connected with a given version is not
a *failure* in the first place, particularly not a MAJOR one. Let's
allow callers of oml_tx_failure_event_rep() specify the serverity of the
event that they're reporting to the BSC.
Change-Id: I49af04212568892648e0e8704ba1cc6de8c8ae89
---
M include/osmo-bts/oml.h
M src/common/bts.c
M src/common/bts_ctrl_commands.c
M src/common/l1sap.c
M src/common/main.c
M src/common/oml.c
M src/common/pcu_sock.c
M src/common/rsl.c
M src/osmo-bts-oc2g/calib_file.c
9 files changed, 49 insertions(+), 48 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/73/14173/1
diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h
index 5136058..14da70e 100644
--- a/include/osmo-bts/oml.h
+++ b/include/osmo-bts/oml.h
@@ -45,7 +45,7 @@
extern const unsigned int oml_default_t200_ms[7];
/* Transmit failure event report */
-int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, uint16_t cause_value,
- const char *fmt, ...);
+int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, enum abis_nm_severity severity,
+ uint16_t cause_value, const char *fmt, ...);
#endif // _OML_H */
diff --git a/src/common/bts.c b/src/common/bts.c
index 5220406..97e7a8b 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -340,7 +340,7 @@
else
rc = bts_model_trx_deact_rf(trx);
if (rc < 0) {
- oml_tx_failure_event_rep(&trx->bb_transc.mo, OSMO_EVT_MAJ_RSL_FAIL,
+ oml_tx_failure_event_rep(&trx->bb_transc.mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_RSL_FAIL,
link ?
"Failed to establish RSL link (%d)" :
"Failed to deactivate RF (%d)", rc);
diff --git a/src/common/bts_ctrl_commands.c b/src/common/bts_ctrl_commands.c
index 47d8a5d..0d31890 100644
--- a/src/common/bts_ctrl_commands.c
+++ b/src/common/bts_ctrl_commands.c
@@ -77,7 +77,7 @@
static int set_oml_alert(struct ctrl_cmd *cmd, void *data)
{
/* Note: we expect signal dispatch to be synchronous */
- oml_tx_failure_event_rep(&g_bts->mo, OSMO_EVT_EXT_ALARM, cmd->value);
+ oml_tx_failure_event_rep(&g_bts->mo, NM_SEVER_INDETERMINATE, OSMO_EVT_EXT_ALARM, cmd->value);
cmd->reply = "OK";
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 52f2b33..59d5b93 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1358,7 +1358,7 @@
default:
LOGP(DL1P, LOGL_NOTICE, "unknown prim %d op %d\n",
l1sap->oph.primitive, l1sap->oph.operation);
- oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&trx->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"unknown prim %d op %d",
l1sap->oph.primitive,
l1sap->oph.operation);
diff --git a/src/common/main.c b/src/common/main.c
index 0d84c18..25ecd11 100644
--- a/src/common/main.c
+++ b/src/common/main.c
@@ -184,7 +184,7 @@
case SIGTERM:
if (!quit) {
oml_tx_failure_event_rep(&bts->mo,
- OSMO_EVT_CRIT_PROC_STOP,
+ NM_SEVER_CRITICAL, OSMO_EVT_CRIT_PROC_STOP,
"BTS: SIGINT received -> shutdown");
bts_shutdown(bts, "SIGINT");
}
diff --git a/src/common/oml.c b/src/common/oml.c
index 67eb6d8..d44b395 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -81,8 +81,8 @@
}
/* 3GPP TS 12.21 § 8.8.2 */
-int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, uint16_t cause_value,
- const char *fmt, ...)
+int oml_tx_failure_event_rep(const struct gsm_abis_mo *mo, enum abis_nm_severity severity,
+ uint16_t cause_value, const char *fmt, ...)
{
struct msgb *nmsg;
va_list ap;
@@ -558,12 +558,14 @@
rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
if (rc < 0) {
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute parsing failure");
+ oml_tx_failure_event_rep(mo, NM_SEVER_MINOR, OSMO_EVT_MAJ_UNSUP_ATTR,
+ "Get Attribute parsing failure");
return oml_mo_fom_ack_nack(mo, NM_MT_GET_ATTR, NM_NACK_INCORR_STRUCT);
}
if (!TLVP_PRES_LEN(&tp, NM_ATT_LIST_REQ_ATTR, 1)) {
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR, "Get Attribute without Attribute List");
+ oml_tx_failure_event_rep(mo, NM_SEVER_MINOR, OSMO_EVT_MAJ_UNSUP_ATTR,
+ "Get Attribute without Attribute List");
return oml_mo_fom_ack_nack(mo, NM_MT_GET_ATTR, NM_NACK_INCORR_STRUCT);
}
@@ -588,7 +590,7 @@
rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
if (rc < 0) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UNSUP_ATTR,
"New value for Attribute not supported");
return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
}
@@ -597,7 +599,7 @@
if (TLVP_PRES_LEN(&tp, NM_ATT_BCCH_ARFCN, 2)) {
uint16_t arfcn = ntohs(tlvp_val16_unal(&tp, NM_ATT_BCCH_ARFCN));
if (arfcn > 1024) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_WARN_SW_WARN,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN,
"Given ARFCN %u is not supported",
arfcn);
LOGPFOH(DOML, LOGL_ERROR, foh, "Given ARFCN %u is not supported.\n", arfcn);
@@ -606,7 +608,7 @@
}
/* 9.4.52 Starting Time */
if (TLVP_PRESENT(&tp, NM_ATT_START_TIME)) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UNSUP_ATTR,
"NM_ATT_START_TIME Attribute not "
"supported");
return oml_fom_ack_nack(msg, NM_NACK_SPEC_IMPL_NOTSUPP);
@@ -756,7 +758,7 @@
rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
if (rc < 0) {
- oml_tx_failure_event_rep(&trx->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
+ oml_tx_failure_event_rep(&trx->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UNSUP_ATTR,
"New value for Set Radio Attribute not"
" supported");
return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
@@ -820,10 +822,8 @@
arfcn = ntohs(_value);
value += 2;
if (arfcn > 1024) {
- oml_tx_failure_event_rep(&trx->bts->mo,
- OSMO_EVT_WARN_SW_WARN,
- "Given ARFCN %u is unsupported",
- arfcn);
+ oml_tx_failure_event_rep(&trx->bts->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN,
+ "Given ARFCN %u is unsupported", arfcn);
LOGPFOH(DOML, LOGL_NOTICE, foh, "Given ARFCN %u is unsupported.\n", arfcn);
return oml_fom_ack_nack(msg, NM_NACK_FREQ_NOTAVAIL);
}
@@ -926,9 +926,8 @@
rc = oml_tlv_parse(&tp, foh->data, msgb_l3len(msg) - sizeof(*foh));
if (rc < 0) {
- oml_tx_failure_event_rep(&ts->mo, OSMO_EVT_MAJ_UNSUP_ATTR,
- "New value for Set Channel Attribute "
- "not supported");
+ oml_tx_failure_event_rep(&ts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UNSUP_ATTR,
+ "New value for Set Channel Attribute not supported");
return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
}
@@ -1073,7 +1072,8 @@
trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
if (trx)
mo = &trx->mo;
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UKWN_MSG, form, foh->obj_inst.bts_nr,
+ oml_tx_failure_event_rep(mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG, form,
+ foh->obj_inst.bts_nr,
get_value_string(abis_nm_msgtype_names, foh->msg_type));
return true;
@@ -1094,7 +1094,8 @@
trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
if (trx)
mo = &trx->mo;
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UKWN_MSG, "Formatted O&M message too short");
+ oml_tx_failure_event_rep(mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
+ "Formatted O&M message too short");
return -EIO;
}
@@ -1149,8 +1150,8 @@
trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
if (trx)
mo = &trx->mo;
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UKWN_MSG, "unknown Formatted O&M "
- "msg_type 0x%02x", foh->msg_type);
+ oml_tx_failure_event_rep(mo, NM_SEVER_MINOR, OSMO_EVT_MAJ_UKWN_MSG,
+ "unknown Formatted O&M msg_type 0x%02x", foh->msg_type);
ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL);
}
@@ -1317,9 +1318,8 @@
mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
if (!mo)
return oml_fom_ack_nack(msg, NM_NACK_OBJINST_UNKN);
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UNSUP_ATTR,
- "New value for IPAC Set Attribute not "
- "supported\n");
+ oml_tx_failure_event_rep(mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UNSUP_ATTR,
+ "New value for IPAC Set Attribute not supported\n");
return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
}
@@ -1392,13 +1392,13 @@
int ret;
if (msgb_l2len(msg) < sizeof(*foh)) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"Manufacturer O&M message too short\n");
return -EIO;
}
if (strncmp((char *)&oh->data[1], abis_nm_ipa_magic, idstrlen)) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"Manufacturer OML message != ipaccess not supported\n");
return -EINVAL;
}
@@ -1437,8 +1437,8 @@
trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
if (trx)
mo = &trx->mo;
- oml_tx_failure_event_rep(mo, OSMO_EVT_MAJ_UKWN_MSG, "unknown Manufacturer O&M "
- "msg_type 0x%02x", foh->msg_type);
+ oml_tx_failure_event_rep(mo, NM_SEVER_MINOR, OSMO_EVT_MAJ_UKWN_MSG,
+ "unknown Manufacturer O&M msg_type 0x%02x", foh->msg_type);
ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL);
}
@@ -1452,7 +1452,7 @@
int ret = 0;
if (msgb_l2len(msg) < sizeof(*oh)) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"OML message too short\n");
msgb_free(msg);
return -EIO;
@@ -1461,14 +1461,14 @@
/* We don't implement de-segmentation of segmented OML messages */
if (oh->placement != ABIS_OM_PLACEMENT_ONLY || oh->sequence != 0) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"Unsupported segmented O&M message\n");
msgb_free(msg);
return -EIO;
}
if (msgb_l3len(msg) < oh->length) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"Short OML message: %u < %u\n",
msgb_l3len(msg), oh->length);
msgb_free(msg);
@@ -1478,7 +1478,7 @@
switch (oh->mdisc) {
case ABIS_OM_MDISC_FOM:
if (msgb_l2len(msg) < sizeof(*oh)) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"Formatted O&M message too short\n");
ret = -EIO;
break;
@@ -1487,7 +1487,7 @@
break;
case ABIS_OM_MDISC_MANUF:
if (msgb_l2len(msg) < sizeof(*oh)) {
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, OSMO_EVT_MAJ_UKWN_MSG,
"Manufacturer O&M message too short\n");
ret = -EIO;
break;
@@ -1495,7 +1495,7 @@
ret = down_mom(bts, msg);
break;
default:
- oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+ oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MINOR, OSMO_EVT_MAJ_UKWN_MSG,
"unknown O&M msg_disc 0x%02x\n", oh->mdisc);
ret = -EINVAL;
}
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 31097ba..a20a7fc 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -595,7 +595,7 @@
case PCU_VERSION:
LOGP(DPCU, LOGL_INFO, "OsmoPCU version %s connected\n",
txt->text);
- oml_tx_failure_event_rep(&bts->gprs.cell.mo, OSMO_EVT_PCU_VERS, txt->text);
+ oml_tx_failure_event_rep(&bts->gprs.cell.mo, NM_SEVER_MINOR, OSMO_EVT_PCU_VERS, txt->text);
osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH);
if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_13))
@@ -604,7 +604,8 @@
LOGP(DPCU, LOGL_INFO, "SI13 is not available on PCU connection\n");
break;
case PCU_OML_ALERT:
- oml_tx_failure_event_rep(&bts->gprs.cell.mo, OSMO_EVT_EXT_ALARM, txt->text);
+ oml_tx_failure_event_rep(&bts->gprs.cell.mo, NM_SEVER_INDETERMINATE, OSMO_EVT_EXT_ALARM,
+ txt->text);
break;
default:
LOGP(DPCU, LOGL_ERROR, "Unknown TXT_IND type %u received\n",
@@ -731,7 +732,7 @@
bts = llist_entry(state->net->bts_list.next, struct gsm_bts, list);
LOGP(DPCU, LOGL_NOTICE, "PCU socket has LOST connection\n");
- oml_tx_failure_event_rep(&bts->gprs.cell.mo, OSMO_EVT_PCU_VERS,
+ oml_tx_failure_event_rep(&bts->gprs.cell.mo, NM_SEVER_MAJOR, OSMO_EVT_PCU_VERS,
"PCU socket has LOST connection");
bts->pcu_version[0] = '\0';
diff --git a/src/common/rsl.c b/src/common/rsl.c
index cc653ce..92575b5 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -471,8 +471,8 @@
if (rc < 0) {
/* FIXME: notfiy the BSC on other errors? */
if (rc == -ENOSPC) {
- oml_tx_failure_event_rep(&trx->bts->mo, OSMO_EVT_MIN_PAG_TAB_FULL,
- "BTS paging table is full");
+ oml_tx_failure_event_rep(&trx->bts->mo, NM_SEVER_WARNING,
+ OSMO_EVT_MIN_PAG_TAB_FULL, "BTS paging table is full");
}
}
@@ -2013,7 +2013,7 @@
if (!lchan->abis_ip.rtp_socket) {
LOGPLCHAN(lchan, DRTP, LOGL_ERROR, "IPAC Failed to create RTP/RTCP sockets\n");
oml_tx_failure_event_rep(&lchan->ts->trx->mo,
- OSMO_EVT_CRIT_RTP_TOUT,
+ NM_SEVER_MINOR, OSMO_EVT_CRIT_RTP_TOUT,
"%s IPAC Failed to create RTP/RTCP sockets",
gsm_lchan_name(lchan));
return tx_ipac_XXcx_nack(lchan, RSL_ERR_RES_UNAVAIL,
@@ -2050,7 +2050,7 @@
if (rc < 0) {
LOGPLCHAN(lchan, DRTP, LOGL_ERROR, "IPAC Failed to bind RTP/RTCP sockets\n");
oml_tx_failure_event_rep(&lchan->ts->trx->mo,
- OSMO_EVT_CRIT_RTP_TOUT,
+ NM_SEVER_MINOR, OSMO_EVT_CRIT_RTP_TOUT,
"%s IPAC Failed to bind RTP/RTCP sockets",
gsm_lchan_name(lchan));
osmo_rtp_socket_free(lchan->abis_ip.rtp_socket);
diff --git a/src/osmo-bts-oc2g/calib_file.c b/src/osmo-bts-oc2g/calib_file.c
index 72ec266..6d2d561 100644
--- a/src/osmo-bts-oc2g/calib_file.c
+++ b/src/osmo-bts-oc2g/calib_file.c
@@ -134,7 +134,7 @@
st->fp = fopen(fname, "rb");
if (!st->fp) {
LOGP(DL1C, LOGL_FATAL, "Failed to open '%s' for calibration data.\n", fname);
- oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, OSMO_EVT_WARN_SW_WARN,
+ oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN,
"Failed to open '%s' for calibration data", fname);
return -1;
}
@@ -221,7 +221,7 @@
rc = calib_verify(fl1h, desc);
if (rc < 0) {
LOGP(DL1C, LOGL_FATAL, "Verify L1 calibration table %s -> failed (%d)\n", desc->fname, rc);
- oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, OSMO_EVT_WARN_SW_WARN,
+ oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN,
"Verify L1 calibration table %s -> failed (%d)", desc->fname, rc);
st->last_file_idx = get_next_calib_file_idx(fl1h, st->last_file_idx);
@@ -278,7 +278,7 @@
if (!calib_path) {
LOGP(DL1C, LOGL_FATAL, "Calibration file path not specified\n");
- oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, OSMO_EVT_WARN_SW_WARN,
+ oml_tx_failure_event_rep(&fl1h->phy_inst->trx->mo, NM_SEVER_MAJOR, OSMO_EVT_WARN_SW_WARN,
"Calibration file path not specified");
return -1;
}
--
To view, visit https://gerrit.osmocom.org/14173
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I49af04212568892648e0e8704ba1cc6de8c8ae89
Gerrit-Change-Number: 14173
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190525/5381a159/attachment.htm>