Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/12867


Change subject: WIP: send proper OML alert in case of errors
......................................................................

WIP: send proper OML alert in case of errors

Change-Id: I5b19b82a4874617c7c584cf3eac55eb9c756710a
---
M src/common/oml.c
1 file changed, 15 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/12867/1

diff --git a/src/common/oml.c b/src/common/oml.c
index 82d12c7..6d44710 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1411,8 +1411,15 @@
                ret = oml_ipa_set_attr(bts, msg);
                break;
        default:
-               LOGP(DOML, LOGL_INFO, "Manufacturer Formatted O&M msg_type 
0x%02x\n",
-                       foh->msg_type);
+               trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+               if (trx) {
+                       oml_tx_failure_event_rep(&trx->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                                "unknown Manufacturer O&M 
msg_type 0x%02x",
+                                                foh->msg_type);
+               } else
+                       oml_tx_failure_event_rep(&bts->mo, 
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);
        }

@@ -1435,7 +1442,8 @@
        switch (oh->mdisc) {
        case ABIS_OM_MDISC_FOM:
                if (msgb_l2len(msg) < sizeof(*oh)) {
-                       LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too 
short\n");
+                       oml_tx_failure_event_rep(&bts->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                               "Formatted O&M message too 
short\n");
                        ret = -EIO;
                        break;
                }
@@ -1443,15 +1451,16 @@
                break;
        case ABIS_OM_MDISC_MANUF:
                if (msgb_l2len(msg) < sizeof(*oh)) {
-                       LOGP(DOML, LOGL_NOTICE, "Manufacturer O&M message too 
short\n");
+                       oml_tx_failure_event_rep(&bts->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                               "Manufacturer O&M message too 
short\n");
                        ret = -EIO;
                        break;
                }
                ret = down_mom(bts, msg);
                break;
        default:
-               LOGP(DOML, LOGL_NOTICE, "unknown OML msg_discr 0x%02x\n",
-                       oh->mdisc);
+               oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+                                        "unknown O&M msg_disc 0x%02x\n", 
oh->mdisc);
                ret = -EINVAL;
        }


--
To view, visit https://gerrit.osmocom.org/12867
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: I5b19b82a4874617c7c584cf3eac55eb9c756710a
Gerrit-Change-Number: 12867
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to