Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-19 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..

bssap: Handle BSSMAP CONFUSION message.

We decode the mesage and print it to the log files at ERROR log level.
We also count it in the BSSMAP message counters. There is not much
else we could do about it.

Depends: If8afd2d096fb66c6c2f255a08fc1129de3d09cec (libosmocore)
Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
---
M TODO-RELEASE
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
4 files changed, 59 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  neels: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/TODO-RELEASE b/TODO-RELEASE
index dde4b72..e2fa427 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,3 +8,6 @@
 # If any interfaces have been removed or changed since the last public 
release: c:r:0.
 #library   whatdescription / commit summary line
 manual needs common chapter cs7-config.adoc from 
osmo-gsm-manuals > 0.3.0
+libosmocorestruct gsm0808_diagnostics  Depends on libosmocore > 1.3.0
+libosmocoregsm0808_diagnostics_octet_location_str()Depends on 
libosmocore > 1.3.0
+libosmocoregsm0808_diagnostics_bit_location_str()  Depends on libosmocore 
> 1.3.0
diff --git a/include/osmocom/bsc/bsc_msc_data.h 
b/include/osmocom/bsc/bsc_msc_data.h
index 74a6f3c..fc816b4 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -69,6 +69,7 @@
MSC_CTR_BSSMAP_RX_DT1_LCLS_CONNECT_CTRL,
MSC_CTR_BSSMAP_RX_DT1_HANDOVER_CMD,
MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST,
+   MSC_CTR_BSSMAP_RX_DT1_CONFUSION,
MSC_CTR_BSSMAP_RX_DT1_UNKNOWN,
MSC_CTR_BSSMAP_RX_DT1_DTAP,
MSC_CTR_BSSMAP_RX_DT1_DTAP_ERROR,
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index ddebb6a..388ad14 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -1006,6 +1006,56 @@
return -EINVAL;
 }

+/* Handle Confusion message, MSC indicating an error to us:
+ *
+ * See 3GPP TS 48.008 §3.2.1.45
+ */
+static int bssmap_handle_confusion(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, unsigned int length)
+{
+   struct tlv_parsed tp;
+   int diag_len;
+   enum gsm0808_cause cause;
+   enum gsm0808_cause_class cause_class;
+   struct gsm0808_diagnostics *diag;
+
+   osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1);
+
+   /* Check for the Cause and Diagnostic mandatory elements */
+   if (!TLVP_PRESENT(&tp, GSM0808_IE_CAUSE) || !TLVP_PRESENT(&tp, 
GSM0808_IE_DIAGNOSTIC)) {
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received BSSMAP Confusion message,"
+" but either Cause or Diagnostic mandatory IE is not 
present: %s\n",
+osmo_hexdump(msg->l4h, length));
+   return -EINVAL;
+   }
+
+   diag_len = TLVP_LEN(&tp, GSM0808_IE_DIAGNOSTIC);
+   if (diag_len < 5) {
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received BSSMAP Confusion message with short 
Diagnostic length: %d (expected > 5)\n",
+diag_len);
+   return -EINVAL;
+   }
+
+   cause = gsm0808_get_cause(&tp);
+   cause_class = gsm0808_cause_class(cause);
+   diag = (struct gsm0808_diagnostics *)TLVP_VAL(&tp, 
GSM0808_IE_DIAGNOSTIC);
+
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received BSSMAP Confusion: class 0x%x (%s), cause 0x%x (%s), "
+"error octet %d (%s), error bit %d (%s), original message: 
%s\n",
+cause_class, gsm0808_cause_class_name(cause_class),
+cause, gsm0808_cause_name(cause),
+diag->error_pointer_octet,
+
gsm0808_diagnostics_octet_location_str(diag->error_pointer_octet),
+diag->error_pointer_bit,
+gsm0808_diagnostics_bit_location_str(diag->error_pointer_bit),
+osmo_hexdump(diag->msg, diag_len-2));
+
+   return 0;
+}
+
 static int bssmap_rcvmsg_udt(struct bsc_msc_data *msc,
 struct msgb *msg, unsigned int length)
 {
@@ -1082,6 +1132,10 @@
rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST]);
ret = gsm48_send_rr_classmark_enquiry(conn->lchan);
break;
+   case BSS_MAP_MSG_CONFUSION:
+   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_CONFUSION]);
+   ret = bssmap_handle_confusion(conn, msg, length);
+   break;
default:
rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_UNKNOWN]);
LOGP(DMSC, LOGL_NOTICE, "Unimpl

Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-19 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 11: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 11
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 19 May 2020 20:00:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-19 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 11:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG@13
PS10, Line 13: Requires:  libosmocore.git Change-Id 
If8afd2d096fb66c6c2f255a08fc1129de3d09cec
> interesting, all I ever see is "Depends:" ... […]
I am just confused from writing debian packaging, where it's "Requires:".  In 
any case, the syntax is not the most important part here, but the fact that we 
mention there is some kind of dependency.  We don't have any automatic tools 
processing those messages.  And before we introduce some kind of automatic 
syntax checker for commit messages we cannot rely on people writing it the 
"right" way anyway...



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 11
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 19 May 2020 19:58:16 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: ipse 
Comment-In-Reply-To: neels 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-19 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 11: Code-Review+1

(1 comment)

nice

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG@13
PS10, Line 13: Requires:  libosmocore.git Change-Id 
If8afd2d096fb66c6c2f255a08fc1129de3d09cec
> This was suggested by Harald but ok, I've changed it
interesting, all I ever see is "Depends:" ... maybe I've missed some new policy?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 11
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Tue, 19 May 2020 14:17:29 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: ipse 
Comment-In-Reply-To: neels 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-18 Thread ipse
Hello pespin, neels, laforge, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bsc/+/18232

to look at the new patch set (#11).

Change subject: bssap: Handle BSSMAP CONFUSION message.
..

bssap: Handle BSSMAP CONFUSION message.

We decode the mesage and print it to the log files at ERROR log level.
We also count it in the BSSMAP message counters. There is not much
else we could do about it.

Depends: If8afd2d096fb66c6c2f255a08fc1129de3d09cec (libosmocore)
Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
---
M TODO-RELEASE
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
4 files changed, 59 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/18232/11
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 11
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-18 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 10:

(4 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG@13
PS10, Line 13: Requires:  libosmocore.git Change-Id 
If8afd2d096fb66c6c2f255a08fc1129de3d09cec
> we're commonly using 'Depends:' instead. […]
This was suggested by Harald but ok, I've changed it


https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG@14
PS10, Line 14:
> (and we usually don't have a blank line here)
Ack


https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10/src/osmo-bsc/osmo_bsc_bssap.c
File src/osmo-bsc/osmo_bsc_bssap.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10/src/osmo-bsc/osmo_bsc_bssap.c@1027
PS10, Line 1027: "Received Confusion message,"
> please state "BSSMAP" as in "BSSMAP Confusion message", otherwise it is 
> confusing. […]
Ack


https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10/src/osmo-bsc/osmo_bsc_bssap.c@1064
PS10, Line 1064: osmo_hexdump(diag->msg, diag_len-2));
> Please don't spam the error log like this, I'd much prefer combining these 
> several bits of informati […]
Ok, see the new patchset.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 10
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 18 May 2020 21:03:54 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-18 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 10: Code-Review-1

(4 comments)

(-1 for error log verbosity)

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG@13
PS10, Line 13: Requires:  libosmocore.git Change-Id 
If8afd2d096fb66c6c2f255a08fc1129de3d09cec
we're commonly using 'Depends:' instead.

  Depends: If8afd2d096fb66c6c2f255a08fc1129de3d09cec (libosmocore)


https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10//COMMIT_MSG@14
PS10, Line 14:
(and we usually don't have a blank line here)


https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10/src/osmo-bsc/osmo_bsc_bssap.c
File src/osmo-bsc/osmo_bsc_bssap.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10/src/osmo-bsc/osmo_bsc_bssap.c@1027
PS10, Line 1027: "Received Confusion message,"
please state "BSSMAP" as in "BSSMAP Confusion message", otherwise it is 
confusing.
... or does the FSM id already say "BSSMAP"? Anyway, it could still be confused 
for some internal event, let's rather name BSSMAP.

Same below.


https://gerrit.osmocom.org/c/osmo-bsc/+/18232/10/src/osmo-bsc/osmo_bsc_bssap.c@1064
PS10, Line 1064: osmo_hexdump(diag->msg, diag_len-2));
Please don't spam the error log like this, I'd much prefer combining these 
several bits of information on *one* log line. Especially the ERROR log is very 
strong in punching through silent logging configuration, so this should be as 
unobtrusive as possible (while still reflecting the interesting information). 
I'm thinking like

  Rx BSSMAP Confusion: class 0x23 cause 0x42 msg  octet 23 (string) bit 3 
(string)



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 10
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 18 May 2020 17:13:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-17 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 10: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 10
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sun, 17 May 2020 22:32:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-17 Thread ipse
Hello pespin, laforge, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bsc/+/18232

to look at the new patch set (#9).

Change subject: bssap: Handle BSSMAP CONFUSION message.
..

bssap: Handle BSSMAP CONFUSION message.

We decode the mesage and print it to the log files at ERROR log level.
We also count it in the BSSMAP message counters. There is not much
else we could do about it.

Requires:  libosmocore.git Change-Id If8afd2d096fb66c6c2f255a08fc1129de3d09cec

Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
---
M TODO-RELEASE
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
4 files changed, 69 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/18232/9
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 9
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-16 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 8: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/8/TODO-RELEASE
File TODO-RELEASE:

https://gerrit.osmocom.org/c/osmo-bsc/+/18232/8/TODO-RELEASE@11
PS8, Line 11: libosmocore   struct gsm0808_diagnostics  Depends on 
"gsm0808: Implement helper functions for CONFUSION BSSMAP message decoding." 
commit
Please, in description use: "Depends on libosmocore > 1.3.0".



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 8
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sat, 16 May 2020 22:36:19 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-16 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 8:

> Patch Set 6: Code-Review+1
>
> please add a "Requres: libosmocore.git $Change-Id" as it requires a specific 
> chane-id in libosmocore.

Added and updated TODO-RELEASE


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 8
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 16 May 2020 22:10:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-16 Thread ipse
Hello laforge, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bsc/+/18232

to look at the new patch set (#8).

Change subject: bssap: Handle BSSMAP CONFUSION message.
..

bssap: Handle BSSMAP CONFUSION message.

We decode the mesage and print it to the log files at ERROR log level.
We also count it in the BSSMAP message counters. There is not much
else we could do about it.

Requires:  libosmocore.git Change-Id If8afd2d096fb66c6c2f255a08fc1129de3d09cec

Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
---
M TODO-RELEASE
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
4 files changed, 67 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/18232/8
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 8
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-16 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 6: Code-Review+1

please add a "Requres: libosmocore.git $Change-Id" as it requires a specific 
chane-id in libosmocore.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 6
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 16 May 2020 20:12:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-12 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )

Change subject: bssap: Handle BSSMAP CONFUSION message.
..


Patch Set 1:

I guess this will fail until the libosmocore changes hit the master


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18232
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
Gerrit-Change-Number: 18232
Gerrit-PatchSet: 1
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse 
Gerrit-Comment-Date: Tue, 12 May 2020 21:54:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bssap: Handle BSSMAP CONFUSION message.

2020-05-12 Thread ipse
ipse has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/18232 )


Change subject: bssap: Handle BSSMAP CONFUSION message.
..

bssap: Handle BSSMAP CONFUSION message.

We decode the mesage and print it to the log files at ERROR log level.
We also count it in the BSSMAP message counters. There is not much
else we could do about it.

Change-Id: Ib4cd94f185f751b238484678ff671ac413c4
---
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_msc.c
3 files changed, 66 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/18232/1

diff --git a/include/osmocom/bsc/bsc_msc_data.h 
b/include/osmocom/bsc/bsc_msc_data.h
index 74a6f3c..fc816b4 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -69,6 +69,7 @@
MSC_CTR_BSSMAP_RX_DT1_LCLS_CONNECT_CTRL,
MSC_CTR_BSSMAP_RX_DT1_HANDOVER_CMD,
MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST,
+   MSC_CTR_BSSMAP_RX_DT1_CONFUSION,
MSC_CTR_BSSMAP_RX_DT1_UNKNOWN,
MSC_CTR_BSSMAP_RX_DT1_DTAP,
MSC_CTR_BSSMAP_RX_DT1_DTAP_ERROR,
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 6f5aaa8..edc313b 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -1006,6 +1006,66 @@
return -EINVAL;
 }

+/* Handle Confusion message, MSC indicating an error to us:
+ *
+ * See 3GPP TS 48.008 §3.2.1.45
+ */
+static int bssmap_handle_confusion(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, unsigned int length)
+{
+   struct tlv_parsed tp;
+   int diag_len;
+   enum gsm0808_cause cause;
+   enum gsm0808_cause_class cause_class;
+   struct gsm0808_diagnostics *diag;
+
+   osmo_bssap_tlv_parse(&tp, msg->l4h + 1, length - 1);
+
+   /* Check for the Cause and Diagnostic mandatory elements */
+   if (!TLVP_PRESENT(&tp, GSM0808_IE_CAUSE) || !TLVP_PRESENT(&tp, 
GSM0808_IE_DIAGNOSTIC)) {
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received Confusion message,"
+" but either Cause or Diagnostic mandatory IE is not 
present: %s\n",
+osmo_hexdump(msg->l4h, length));
+   return -EINVAL;
+   }
+
+   diag_len = TLVP_LEN(&tp, GSM0808_IE_DIAGNOSTIC);
+   if (diag_len < 5) {
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received Confusion message with short Diagnostic 
length: %d (expected > 5)\n",
+diag_len);
+   return -EINVAL;
+   }
+
+   cause = gsm0808_get_cause(&tp);
+   cause_class = gsm0808_cause_class(cause);
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received Confusion message: Cause %d/0x%x (%s)",
+cause, cause, gsm0808_cause_name(cause));
+   LOGPFSML(conn->fi, LOGL_ERROR,
+"Received Confusion message: Cause class %d/0x%x (%s)",
+cause_class, cause_class, 
gsm0808_cause_class_name(cause_class));
+
+   diag = (struct gsm0808_diagnostics *)TLVP_VAL(&tp, 
GSM0808_IE_DIAGNOSTIC);
+   /* octet location */
+   LOGPFSML(conn->fi, LOGL_ERROR,
+" Confusion Diagnostics error octet location %d (%s)\n",
+diag->error_pointer_octet,
+
gsm0808_diagnostics_octet_location_str(diag->error_pointer_octet));
+   /* bit location */
+   LOGPFSML(conn->fi, LOGL_ERROR,
+" Confusion Diagnostics error bit location: %d (%s)\n",
+diag->error_pointer_bit,
+gsm0808_diagnostics_bit_location_str(diag->error_pointer_bit));
+   /* received message dump */
+   LOGPFSML(conn->fi, LOGL_ERROR,
+" Confusion Diagnostics message that provoked the error: 
%s\n",
+osmo_hexdump(diag->msg, diag_len-2));
+
+   return 0;
+}
+
 static int bssmap_rcvmsg_udt(struct bsc_msc_data *msc,
 struct msgb *msg, unsigned int length)
 {
@@ -1082,6 +1142,10 @@
rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_CLASSMARK_RQST]);
ret = gsm48_send_rr_classmark_enquiry(conn->lchan);
break;
+   case BSS_MAP_MSG_CONFUSION:
+   rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_CONFUSION]);
+   ret = bssmap_handle_confusion(conn, msg, length);
+   break;
default:
rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DT1_UNKNOWN]);
LOGP(DMSC, LOGL_NOTICE, "Unimplemented msg type: %s\n",
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index db3ffe4..e58ff7f 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -55,6 +55,7 @@
[MSC_CTR_BSSMAP_RX_DT1_LCLS_CONNECT_CTRL] = 
{"bssmap:rx:dt1:lcls_connect_ctrl: