Change in libosmo-sccp[master]: ipa: VTY config option to explicitly enable/disable SCCP patching

2019-10-19 Thread laforge
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmo-sccp/+/15814

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

Change subject: ipa: VTY config option to explicitly enable/disable SCCP 
patching
..

ipa: VTY config option to explicitly enable/disable SCCP patching

When receiving SCCP messages from an IPA peer/ASP, osmo-stp so far
unconditionally inserted origin/destination point codes int the SCCP
called / calling party addresses.

This behaviro is now made optional with the introduction of the
following per-AS configuration:
"point-code override patch-sccp (disabled|both)"

The default behavior is switched from 'both' to 'disabled' at the same
time.

Change-Id: I535e2170adadfe755d2bcbf5bbf4556bebb77737
Closes: OS#4219
---
M include/osmocom/sigtran/osmo_ss7.h
M src/ipa.c
M src/osmo_ss7_vty.c
M tests/vty/ss7_asp_test.vty
4 files changed, 41 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/14/15814/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15814
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I535e2170adadfe755d2bcbf5bbf4556bebb77737
Gerrit-Change-Number: 15814
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmo-sccp[master]: ipa: VTY config option to explicitly enable/disable SCCP patching

2019-10-19 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15814 )


Change subject: ipa: VTY config option to explicitly enable/disable SCCP 
patching
..

ipa: VTY config option to explicitly enable/disable SCCP patching

When receiving SCCP messages from an IPA peer/ASP, osmo-stp so far
unconditionally inserted origin/destination point codes int the SCCP
called / calling party addresses.

This behaviro is now made optional with the introduction of the
following per-AS configuration:
"point-code override patch-sccp (disabled|both)"

The default behavior is switched from 'both' to 'disabled' at the same
time.

Change-Id: I535e2170adadfe755d2bcbf5bbf4556bebb77737
Closes: OS#4219
---
M include/osmocom/sigtran/osmo_ss7.h
M src/ipa.c
M src/osmo_ss7_vty.c
3 files changed, 40 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/14/15814/1

diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index 14e2b7c..d6ae1d4 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -290,6 +290,11 @@

 int osmo_ss7_asp_protocol_port(enum osmo_ss7_asp_protocol prot);

+enum osmo_ss7_as_patch_sccp_mode {
+   OSMO_SS7_PATCH_NONE,/* no patching of SCCP */
+   OSMO_SS7_PATCH_BOTH,/* patch both OPC and DPC into SCCP addresses */
+};
+
 struct osmo_ss7_as {
/*! entry in 'ref osmo_ss7_instance.as_list */
struct llist_head list;
@@ -314,6 +319,7 @@
uint8_t qos_class;
struct {
uint32_t dpc;
+   enum osmo_ss7_as_patch_sccp_mode sccp_mode;
} pc_override;

struct osmo_ss7_asp *asps[16];
diff --git a/src/ipa.c b/src/ipa.c
index eeefbe8..d7a929d 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -260,10 +260,12 @@
}

/* Second, patch this into the SCCP message */
-   msg = patch_sccp_with_pc(asp, msg, opc, dpc);
-   if (!msg) {
-   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to patch PC into SCCP 
message; dropping\n");
-   return -1;
+   if (as->cfg.pc_override.sccp_mode == OSMO_SS7_PATCH_BOTH) {
+   msg = patch_sccp_with_pc(asp, msg, opc, dpc);
+   if (!msg) {
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to patch PC 
into SCCP message; dropping\n");
+   return -1;
+   }
}

/* Third, create a MTP3/M3UA label with those point codes */
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index cc53b05..35ee5cd 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -932,6 +932,30 @@
return CMD_SUCCESS;
 }

+DEFUN(as_pc_patch_sccp, as_pc_patch_sccp_cmd,
+   "point-code override patch-sccp (disabled|both)",
+   "Point Code Specific Features\n"
+   "Override (force) a point-code to hard-coded value\n"
+   "Patch point code values into SCCP called/calling address\n"
+   "Don't patch any point codes into SCCP called/calling address\n"
+   "Patch both origin and destination point codes into SCCP called/calling 
address\n")
+{
+   struct osmo_ss7_as *as = vty->index;
+
+   if (as->cfg.proto != OSMO_SS7_ASP_PROT_IPA) {
+   vty_out(vty, "Only IPA type AS support point-code 
patch-into-sccp. "
+   "Be happy that you don't need it!%s", VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+
+   if (!strcmp(argv[0], "disabled"))
+   as->cfg.pc_override.sccp_mode = OSMO_SS7_PATCH_NONE;
+   else
+   as->cfg.pc_override.sccp_mode = OSMO_SS7_PATCH_BOTH;
+
+   return CMD_SUCCESS;
+}
+
 static void write_one_as(struct vty *vty, struct osmo_ss7_as *as)
 {
struct osmo_ss7_routing_key *rkey;
@@ -973,6 +997,9 @@
if (as->cfg.pc_override.dpc)
vty_out(vty, "  point-code override dpc %s%s",
osmo_ss7_pointcode_print(as->inst, 
as->cfg.pc_override.dpc), VTY_NEWLINE);
+
+   if (as->cfg.pc_override.sccp_mode)
+   vty_out(vty, "  point-code override patch-sccp both%s", 
VTY_NEWLINE);
 }

 DEFUN(show_cs7_as, show_cs7_as_cmd,
@@ -1807,6 +1834,7 @@
install_element(L_CS7_AS_NODE, _rout_key_ssn_cmd);
install_element(L_CS7_AS_NODE, _rout_key_si_ssn_cmd);
install_element(L_CS7_AS_NODE, _pc_override_cmd);
+   install_element(L_CS7_AS_NODE, _pc_patch_sccp_cmd);

vty_init_addr();
 }

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15814
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I535e2170adadfe755d2bcbf5bbf4556bebb77737
Gerrit-Change-Number: 15814
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in libosmo-sccp[master]: ipa: Fix crash when parsing of received IPA SCCP message fails

2019-10-19 Thread laforge
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmo-sccp/+/15813

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

Change subject: ipa: Fix crash when parsing of received IPA SCCP message fails
..

ipa: Fix crash when parsing of received IPA SCCP message fails

If an IPA ASP is sending us a SCCP message that cannot be parsed,
we shouldn't crash but handle this gracefully.

Change-Id: Ib7a8c2a36dd1b82ca8ed472760c1682ede50cb90
Fixes: OS#4236
---
M src/ipa.c
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/15813/3
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15813
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a8c2a36dd1b82ca8ed472760c1682ede50cb90
Gerrit-Change-Number: 15813
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmo-sccp[master]: ipa: Fix crash when parsing of received IPA SCCP message fails

2019-10-19 Thread laforge
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmo-sccp/+/15813

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

Change subject: ipa: Fix crash when parsing of received IPA SCCP message fails
..

ipa: Fix crash when parsing of received IPA SCCP message fails

If an IPA ASP is sending us a SCCP message that cannot be parsed,
we shouldn't crash but handle this gracefully.

While at it, also add some more logging to various realted error paths.

Change-Id: Ib7a8c2a36dd1b82ca8ed472760c1682ede50cb90
Fixes: OS#4236
---
M src/ipa.c
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/15813/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15813
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a8c2a36dd1b82ca8ed472760c1682ede50cb90
Gerrit-Change-Number: 15813
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in libosmo-sccp[master]: ipa: Fix crash when parsing of received IPA SCCP message fails

2019-10-19 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15813 )


Change subject: ipa: Fix crash when parsing of received IPA SCCP message fails
..

ipa: Fix crash when parsing of received IPA SCCP message fails

If an IPA ASP is sending us a SCCP message that cannot be parsed,
we shouldn't crash but handle this gracefully.

While at it, also add some more logging to various realted error paths.

Change-Id: Ib7a8c2a36dd1b82ca8ed472760c1682ede50cb90
Fixes: OS#4236
---
M src/ipa.c
1 file changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/15813/1

diff --git a/src/ipa.c b/src/ipa.c
index d013916..bae88ac 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -178,6 +178,7 @@
xua_msg_add_sccp_addr(sua, SUA_IEI_DEST_ADDR, );
break;
case -ENODEV: /* no destination address in message */
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "No destinatin address in 
SUA\n");
break;
default: /* some other error */
xua_msg_free(sua);
@@ -196,6 +197,7 @@
xua_msg_add_sccp_addr(sua, SUA_IEI_SRC_ADDR, );
break;
case -ENODEV: /* no source address in message */
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "No source address in SUA\n");
break;
default: /* some other error */
xua_msg_free(sua);
@@ -204,6 +206,8 @@

/* re-encode SUA to SCCP and return */
sccp_msg_out = osmo_sua_to_sccp(sua);
+   if (!sccp_msg_out)
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Couldn't re-encode SUA to 
SCCP\n");
xua_msg_free(sua);
return sccp_msg_out;
 }
@@ -259,6 +263,10 @@

/* Second, patch this into the SCCP message */
msg = patch_sccp_with_pc(asp, msg, opc, dpc);
+   if (!msg) {
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to patch PC into SCCP 
message; dropping\n");
+   return -1;
+   }

/* Third, create a MTP3/M3UA label with those point codes */
memset(_hdr, 0, sizeof(data_hdr));

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15813
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a8c2a36dd1b82ca8ed472760c1682ede50cb90
Gerrit-Change-Number: 15813
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in osmo-bts[master]: osmo-bts-trx/scheduler: refactor the first frame number calculation

2019-10-19 Thread fixeria
Hello dexter, pespin, ipse, laforge, Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-bts/+/15812

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

Change subject: osmo-bts-trx/scheduler: refactor the first frame number 
calculation
..

osmo-bts-trx/scheduler: refactor the first frame number calculation

In I6bc511223069f66b49109d3267bee7bd89585713 we have introduced
the storage for Uplink measurements (so called "history"), where
we can also store TDMA frame numbers of the related bursts.

This approach allows to look up frame number of the first Uplink
burst of a decoded block from the history. Thus neither we need
to store frame number of bid=0 in the logical channel state,
nor use complicated and buggy formulas.

This is not a silver bullet, because in some cases the measurement
history may be incomplete (until we start handling NOPE.ind from
the transceiver, see OS#3428). In such cases we would still need
to look up the first frame number using the block mapping tables
defined in 3GPP TS 45.002.

Change-Id: Iae9a0135595b0c56752723669a4ed2fc91f25785
Related: OS#3803
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/scheduler_trx.c
2 files changed, 58 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/12/15812/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/15812
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iae9a0135595b0c56752723669a4ed2fc91f25785
Gerrit-Change-Number: 15812
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-bts[master]: osmo-bts-trx/scheduler: refactor Uplink measurement processing

2019-10-19 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/15807 )

Change subject: osmo-bts-trx/scheduler: refactor Uplink measurement processing
..


Patch Set 3: Code-Review-1


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6bc511223069f66b49109d3267bee7bd89585713
Gerrit-Change-Number: 15807
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sat, 19 Oct 2019 12:20:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: osmo-bts-trx/scheduler: refactor Uplink measurement processing

2019-10-19 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/15807 )

Change subject: osmo-bts-trx/scheduler: refactor Uplink measurement processing
..


Patch Set 3:

> when it comes to block-diagonal interleaving (which is used on
> TCH/F and TCH/H channels), the results are incorrect.

Could you explain why the result is no correct?

If that's because of each burst affecting two frames - why not just have an avg 
counter per frame and add values to them accordingly? The code can be made 
cleaner than it is now, but there will be no need for traversing of a list.

If there is something I missed why the above can't be done and we do need to 
store values - why not use an array? We know that we need 8 values max, so why 
not allocate an array of 8 elements to avoid linked list operations?


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6bc511223069f66b49109d3267bee7bd89585713
Gerrit-Change-Number: 15807
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sat, 19 Oct 2019 12:20:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmo-sccp[master]: ipa: Don't send non-SCCP data over IPA/SCCPlite

2019-10-19 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15810 )

Change subject: ipa: Don't send non-SCCP data over IPA/SCCPlite
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15810
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I5e5a2879013ee8cf08aa4199b4bee498dcb61446
Gerrit-Change-Number: 15810
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 19 Oct 2019 12:13:56 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-sccp[master]: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable

2019-10-19 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15809 )

Change subject: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15809
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: If3a88863d18941c10d34361b323412ad7e517334
Gerrit-Change-Number: 15809
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 19 Oct 2019 12:13:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-sccp[master]: Move definition of LOGSS7() to header file; add LOGPAS() like LOGPASP()

2019-10-19 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15808 )

Change subject: Move definition of LOGSS7() to header file; add LOGPAS() like 
LOGPASP()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15808
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ic85fc460cc1f31d0fb407095afe417ceaa60e7bd
Gerrit-Change-Number: 15808
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 19 Oct 2019 12:13:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-sccp[master]: ipa: Don't send non-SCCP data over IPA/SCCPlite

2019-10-19 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15810 )

Change subject: ipa: Don't send non-SCCP data over IPA/SCCPlite
..

ipa: Don't send non-SCCP data over IPA/SCCPlite

The IPA/SCCPlite stacking is - as the name implies - constrained to
the transport of SCCP messages. We have to reject any non-SCCP payload.

Change-Id: I5e5a2879013ee8cf08aa4199b4bee498dcb61446
Fixes: OS#4235
---
M src/ipa.c
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/ipa.c b/src/ipa.c
index f3a7a52..d013916 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -57,6 +57,7 @@
 int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua)
 {
struct xua_msg_part *data_ie;
+   struct m3ua_data_hdr *data_hdr;
struct msgb *msg;
unsigned int src_len;
const uint8_t *src;
@@ -68,6 +69,13 @@
data_ie = xua_msg_find_tag(xua, M3UA_IEI_PROT_DATA);
if (!data_ie || data_ie->len < sizeof(struct m3ua_data_hdr))
return -1;
+   data_hdr = (struct m3ua_data_hdr *) data_ie->dat;
+
+   if (data_hdr->si != MTP_SI_SCCP) {
+   LOGPAS(as, DLSS7, LOGL_ERROR, "Cannot transmit non-SCCP SI (%u) 
to IPA peer\n",
+   data_hdr->si);
+   return -1;
+   }

/* and even the data part still has the header prepended */
src = data_ie->dat + sizeof(struct m3ua_data_hdr);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15810
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I5e5a2879013ee8cf08aa4199b4bee498dcb61446
Gerrit-Change-Number: 15810
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmo-sccp[master]: Move definition of LOGSS7() to header file; add LOGPAS() like LOGPASP()

2019-10-19 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15808 )

Change subject: Move definition of LOGSS7() to header file; add LOGPAS() like 
LOGPASP()
..

Move definition of LOGSS7() to header file; add LOGPAS() like LOGPASP()

Change-Id: Ic85fc460cc1f31d0fb407095afe417ceaa60e7bd
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
2 files changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index f448ce7..14e2b7c 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -430,8 +430,14 @@

 void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb);

+#define _LOGSS7(inst, subsys, level, fmt, args ...)  \
+LOGP(subsys, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
+#define LOGSS7(inst, level, fmt, args ...)  _LOGSS7(inst, DLSS7, level, 
fmt, ## args)
+
 #define LOGPASP(asp, subsys, level, fmt, args ...) \
-   LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
+   _LOGSS7((asp)->inst, subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## 
args)
+#define LOGPAS(as, subsys, level, fmt, args ...)   \
+   _LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## 
args)

 /***
  * xUA Servers
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 053feca..8519ced 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -74,9 +74,6 @@
{ 0, NULL }
 };

-#define LOGSS7(inst, level, fmt, args ...) \
-   LOGP(DLSS7, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
-
 static int asp_proto_to_ip_proto(enum osmo_ss7_asp_protocol proto)
 {
switch (proto) {

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15808
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ic85fc460cc1f31d0fb407095afe417ceaa60e7bd
Gerrit-Change-Number: 15808
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmo-sccp[master]: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable

2019-10-19 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15809 )

Change subject: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable
..

Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable

Change-Id: If3a88863d18941c10d34361b323412ad7e517334
---
M src/osmo_ss7.c
1 file changed, 9 insertions(+), 11 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 8519ced..8d188fc 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -985,7 +985,6 @@
return NULL;

if (!as) {
-   LOGSS7(inst, LOGL_INFO, "Creating AS %s\n", name);
as = talloc_zero(inst, struct osmo_ss7_as);
if (!as)
return NULL;
@@ -997,6 +996,7 @@
as->cfg.routing_key.l_rk_id = find_free_l_rk_id(inst);
as->fi = xua_as_fsm_start(as, LOGL_DEBUG);
llist_add_tail(>list, >as_list);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Created AS\n");
}

return as;
@@ -1016,8 +1016,7 @@
if (!asp)
return -ENODEV;

-   LOGSS7(as->inst, LOGL_INFO, "Adding ASP %s to AS %s\n",
-   asp->cfg.name, as->cfg.name);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Adding ASP %s to AS\n", asp->cfg.name);

if (osmo_ss7_as_has_asp(as, asp))
return 0;
@@ -1046,8 +1045,7 @@
if (!asp)
return -ENODEV;

-   LOGSS7(as->inst, LOGL_INFO, "Removing ASP %s from AS %s\n",
-   asp->cfg.name, as->cfg.name);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Removing ASP %s from AS\n", 
asp->cfg.name);

for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
if (as->cfg.asps[i] == asp) {
@@ -1066,7 +1064,7 @@
struct osmo_ss7_route *rt, *rt2;

OSMO_ASSERT(ss7_initialized);
-   LOGSS7(as->inst, LOGL_INFO, "Destroying AS %s\n", as->cfg.name);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Destroying AS\n");

if (as->fi)
osmo_fsm_inst_term(as->fi, OSMO_FSM_TERM_REQUEST, NULL);
@@ -1233,7 +1231,7 @@
struct osmo_ss7_as *as;

OSMO_ASSERT(ss7_initialized);
-   LOGSS7(asp->inst, LOGL_INFO, "Destroying ASP %s\n", asp->cfg.name);
+   LOGPASP(asp, DLSS7, LOGL_INFO, "Destroying ASP\n");

if (asp->server)
osmo_stream_srv_destroy(asp->server);
@@ -1270,7 +1268,7 @@
enum xua_asp_role role;

OSMO_ASSERT(ss7_initialized);
-   LOGSS7(asp->inst, LOGL_INFO, "Restarting ASP %s\n", asp->cfg.name);
+   LOGPASP(asp, DLSS7, LOGL_INFO, "Restarting ASP\n");

if (!asp->cfg.is_server) {
/* We are in client mode now */
@@ -1283,7 +1281,7 @@
if (!asp->client)
asp->client = osmo_stream_cli_create(asp);
if (!asp->client) {
-   LOGSS7(asp->inst, LOGL_ERROR, "Unable to create stream"
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to create 
stream"
" client for ASP %s\n", asp->cfg.name);
return -1;
}
@@ -1302,7 +1300,7 @@
osmo_stream_cli_set_data(asp->client, asp);
rc = osmo_stream_cli_open(asp->client);
if (rc < 0) {
-   LOGSS7(asp->inst, LOGL_ERROR, "Unable to open stream"
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to open stream"
" client for ASP %s\n", asp->cfg.name);
/* we don't return error in here because 
osmo_stream_cli_open()
   will continue to retry (due to timeout being 
explicitly set with
@@ -1319,7 +1317,7 @@
asp->client = NULL;
}
/* FIXME: ensure we have a SCTP server */
-   LOGSS7(asp->inst, LOGL_NOTICE, "ASP Restart for server "
+   LOGPASP(asp, DLSS7, LOGL_NOTICE, "ASP Restart for server "
"not implemented yet!\n");
/* TODO: make this configurable and not implicit */
role = XUA_ASPFSM_ROLE_SG;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15809
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: If3a88863d18941c10d34361b323412ad7e517334
Gerrit-Change-Number: 15809
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-MessageType: merged


Change in libosmo-sccp[master]: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable

2019-10-19 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15809 )

Change subject: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15809
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: If3a88863d18941c10d34361b323412ad7e517334
Gerrit-Change-Number: 15809
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 19 Oct 2019 12:13:47 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: osmo-bts-trx/scheduler: fix: print the last frame number in rx_data_fn()

2019-10-19 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/15811 )


Change subject: osmo-bts-trx/scheduler: fix: print the last frame number in 
rx_data_fn()
..

osmo-bts-trx/scheduler: fix: print the last frame number in rx_data_fn()

All other Uplink burst handlers print frame number of the last
(currently received) burst. Let's make rx_data_fn() consistent.

Change-Id: Ie5762a132326be3ef4e4e38cc126f05d51098a20
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 2 insertions(+), 2 deletions(-)



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

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 8662a14..d63987b 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -967,7 +967,7 @@
if ((*mask & 0xf) != 0xf) {
LOGL1S(DL1P, LOGL_NOTICE, l1t, bi->tn, chan, bi->fn,
"Received incomplete data (%u/%u)\n",
-   *first_fn, (*first_fn) % l1ts->mf_period);
+   bi->fn % l1ts->mf_period, l1ts->mf_period);

/* we require first burst to have correct FN */
if (!(*mask & 0x1)) {
@@ -982,7 +982,7 @@
if (rc) {
LOGL1S(DL1P, LOGL_NOTICE, l1t, bi->tn, chan, bi->fn,
"Received bad data (%u/%u)\n",
-   *first_fn, (*first_fn) % l1ts->mf_period);
+   bi->fn % l1ts->mf_period, l1ts->mf_period);
l2_len = 0;
} else
l2_len = GSM_MACBLOCK_LEN;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie5762a132326be3ef4e4e38cc126f05d51098a20
Gerrit-Change-Number: 15811
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bts[master]: osmo-bts-trx/scheduler: refactor the first frame number calculation

2019-10-19 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/15812 )


Change subject: osmo-bts-trx/scheduler: refactor the first frame number 
calculation
..

osmo-bts-trx/scheduler: refactor the first frame number calculation

In I6bc511223069f66b49109d3267bee7bd89585713 we have introduced
the storage for Uplink measurements (so called "history"), where
we can also store TDMA frame numbers of the related bursts.

This approach allows to look up frame number of the first Uplink
burst of a decoded block from the history. Thus neither we need
to store frame number of bid=0 in the logical channel state,
nor use complicated and buggy formulas.

This is not a silver bullet, because in some cases the measurement
history may be incomplete (until we start handling NOPE.ind from
the transceiver, see OS#3428). In such cases we would still need
to look up the first frame number using the block mapping tables
defined in 3GPP TS 45.002.

Change-Id: Iae9a0135595b0c56752723669a4ed2fc91f25785
Related: OS#3803
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/scheduler_trx.c
2 files changed, 54 insertions(+), 35 deletions(-)



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

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index e6ec37d..f096374 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -72,6 +72,7 @@
 /* A set of measurements attached to a burst */
 struct l1sched_meas_set {
struct llist_head   list;   /* Link to the measurement 
history */
+   uint32_tfn; /* TDMA frame-number */

int16_t toa256; /* Timing of Arrival (1/256 of 
a symbol) */
int16_t ci_cb;  /* Carrier-to-Interference (cB) 
*/
@@ -85,7 +86,6 @@
ubit_t  *dl_bursts; /* burst buffer for TX */
enum trx_burst_type dl_burst_type;  /* GMSK or 8PSK burst type */
sbit_t  *ul_bursts; /* burst buffer for RX */
-   uint32_tul_first_fn;/* fn of first burst */
uint8_t ul_mask;/* mask of received bursts */

/* loss detection */
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index ae23ddd..39f118d 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -898,6 +898,9 @@
set = talloc(tall_bts_ctx, struct l1sched_meas_set);
OSMO_ASSERT(set != NULL);

+   /* Attach TDMA frame number */
+   set->fn = bi->fn;
+
set->toa256 = bi->toa256;
set->rssi = bi->rssi;

@@ -962,6 +965,30 @@
}
 }

+/* Get TDMA frame number of N-th measurement from the history. */
+static uint32_t l1sched_meas_get_fn(const struct l1sched_chan_state 
*chan_state,
+   unsigned int num)
+{
+   const struct llist_head *hist = _state->meas.hist;
+   struct l1sched_meas_set *set;
+
+   /* There shall be at least one set */
+   OSMO_ASSERT(chan_state->meas.num > 0);
+
+   /* Try to find N-th measurement in the history */
+   llist_for_each_entry(set, hist, list) {
+   if (num == 0)
+   return set->fn;
+   num -= 1;
+   }
+
+   /* Not enough measurements in the history? */
+   LOGP(DL1P, LOGL_NOTICE, "Failed to find TDMA frame number in the 
history, "
+   "using frame number of the last burst\n");
+   set = llist_first_entry(hist, struct l1sched_meas_set, list);
+   return set->fn; /* return frame number of the last burst */
+}
+
 /*! \brief a single (SDCCH/SACCH) burst was received by the PHY, process it */
 int rx_data_fn(struct l1sched_trx *l1t, enum trx_chan_type chan,
   uint8_t bid, const struct trx_ul_burst_ind *bi)
@@ -969,11 +996,11 @@
struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, bi->tn);
struct l1sched_chan_state *chan_state = >chan_state[chan];
sbit_t *burst, **bursts_p = _state->ul_bursts;
-   uint32_t *first_fn = _state->ul_first_fn;
uint8_t *mask = _state->ul_mask;
uint8_t l2[GSM_MACBLOCK_LEN], l2_len;
struct l1sched_meas_set meas_set;
int n_errors, n_bits_total;
+   uint32_t first_fn;
uint16_t ber10k;
int rc;

@@ -997,7 +1024,6 @@
if (bid == 0) {
memset(*bursts_p, 0, 464);
*mask = 0x0;
-   *first_fn = bi->fn;
}

/* store the measurements */
@@ -1045,18 +1071,21 @@
} else
l2_len = GSM_MACBLOCK_LEN;

+   /* Get frame number of the first burst (1/4) */
+   first_fn = l1sched_meas_get_fn(chan_state, 4);
+
/* Average measurements of the last 4 bursts */
l1sched_meas_average(chan_state, _set, 4);
/* 

Change in osmo-trx[master]: vty: Simplify filler burst settings and improve help and readability.

2019-10-19 Thread ipse
ipse has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15793 )

Change subject: vty: Simplify filler burst settings and improve help and 
readability.
..


Patch Set 3:

@pespin Please, could you merge this? Looks like I don't have +2 rights here 
for some reason.


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I752eb2c1162d084e8769181f2fcd6c0877663448
Gerrit-Change-Number: 15793
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ipse 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Sat, 19 Oct 2019 10:49:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmo-sccp[master]: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable

2019-10-19 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15809 )


Change subject: Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable
..

Use LOGPAS / LOGPASP in favor of generic LOGSS7 where applicable

Change-Id: If3a88863d18941c10d34361b323412ad7e517334
---
M src/osmo_ss7.c
1 file changed, 9 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/09/15809/1

diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 8519ced..8d188fc 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -985,7 +985,6 @@
return NULL;

if (!as) {
-   LOGSS7(inst, LOGL_INFO, "Creating AS %s\n", name);
as = talloc_zero(inst, struct osmo_ss7_as);
if (!as)
return NULL;
@@ -997,6 +996,7 @@
as->cfg.routing_key.l_rk_id = find_free_l_rk_id(inst);
as->fi = xua_as_fsm_start(as, LOGL_DEBUG);
llist_add_tail(>list, >as_list);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Created AS\n");
}

return as;
@@ -1016,8 +1016,7 @@
if (!asp)
return -ENODEV;

-   LOGSS7(as->inst, LOGL_INFO, "Adding ASP %s to AS %s\n",
-   asp->cfg.name, as->cfg.name);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Adding ASP %s to AS\n", asp->cfg.name);

if (osmo_ss7_as_has_asp(as, asp))
return 0;
@@ -1046,8 +1045,7 @@
if (!asp)
return -ENODEV;

-   LOGSS7(as->inst, LOGL_INFO, "Removing ASP %s from AS %s\n",
-   asp->cfg.name, as->cfg.name);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Removing ASP %s from AS\n", 
asp->cfg.name);

for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
if (as->cfg.asps[i] == asp) {
@@ -1066,7 +1064,7 @@
struct osmo_ss7_route *rt, *rt2;

OSMO_ASSERT(ss7_initialized);
-   LOGSS7(as->inst, LOGL_INFO, "Destroying AS %s\n", as->cfg.name);
+   LOGPAS(as, DLSS7, LOGL_INFO, "Destroying AS\n");

if (as->fi)
osmo_fsm_inst_term(as->fi, OSMO_FSM_TERM_REQUEST, NULL);
@@ -1233,7 +1231,7 @@
struct osmo_ss7_as *as;

OSMO_ASSERT(ss7_initialized);
-   LOGSS7(asp->inst, LOGL_INFO, "Destroying ASP %s\n", asp->cfg.name);
+   LOGPASP(asp, DLSS7, LOGL_INFO, "Destroying ASP\n");

if (asp->server)
osmo_stream_srv_destroy(asp->server);
@@ -1270,7 +1268,7 @@
enum xua_asp_role role;

OSMO_ASSERT(ss7_initialized);
-   LOGSS7(asp->inst, LOGL_INFO, "Restarting ASP %s\n", asp->cfg.name);
+   LOGPASP(asp, DLSS7, LOGL_INFO, "Restarting ASP\n");

if (!asp->cfg.is_server) {
/* We are in client mode now */
@@ -1283,7 +1281,7 @@
if (!asp->client)
asp->client = osmo_stream_cli_create(asp);
if (!asp->client) {
-   LOGSS7(asp->inst, LOGL_ERROR, "Unable to create stream"
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to create 
stream"
" client for ASP %s\n", asp->cfg.name);
return -1;
}
@@ -1302,7 +1300,7 @@
osmo_stream_cli_set_data(asp->client, asp);
rc = osmo_stream_cli_open(asp->client);
if (rc < 0) {
-   LOGSS7(asp->inst, LOGL_ERROR, "Unable to open stream"
+   LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to open stream"
" client for ASP %s\n", asp->cfg.name);
/* we don't return error in here because 
osmo_stream_cli_open()
   will continue to retry (due to timeout being 
explicitly set with
@@ -1319,7 +1317,7 @@
asp->client = NULL;
}
/* FIXME: ensure we have a SCTP server */
-   LOGSS7(asp->inst, LOGL_NOTICE, "ASP Restart for server "
+   LOGPASP(asp, DLSS7, LOGL_NOTICE, "ASP Restart for server "
"not implemented yet!\n");
/* TODO: make this configurable and not implicit */
role = XUA_ASPFSM_ROLE_SG;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15809
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: If3a88863d18941c10d34361b323412ad7e517334
Gerrit-Change-Number: 15809
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in libosmo-sccp[master]: ipa: Don't send non-SCCP data over IPA/SCCPlite

2019-10-19 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15810 )


Change subject: ipa: Don't send non-SCCP data over IPA/SCCPlite
..

ipa: Don't send non-SCCP data over IPA/SCCPlite

The IPA/SCCPlite stacking is - as the name implies - constrained to
the transport of SCCP messages. We have to reject any non-SCCP payload.

Change-Id: I5e5a2879013ee8cf08aa4199b4bee498dcb61446
Fixes: OS#4235
---
M src/ipa.c
1 file changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/10/15810/1

diff --git a/src/ipa.c b/src/ipa.c
index f3a7a52..d013916 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -57,6 +57,7 @@
 int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua)
 {
struct xua_msg_part *data_ie;
+   struct m3ua_data_hdr *data_hdr;
struct msgb *msg;
unsigned int src_len;
const uint8_t *src;
@@ -68,6 +69,13 @@
data_ie = xua_msg_find_tag(xua, M3UA_IEI_PROT_DATA);
if (!data_ie || data_ie->len < sizeof(struct m3ua_data_hdr))
return -1;
+   data_hdr = (struct m3ua_data_hdr *) data_ie->dat;
+
+   if (data_hdr->si != MTP_SI_SCCP) {
+   LOGPAS(as, DLSS7, LOGL_ERROR, "Cannot transmit non-SCCP SI (%u) 
to IPA peer\n",
+   data_hdr->si);
+   return -1;
+   }

/* and even the data part still has the header prepended */
src = data_ie->dat + sizeof(struct m3ua_data_hdr);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15810
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I5e5a2879013ee8cf08aa4199b4bee498dcb61446
Gerrit-Change-Number: 15810
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Change in libosmo-sccp[master]: Move definition of LOGSS7() to header file; add LOGPAS() like LOGPASP()

2019-10-19 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/15808 )


Change subject: Move definition of LOGSS7() to header file; add LOGPAS() like 
LOGPASP()
..

Move definition of LOGSS7() to header file; add LOGPAS() like LOGPASP()

Change-Id: Ic85fc460cc1f31d0fb407095afe417ceaa60e7bd
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7.c
2 files changed, 7 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/08/15808/1

diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index f448ce7..14e2b7c 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -430,8 +430,14 @@

 void osmo_ss7_register_rx_unknown_cb(osmo_ss7_asp_rx_unknown_cb *cb);

+#define _LOGSS7(inst, subsys, level, fmt, args ...)  \
+LOGP(subsys, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
+#define LOGSS7(inst, level, fmt, args ...)  _LOGSS7(inst, DLSS7, level, 
fmt, ## args)
+
 #define LOGPASP(asp, subsys, level, fmt, args ...) \
-   LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args)
+   _LOGSS7((asp)->inst, subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## 
args)
+#define LOGPAS(as, subsys, level, fmt, args ...)   \
+   _LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## 
args)

 /***
  * xUA Servers
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 053feca..8519ced 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -74,9 +74,6 @@
{ 0, NULL }
 };

-#define LOGSS7(inst, level, fmt, args ...) \
-   LOGP(DLSS7, level, "%u: " fmt, inst ? (inst)->cfg.id : 0, ## args)
-
 static int asp_proto_to_ip_proto(enum osmo_ss7_asp_protocol proto)
 {
switch (proto) {

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/15808
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ic85fc460cc1f31d0fb407095afe417ceaa60e7bd
Gerrit-Change-Number: 15808
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


Build failure of network:osmocom:nightly/osmo-mgw in xUbuntu_19.10/x86_64

2019-10-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-mgw/xUbuntu_19.10/x86_64

Package network:osmocom:nightly/osmo-mgw failed to build in xUbuntu_19.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-mgw

Last lines of build log:
[  274s] #define HAVE_SYS_TYPES_H 1
[  274s] #define HAVE_SYS_STAT_H 1
[  274s] #define HAVE_STDLIB_H 1
[  274s] #define HAVE_STRING_H 1
[  274s] #define HAVE_MEMORY_H 1
[  274s] #define HAVE_STRINGS_H 1
[  274s] #define HAVE_INTTYPES_H 1
[  274s] #define HAV[  260.864490] serial8250: too much work for irq4
[  274s] E_STDINT_H 1
[  274s] #define HAVE_UNISTD_H 1
[  274s] #define HAVE_DLFCN_H 1
[  274s] #define LT_OBJDIR ".libs/"
[  274s] 
[  274s] configure: exit 1
[  274s] dh_auto_configure: ./configure --build=x86_64-linux-gnu --prefix=/usr 
--includedir=\${prefix}/include --mandir=\${prefix}/share/man 
--infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var 
--disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu 
--libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode 
--disable-dependency-tracking --with-systemdsystemunitdir=/lib/systemd/system 
--enable-manuals returned exit code 1
[  274s] make[1]: *** [debian/rules:33: override_dh_auto_configure] Error 255
[  274s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  274s] make: *** [debian/rules:17: build] Error 2
[  274s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  274s] 
[  274s] build79 failed "build osmo-mgw_1.6.0.17.843d.dsc" at Sat Oct 19 
10:20:07 UTC 2019.
[  274s] 
[  274s] ### VM INTERACTION START ###
[  277s] [  264.056907] sysrq: SysRq : Power Off
[  277s] [  264.059640] reboot: Power down
[  277s] ### VM INTERACTION END ###
[  277s] 
[  277s] build79 failed "build osmo-mgw_1.6.0.17.843d.dsc" at Sat Oct 19 
10:20:11 UTC 2019.
[  277s] 

-- 
Configure notifications at https://build.opensuse.org/my/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/binutils-arm-osmo-eabi in xUbuntu_19.10/x86_64

2019-10-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/binutils-arm-osmo-eabi/xUbuntu_19.10/x86_64

Package network:osmocom:nightly/binutils-arm-osmo-eabi failed to build in 
xUbuntu_19.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly binutils-arm-osmo-eabi

Last lines of build log:
[  235s] ../../bfd/tekhex.c:1009:3: note: in expansion of macro 
'BFD_JUMP_TABLE_DYNAMIC'
[  235s]  1009 |   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
[  235s]   |   ^~
[  235s] cc1: all warnings being treated as errors
[  235s] make[5]: *** [Makefile:1517: srec.lo] Error 1
[  235s] cc1: all warnings being treated as errors
[  235s] make[5]: *** [Makefile:1517: tekhex.lo] Error 1
[  235s] make[5]: Leaving directory '/usr/src/packages/BUILD/build/bfd'
[  235s] make[4]: *** [Makefile:1555: all-recursive] Error 1
[  235s] make[4]: Leaving directory '/usr/src/packages/BUILD/build/bfd'
[  235s] make[3]: *** [Makefile:1066: all] Error 2
[  235s] make[3]: Leaving directory '/usr/src/packages/BUILD/build/bfd'
[  235s] make[2]: *** [Makefile:3331: all-bfd] Error 2
[  235s] make[2]: Leaving directory '/usr/src/packages/BUILD/build'
[  235s] make[1]: *** [Makefile:850: all] Error 2
[  235s] make[1]: Leaving directory '/usr/src/packages/BUILD/build'
[  235s] dh_auto_build: cd build && make -j8 returned exit code 2
[  235s] make: *** [debian/rules:43: build] Error 255
[  235s] dpkg-buildpackage: error: debian/rules build subprocess returned exit 
status 2
[  235s] 
[  235s] lamb52 failed "build binutils-arm-osmo-eabi_2.21.1a.dsc" at Sat Oct 19 
10:09:49 UTC 2019.
[  235s] 
[  235s] ### VM INTERACTION START ###
[  238s] [  224.218611] sysrq: SysRq : Power Off
[  238s] [  224.226128] reboot: Power down
[  238s] ### VM INTERACTION END ###
[  238s] 
[  238s] lamb52 failed "build binutils-arm-osmo-eabi_2.21.1a.dsc" at Sat Oct 19 
10:09:53 UTC 2019.
[  238s] 

-- 
Configure notifications at https://build.opensuse.org/my/notifications
openSUSE Build Service (https://build.opensuse.org/)


Change in osmo-sgsn[master]: sgsn: Gb: implementing PS Paging when MS is MM_STANDBY

2019-10-19 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/15705 )

Change subject: sgsn: Gb: implementing PS Paging when MS is MM_STANDBY
..

sgsn: Gb: implementing PS Paging when MS is MM_STANDBY

When the MS is in MM_STANDBY, the Routing Area is known,
but not the exact cell.
Start the paging procedure. (Even this is only supported
for the last known cell, not the Routing Area. Routing Area
paging is not yet supported.)

Change-Id: Icc2c6ba70f8f74054546a1e31741fc90b232a23c
---
M src/sgsn/sgsn_libgtp.c
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index a39687f..c45431a 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -664,6 +665,11 @@
/* FIXME: queue the packet we received from GTP */
break;
case ST_GMM_REGISTERED_NORMAL:
+   OSMO_ASSERT(mm->gb.mm_state_fsm->state != ST_MM_IDLE);
+   if (mm->gb.mm_state_fsm->state == ST_MM_STANDBY)
+   gprs_gb_page_ps_ra(mm);
+
+   /* FIXME: queue the packet we received from GTP */
break;
default:
LOGP(DGPRS, LOGL_ERROR, "GTP DATA IND for TLLI %08X in state "

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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Icc2c6ba70f8f74054546a1e31741fc90b232a23c
Gerrit-Change-Number: 15705
Gerrit-PatchSet: 6
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-trx[master]: vty: Simplify filler burst settings and improve help and readability.

2019-10-19 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15793 )

Change subject: vty: Simplify filler burst settings and improve help and 
readability.
..


Patch Set 3: Code-Review+1

Fine by me.


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I752eb2c1162d084e8769181f2fcd6c0877663448
Gerrit-Change-Number: 15793
Gerrit-PatchSet: 3
Gerrit-Owner: ipse 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: ipse 
Gerrit-Comment-Date: Sat, 19 Oct 2019 08:37:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Build failed in Jenkins: master-simtrace2 » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #541

2019-10-19 Thread jenkins
See 


--
[...truncated 148.54 KB...]
320   0   0 320 140 obj/owhw/dfu_board_lowlevel.o
   1216   0 5211737 6c9 obj/owhw/dfu_uart_console.o
731 184   0 915 393 obj/owhw/dfu_led.o
  8   0   0   8   8 obj/owhw/dfu_boardver_adc.o
 30  16   0  46  2e obj/owhw/dfu_manifest.o
239   0   0 239  ef obj/owhw/dfu_owhw.o
   1472   1   01473 5c1 obj/owhw/dfu_main.o
244   0   0 244  f4 obj/owhw/dfu_dfu.o
645   4   6 655 28f obj/owhw/dfu_dfu_runtime.o
   3490   0 2083698 e72 obj/owhw/dfu_card_emu.o
  0   0   0   0   0 obj/owhw/dfu_cciddriver.o
   2629  12   42645 a55 obj/owhw/dfu_iso7816_4.o
 96   0   0  96  60 obj/owhw/dfu_iso7816_fidi.o
  0   0   0   0   0 obj/owhw/dfu_mitm.o
   23081152   03460 d84 obj/owhw/dfu_mode_cardemu.o
  0   0   0   0   0 obj/owhw/dfu_mode_ccid.o
352   0 520 872 368 obj/owhw/dfu_simtrace_iso7816.o
  0   0   0   0   0 obj/owhw/dfu_sniffer.o
488  40   0 528 210 obj/owhw/dfu_tc_etu.o
832 120  841036 40c obj/owhw/dfu_usb.o
  26368   0   18072   0ad98 bin/owhw-cardem-dfu.elf
=== owhw / cardem RES:0 ==

=== FIRMWARE TESTS ===
cc -g -Wall `pkg-config --cflags libosmocore` -I../src_simtrace 
-I../atmel_softpack_libraries/libchip_sam3s 
-I../atmel_softpack_libraries/libchip_sam3s/cmsis 
-I../atmel_softpack_libraries/libchip_sam3s/include 
-I../atmel_softpack_libraries/usb/include -I../libcommon/include 
-I../libboard/common/include -I../libboard/simtrace/include -I. -o 
card_emu_tests.hobj -c card_emu_tests.c
In file included from ../libboard/common/include/board_common.h:24:0,
 from ../libboard/simtrace/include/board.h:21,
 from 
../atmel_softpack_libraries/libchip_sam3s/include/trace.h:70,
 from ../libcommon/include/assert.h:60,
 from card_emu_tests.c:4:
../atmel_softpack_libraries/libchip_sam3s/chip.h:11:6: warning: #warning 
Library does not support the specified chip, specifying sam3s4. [-Wcpp]
 #warning Library does not support the specified chip, specifying sam3s4.
  ^~~
card_emu_tests.c: In function ‘get_and_verify_rctx’:
card_emu_tests.c:171:34: warning: unused variable ‘td’ [-Wunused-variable]
  struct cardemu_usb_msg_tx_data *td;
  ^~
cc -g -Wall `pkg-config --cflags libosmocore` -I../src_simtrace 
-I../atmel_softpack_libraries/libchip_sam3s 
-I../atmel_softpack_libraries/libchip_sam3s/cmsis 
-I../atmel_softpack_libraries/libchip_sam3s/include 
-I../atmel_softpack_libraries/usb/include -I../libcommon/include 
-I../libboard/common/include -I../libboard/simtrace/include -I. -o 
card_emu.hobj -c ../libcommon/source/card_emu.c
In file included from ../libboard/common/include/board_common.h:24:0,
 from ../libboard/simtrace/include/board.h:21,
 from 
../atmel_softpack_libraries/libchip_sam3s/include/trace.h:70,
 from ../libcommon/include/assert.h:60,
 from ../libcommon/source/card_emu.c:21:
../atmel_softpack_libraries/libchip_sam3s/chip.h:11:6: warning: #warning 
Library does not support the specified chip, specifying sam3s4. [-Wcpp]
 #warning Library does not support the specified chip, specifying sam3s4.
  ^~~
In file included from ../libcommon/source/card_emu.c:27:0:
../libcommon/include/utils.h:31:2: warning: #warning 
"local_irq_{save,restore}() not implemented" [-Wcpp]
 #warning "local_irq_{save,restore}() not implemented"
  ^~~
../libcommon/source/card_emu.c: In function ‘flush_rx_buffer’:
../libcommon/source/card_emu.c:279:11: warning: unused variable ‘data_len’ 
[-Wunused-variable]
  uint32_t data_len;
   ^~~~
cc -g -Wall `pkg-config --cflags libosmocore` -I../src_simtrace 
-I../atmel_softpack_libraries/libchip_sam3s 
-I../atmel_softpack_libraries/libchip_sam3s/cmsis 
-I../atmel_softpack_libraries/libchip_sam3s/include 
-I../atmel_softpack_libraries/usb/include -I../libcommon/include 
-I../libboard/common/include -I../libboard/simtrace/include -I. -o usb_buf.hobj 
-c ../libcommon/source/usb_buf.c
In file included from ../libboard/common/include/board_common.h:24:0,
 from ../libboard/simtrace/include/board.h:21,
 from ../libcommon/source/usb_buf.c:17:
../atmel_softpack_libraries/libchip_sam3s/chip.h:11:6: warning: #warning 
Library does not support the specified chip, specifying sam3s4. [-Wcpp]
 #warning Library does not support the specified