Build failed in Jenkins: master-osmo-iuh » a1=default,a2=default,a3=default,osmocom-master-debian9 #932

2018-04-14 Thread jenkins
See 


--
[...truncated 765.68 KB...]
^~~~
../include/osmocom/ranap/RANAP_RABParametersList.h:29:2: note: in expansion of 
macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberB {
  ^
../include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:23: warning: 
‘struct MemberD’ declared inside parameter list will not be visible outside of 
this definition or declaration
  A_SEQUENCE_OF(struct MemberD {
   ^
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:2: note: in 
expansion of macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberD {
  ^
../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:23: warning: 
‘struct MemberG’ declared inside parameter list will not be visible outside of 
this definition or declaration
  A_SEQUENCE_OF(struct MemberG {
   ^
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h:28:2: note: in 
expansion of macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberG {
  ^
../include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:23: warning: 
‘struct MemberD’ declared inside parameter list will not be visible outside of 
this definition or declaration
  A_SEQUENCE_OF(struct MemberD {
   ^
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../include/osmocom/ranap/RANAP_UnsuccessfulLinking-IEs.h:27:2: note: in 
expansion of macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberD {
  ^
../include/osmocom/ranap/RANAP_DataVolumeList.h:27:23: warning: ‘struct 
MemberH’ declared inside parameter list will not be visible outside of this 
definition or declaration
  A_SEQUENCE_OF(struct MemberH {
   ^
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../include/osmocom/ranap/RANAP_DataVolumeList.h:27:2: note: in expansion of 
macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberH {
  ^
../include/osmocom/ranap/RANAP_EUTRANFrequencies.h:27:23: warning: ‘struct 
MemberJ’ declared inside parameter list will not be visible outside of this 
definition or declaration
  A_SEQUENCE_OF(struct MemberJ {
   ^
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../include/osmocom/ranap/RANAP_EUTRANFrequencies.h:27:2: note: in expansion of 
macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberJ {
  ^
In file included from ../include/osmocom/ranap/ranap_common.h:592:0,
 from ranap_encoder.c:7:
../include/osmocom/ranap/ranap_ies_defs.h:126:0: warning: 
"ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT" redefined
 #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT  
 (1 << 1)
 
../include/osmocom/ranap/ranap_ies_defs.h:125:0: note: this is the location of 
the previous definition
 #define ENHANCEDRELOCATIONCOMPLETEREQUESTIES_RANAP_EXTENDEDRNC_ID_PRESENT  
 (1 << 0)
 
../include/osmocom/ranap/ranap_ies_defs.h:436:0: warning: 
"RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT"
 redefined
 #define 
RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT
 (1 << 2)
 
../include/osmocom/ranap/ranap_ies_defs.h:434:0: note: this is the location of 
the previous definition
 #define 
RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_IUSIGNALLINGCONNECTIONIDENTIFIER_PRESENT
 (1 << 0)
 
../include/osmocom/ranap/ranap_ies_defs.h:437:0: warning: 
"RANAP_ENHANCEDRELOCATIONINFORMATIONREQUESTIES_RANAP_GLOBALCN_ID_PRESENT" 
redefined
 #define 

osmocom-bb[fixeria/trx]: trxcon/scheduler: fix Measurement Reporting on SACCH

2018-04-14 Thread Vadim Yanitskiy

Patch Set 1: Verified-1

-- 
To view, visit https://gerrit.osmocom.org/7470
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: If1b8dc74ced746d6270676fdde75fcda32f91a3d
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[MERGED] docker-playground[master]: ttcn3-msc-test: Add SMPP config bits

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ttcn3-msc-test: Add SMPP config bits
..


ttcn3-msc-test: Add SMPP config bits

Change-Id: I595a1ca2d47667e654f8a0a69bfe98c91ac58d39
---
M ttcn3-msc-test/osmo-msc.cfg
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/ttcn3-msc-test/osmo-msc.cfg b/ttcn3-msc-test/osmo-msc.cfg
index 349966f..8fa38ad 100644
--- a/ttcn3-msc-test/osmo-msc.cfg
+++ b/ttcn3-msc-test/osmo-msc.cfg
@@ -76,6 +76,12 @@
 mncc-int
  default-codec tch-f fr
  default-codec tch-h hr
+smpp
+ local-tcp-port 2775
+ policy closed
+ no smpp-first
+ esme msc_tester
+  password osmocom1
 hlr
  remote-ip 172.18.1.103
  remote-port 4222

-- 
To view, visit https://gerrit.osmocom.org/7803
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I595a1ca2d47667e654f8a0a69bfe98c91ac58d39
Gerrit-PatchSet: 1
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


[PATCH] docker-playground[master]: ttcn3-msc-test: Add SMPP config bits

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7803

ttcn3-msc-test: Add SMPP config bits

Change-Id: I595a1ca2d47667e654f8a0a69bfe98c91ac58d39
---
M ttcn3-msc-test/osmo-msc.cfg
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/03/7803/1

diff --git a/ttcn3-msc-test/osmo-msc.cfg b/ttcn3-msc-test/osmo-msc.cfg
index 349966f..8fa38ad 100644
--- a/ttcn3-msc-test/osmo-msc.cfg
+++ b/ttcn3-msc-test/osmo-msc.cfg
@@ -76,6 +76,12 @@
 mncc-int
  default-codec tch-f fr
  default-codec tch-h hr
+smpp
+ local-tcp-port 2775
+ policy closed
+ no smpp-first
+ esme msc_tester
+  password osmocom1
 hlr
  remote-ip 172.18.1.103
  remote-port 4222

-- 
To view, visit https://gerrit.osmocom.org/7803
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I595a1ca2d47667e654f8a0a69bfe98c91ac58d39
Gerrit-PatchSet: 1
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] osmo-ttcn3-hacks[master]: msc: Add SMPP_CodecPort

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: msc: Add SMPP_CodecPort
..


msc: Add SMPP_CodecPort

Change-Id: I57640ccc5370d6820bc303003e162f27ddc9fcfd
---
A library/SMPP_CodecPort.ttcn
A library/SMPP_CodecPort_CtrlFunct.ttcn
A library/SMPP_CodecPort_CtrlFunctDef.cc
M msc/gen_links.sh
M msc/regen_makefile.sh
5 files changed, 185 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/SMPP_CodecPort.ttcn b/library/SMPP_CodecPort.ttcn
new file mode 100644
index 000..0ac81ae
--- /dev/null
+++ b/library/SMPP_CodecPort.ttcn
@@ -0,0 +1,65 @@
+module SMPP_CodecPort {
+
+/* Simple SMPP Codec Port, translating between raw TCP octetstring payload
+ * towards the IPL4asp port provider, and SMPP primitives
+ * which carry the decoded SMPP data types as payload.
+ *
+ * (C) 2018 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ */
+
+
+import from IPL4asp_PortType all;
+import from IPL4asp_Types all;
+import from SMPP_Types all;
+
+type record SMPP_RecvFrom {
+   ConnectionIdconnId,
+   SMPP_PDUmsg
+}
+
+type record SMPP_Send {
+   ConnectionIdconnId,
+   SMPP_PDUmsg
+}
+
+template (value) SMPP_Send ts_SMPP_Send(ConnectionId conn_id, template (value) 
SMPP_PDU msg) := {
+   connId := conn_id,
+   msg := msg
+}
+
+template SMPP_RecvFrom tr_SMPP_Recv(template ConnectionId conn_id, template 
SMPP_PDU msg) := {
+   connId := conn_id,
+   msg := msg
+}
+
+private function IPL4_to_SMPP_RecvFrom(in ASP_RecvFrom pin, out SMPP_RecvFrom 
pout) {
+   var integer rc;
+   pout.connId := pin.connId;
+   rc := f_decode_SMPP(pin.msg, pout.msg);
+} with { extension "prototype(fast)" }
+
+private function SMPP_to_IPL4_Send(in SMPP_Send pin, out ASP_Send pout) {
+   pout.connId := pin.connId;
+   pout.proto := { tcp := {} };
+   f_encode_SMPP(pin.msg, pout.msg);
+} with { extension "prototype(fast)" }
+
+type port SMPP_CODEC_PT message {
+   out SMPP_Send;
+   in  SMPP_RecvFrom,
+   ASP_ConnId_ReadyToRelease,
+   ASP_Event;
+} with { extension "user IPL4asp_PT
+   out(SMPP_Send -> ASP_Send: function(SMPP_to_IPL4_Send))
+   in(ASP_RecvFrom -> SMPP_RecvFrom: function(IPL4_to_SMPP_RecvFrom);
+  ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
+  ASP_Event -> ASP_Event: simple)"
+}
+
+
+
+}
diff --git a/library/SMPP_CodecPort_CtrlFunct.ttcn 
b/library/SMPP_CodecPort_CtrlFunct.ttcn
new file mode 100644
index 000..2f6d616
--- /dev/null
+++ b/library/SMPP_CodecPort_CtrlFunct.ttcn
@@ -0,0 +1,52 @@
+module SMPP_CodecPort_CtrlFunct {
+
+  import from SMPP_CodecPort all;
+  import from IPL4asp_Types all;
+
+  external function f_IPL4_listen(
+inout SMPP_CODEC_PT portRef,
+in HostName locName,
+in PortNumber locPort,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_connect(
+inout SMPP_CODEC_PT portRef,
+in HostName remName,
+in PortNumber remPort,
+in HostName locName,
+in PortNumber locPort,
+in ConnectionId connId,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_close(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+in ProtoTuple proto := { unspecified := {} }
+  ) return Result;
+
+  external function f_IPL4_setUserData(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+in UserData userData
+  ) return Result;
+
+  external function f_IPL4_getUserData(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+out UserData userData
+  ) return Result;
+
+  external function f_IPL4_setGetMsgLen(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+inout f_IPL4_getMsgLen f,
+in ro_integer msgLenArgs
+  );
+
+
+}
+
diff --git a/library/SMPP_CodecPort_CtrlFunctDef.cc 
b/library/SMPP_CodecPort_CtrlFunctDef.cc
new file mode 100644
index 000..31603e4
--- /dev/null
+++ b/library/SMPP_CodecPort_CtrlFunctDef.cc
@@ -0,0 +1,66 @@
+#include "IPL4asp_PortType.hh"
+#include "SMPP_CodecPort.hh"
+#include "IPL4asp_PT.hh"
+
+namespace SMPP__CodecPort__CtrlFunct {
+
+  IPL4asp__Types::Result f__IPL4__listen(
+SMPP__CodecPort::SMPP__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+const IPL4asp__Types::ProtoTuple& proto,
+const IPL4asp__Types::OptionList& options)
+  {
+return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, 
options);
+  }
+  
+  IPL4asp__Types::Result f__IPL4__connect(
+SMPP__CodecPort::SMPP__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& remName,
+const 

[MERGED] osmo-ttcn3-hacks[master]: msc: Add SMPP tests for MO + MT SMS

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: msc: Add SMPP tests for MO + MT SMS
..


msc: Add SMPP tests for MO + MT SMS

Change-Id: I5349559c7c3096533fb07fcf53f0a44ff7f6567f
---
M library/Osmocom_VTY_Functions.ttcn
M library/SMPP_Templates.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
4 files changed, 269 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index 9258fa5..2b74694 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -108,11 +108,14 @@
f_vty_transceive(pt, "timeslot " & int2str(ts));
}
 
-function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
+type record of charstring rof_charstring;
+function f_vty_config2(TELNETasp_PT pt, rof_charstring config_nodes, 
charstring cmd)
 {
/* enter config mode; enter node */
f_vty_enter_config(pt);
-   f_vty_transceive(pt, config_node);
+   for (var integer i := 0; i < sizeof(config_nodes); i := i+1) {
+   f_vty_transceive(pt, config_nodes[i]);
+   }
/* execute command */
f_vty_transceive(pt, cmd);
/* leave config mode */
@@ -120,4 +123,10 @@
 }
 
 
+function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
+{
+   f_vty_config2(pt, {config_node}, cmd);
+}
+
+
 }
diff --git a/library/SMPP_Templates.ttcn b/library/SMPP_Templates.ttcn
index 9a56cf2..2ff675d 100644
--- a/library/SMPP_Templates.ttcn
+++ b/library/SMPP_Templates.ttcn
@@ -119,6 +119,21 @@
}
 }
 
+template (value) SMPP_PDU ts_SMPP_SUBMIT_SM(SMPP_SM sm) := {
+   header := ts_SMPP_hdr(c_SMPP_command_id_submit_sm, ESME_ROK),
+   body := {
+   submit_sm := sm
+   }
+}
+
+/* Section 5.2.12 esm_class */
+template SMPP_BIT1 tr_ESM_CLASS_DEFAULT := '??00'B;
+template SMPP_BIT1 tr_ESM_CLASS_DATAGRAM := '??01'B;
+template SMPP_BIT1 tr_ESM_CLASS_TRANSACTION := '??10'B;
+template SMPP_BIT1 tr_ESM_CLASS_STORE_FORWARD := '??11'B;
+template SMPP_BIT1 tr_ESM_CLASS_UDHI := '?1??'B;
+template SMPP_BIT1 tr_ESM_CLASS_REPLYP_PATH := '1???'B;
+
 
 
 
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 8c9b723..b7a4f50 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -29,8 +29,10 @@
 import from L3_Templates all;
 import from L3_Common all;
 
+import from SMPP_Emulation all;
+
 /* this component represents a single subscriber connection */
-type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, 
GSUP_ConnHdlr, MGCP_ConnHdlr {
+type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, 
GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr {
var BSC_ConnHdlrPars g_pars;
timer g_Tguard := 60.0;
 }
@@ -118,6 +120,8 @@
/* Start guard timer and activate it as default */
g_Tguard.start(t_guard);
activate(as_Tguard());
+   /* Route all SMPP messages for our MSISDN to us */
+   f_create_smpp_expect(hex2str(pars.msisdn));
 }
 
 
@@ -817,6 +821,9 @@
 
var default d := activate(as_other_sms());
 
+   /* just in case this is routed to SMPP.. */
+   f_create_smpp_expect(hex2str(spars.tp.da.tP_DA_NoPad.tP_DAValue));
+
tp_mo := ts_SMS_SUBMIT(spars.tp.msg_ref, spars.tp.da, spars.tp.pid, 
spars.tp.dcs,
 spars.tp.udl, spars.tp.ud);
rp_mo := ts_RP_DATA_MO(spars.rp.msg_ref, spars.rp.orig, spars.rp.dest, 
tp_mo);
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index bb28c74..1ede8e6 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -47,6 +47,10 @@
 import from L3_Templates all;
 import from L3_Common all;
 
+import from SMPP_Types all;
+import from SMPP_Templates all;
+import from SMPP_Emulation all;
+
 const integer NUM_BSC := 2;
 type record of BSSAP_Configuration BSSAP_Configurations;
 
@@ -60,6 +64,7 @@
var MGCP_Emulation_CT vc_MGCP;
var GSUP_Emulation_CT vc_GSUP;
var IPA_Emulation_CT vc_GSUP_IPA;
+   var SMPP_Emulation_CT vc_SMPP;
 
/* only to get events from IPA underneath GSUP */
port IPA_CTRL_PT GSUP_IPA_EVENT;
@@ -90,6 +95,10 @@
integer mp_mgw_port := 2427;
 
charstring mp_msc_mncc := "/tmp/mncc";
+
+   integer mp_msc_smpp_port := 2775;
+   charstring mp_smpp_system_id := "msc_tester";
+   charstring mp_smpp_password := "osmocom1";
 
BSSAP_Configurations mp_bssap_cfg := {
{
@@ -123,6 +132,28 @@
self.stop;
}
 }
+
+function f_init_smpp(charstring id) runs on MTC_CT {
+   id := id & "-SMPP";
+   var EsmePars pars := {
+   mode := MODE_TRANSCEIVER,
+   bind := {
+   system_id := 

docker-playground[master]: ttcn3-msc-test: Add SMPP config bits

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2 Verified+1

-- 
To view, visit https://gerrit.osmocom.org/7803
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I595a1ca2d47667e654f8a0a69bfe98c91ac58d39
Gerrit-PatchSet: 1
Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: deps: Use SMPP from osmocom fork

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: deps: Use SMPP from osmocom fork
..


deps: Use SMPP from osmocom fork

the osmocom fork has support for AlertNotification, which upstream
doesn't.  Pull request is pending, so we have to use our osmocom
fork repo meanwhile.

Change-Id: I9b6b120fe74b46183517264d85651ac0d99b4035
---
M deps/Makefile
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/deps/Makefile b/deps/Makefile
index d1545fd..bf2211b 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -9,7 +9,6 @@
titan.ProtocolModules.IP \
titan.ProtocolModules.L2TP \
titan.ProtocolModules.M3UA \
-   titan.ProtocolModules.SMPP \
titan.ProtocolModules.TCP \
titan.ProtocolModules.UDP \
titan.ProtocolModules.RTP \
@@ -43,6 +42,7 @@
 OSMOGITHUB_REPOS=  titan.TestPorts.SCTPasp \
titan.TestPorts.MTP3asp \
titan.TestPorts.UNIX_DOMAIN_SOCKETasp \
+   titan.ProtocolModules.SMPP \
titan.ProtocolEmulations.M3UA
 
 ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS)
@@ -72,7 +72,7 @@
 titan.ProtocolModules.RTP_commit=  R.5.A
 titan.ProtocolModules.SCTP_commit= R.2.A
 titan.ProtocolModules.SDP_commit=  R.14.A
-titan.ProtocolModules.SMPP_commit= R.2.A
+titan.ProtocolModules.SMPP_commit= R.2.A-1-ge044a36
 titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
 titan.ProtocolModules.SUA_commit=  R.5.A
 titan.ProtocolModules.TCP_commit=  R.3.A

-- 
To view, visit https://gerrit.osmocom.org/7798
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9b6b120fe74b46183517264d85651ac0d99b4035
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-ttcn3-hacks[master]: msc: Add SMPP_Emulation + SMPP_Templates

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: msc: Add SMPP_Emulation + SMPP_Templates
..


msc: Add SMPP_Emulation + SMPP_Templates

Change-Id: I80efe16f603227694c6242d556ae77590271e4c6
---
A library/SMPP_Emulation.ttcn
A library/SMPP_Templates.ttcn
M msc/gen_links.sh
3 files changed, 539 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/SMPP_Emulation.ttcn b/library/SMPP_Emulation.ttcn
new file mode 100644
index 000..83e7801
--- /dev/null
+++ b/library/SMPP_Emulation.ttcn
@@ -0,0 +1,413 @@
+module SMPP_Emulation {
+
+/* SMPP Emulation layer, sitting on top of SMPP_CodecPort.
+ *
+ * (C) 2018 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ */
+
+
+import from Osmocom_Types all;
+import from General_Types all;
+import from SMPP_Types all;
+import from SMPP_Templates all;
+import from SMPP_CodecPort all;
+import from SMPP_CodecPort_CtrlFunct all;
+import from IPL4asp_Types all;
+import from IPL4asp_PortType all;
+import from Socket_API_Definitions all;
+
+/* general "base class" component definition, of which specific implementations
+ * derive themselves by menas of the "extends" feature */
+type component SMPP_ConnHdlr {
+   /* port towards SPPP_Emulation_CT */
+   port SMPP_Conn_PT SMPP;
+   port SMPPEM_PROC_PT SMPP_PROC;
+}
+
+
+type component SMPP_Emulation_CT {
+   /* down-facing port to SMPP Codec port */
+   port SMPP_CODEC_PT SMPP_PORT;
+   var IPL4asp_Types.ConnectionId g_smpp_conn_id := -1;
+
+   var integer g_seq := 1;
+
+   /* up-facing port to Clients */
+   port SMPP_Conn_PT SMPP_CLIENT;
+   port SMPPEM_PROC_PT SMPP_PROC;
+
+   var TransactionData TransactionTable[32];
+   var ExpectData ExpectTable[32];
+}
+
+type port SMPP_Conn_PT message {
+   inout SMPP_PDU;
+} with { extension "internal" };
+
+type record TransactionData {
+   uint32_ttid optional,
+   SMPP_ConnHdlr   vc_conn
+}
+
+type record ExpectData {
+   SMPP_TONdst_ton optional,
+   SMPP_NPIdst_npi optional,
+   charstring  dst_addr,
+   SMPP_ConnHdlr   vc_conn
+}
+
+private function f_trans_id_known(uint32_t tid)
+runs on SMPP_Emulation_CT return boolean {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].tid == tid) {
+   return true;
+   }
+   }
+   return false;
+}
+
+private function f_comp_known(SMPP_ConnHdlr client)
+runs on SMPP_Emulation_CT return boolean {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].vc_conn == client) {
+   return true;
+   }
+   }
+   return false;
+}
+
+private function f_comp_by_trans_id(uint32_t tid)
+runs on SMPP_Emulation_CT return SMPP_ConnHdlr {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].tid == tid) {
+   return TransactionTable[i].vc_conn;
+   }
+   }
+   setverdict(fail, "No componten for SMPP TID ", tid);
+   self.stop;
+}
+
+
+private function f_trans_table_init()
+runs on SMPP_Emulation_CT {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   TransactionTable[i].vc_conn := null;
+   TransactionTable[i].tid := omit;
+   }
+}
+
+private function f_trans_table_add(SMPP_ConnHdlr vc_conn, uint32_t trans_id)
+runs on SMPP_Emulation_CT {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].vc_conn == null) {
+   TransactionTable[i].vc_conn := vc_conn;
+   TransactionTable[i].tid := trans_id;
+   return;
+   }
+   }
+   setverdict(fail, "SMPP Trans table full!");
+   self.stop;
+}
+
+private function f_trans_table_del(uint32_t trans_id)
+runs on SMPP_Emulation_CT {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].tid == trans_id) {
+   TransactionTable[i].vc_conn := null;
+   TransactionTable[i].tid := omit;
+   return;
+   }
+   }
+   setverdict(fail, "SMPP Trans table attempt to delete non-existant ", 
trans_id);
+   self.stop;
+}
+
+
+
+function f_connect(charstring remote_host, IPL4asp_Types.PortNumber 
remote_port,
+  charstring local_host, IPL4asp_Types.PortNumber local_port)
+runs on SMPP_Emulation_CT {
+   var IPL4asp_Types.Result res;
+   res := 

[MERGED] osmo-ttcn3-hacks[master]: msc: Fix console log levels

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: msc: Fix console log levels
..


msc: Fix console log levels

In Change-Id I52a4c8118828c1605cf672889982f987568ad17d we introduced
a name change for the SCCP/M3UA components, which meant that the log
level configuration did no longer apply as intended.

Change-Id: Iebdaf3446a81ea5f8310110f5cca2bdb3e552e3f
---
M msc/MSC_Tests.default
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default
index 93f0f80..cd984fd 100644
--- a/msc/MSC_Tests.default
+++ b/msc/MSC_Tests.default
@@ -2,8 +2,10 @@
 FileMask := LOG_ALL | TTCN_MATCHING;
 
 BSSAP.FileMask := LOG_NOTHING;
-"MSC_Test-M3UA".FileMask := ERROR | WARNING;
-"MSC_Test-SCCP".FileMask := ERROR | WARNING;
+"MSC_Test_0-M3UA".FileMask := ERROR | WARNING;
+"MSC_Test_0-SCCP".FileMask := ERROR | WARNING;
+"MSC_Test_1-M3UA".FileMask := ERROR | WARNING;
+"MSC_Test_1-SCCP".FileMask := ERROR | WARNING;
 "MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING;
 "MSC_Test-GSUP".FileMask := ERROR | WARNING;
 "IPA-CTRL-IPA".FileMask := ERROR | WARNING;

-- 
To view, visit https://gerrit.osmocom.org/7802
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebdaf3446a81ea5f8310110f5cca2bdb3e552e3f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 


osmo-ttcn3-hacks[master]: msc: Fix console log levels

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7802
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iebdaf3446a81ea5f8310110f5cca2bdb3e552e3f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: msc: Fix console log levels

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7802

msc: Fix console log levels

In Change-Id I52a4c8118828c1605cf672889982f987568ad17d we introduced
a name change for the SCCP/M3UA components, which meant that the log
level configuration did no longer apply as intended.

Change-Id: Iebdaf3446a81ea5f8310110f5cca2bdb3e552e3f
---
M msc/MSC_Tests.default
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/02/7802/1

diff --git a/msc/MSC_Tests.default b/msc/MSC_Tests.default
index 93f0f80..cd984fd 100644
--- a/msc/MSC_Tests.default
+++ b/msc/MSC_Tests.default
@@ -2,8 +2,10 @@
 FileMask := LOG_ALL | TTCN_MATCHING;
 
 BSSAP.FileMask := LOG_NOTHING;
-"MSC_Test-M3UA".FileMask := ERROR | WARNING;
-"MSC_Test-SCCP".FileMask := ERROR | WARNING;
+"MSC_Test_0-M3UA".FileMask := ERROR | WARNING;
+"MSC_Test_0-SCCP".FileMask := ERROR | WARNING;
+"MSC_Test_1-M3UA".FileMask := ERROR | WARNING;
+"MSC_Test_1-SCCP".FileMask := ERROR | WARNING;
 "MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING;
 "MSC_Test-GSUP".FileMask := ERROR | WARNING;
 "IPA-CTRL-IPA".FileMask := ERROR | WARNING;

-- 
To view, visit https://gerrit.osmocom.org/7802
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebdaf3446a81ea5f8310110f5cca2bdb3e552e3f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-ttcn3-hacks[master]: msc: Add SMPP_Emulation + SMPP_Templates

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7800
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I80efe16f603227694c6242d556ae77590271e4c6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: msc: Add SMPP_CodecPort

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7799
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I57640ccc5370d6820bc303003e162f27ddc9fcfd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: msc: Add SMPP tests for MO + MT SMS

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7801
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5349559c7c3096533fb07fcf53f0a44ff7f6567f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: deps: Use SMPP from osmocom fork

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7798
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9b6b120fe74b46183517264d85651ac0d99b4035
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: msc: Fix ti_flag mistake in f_mt_sms()

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: msc: Fix ti_flag mistake in f_mt_sms()
..


msc: Fix ti_flag mistake in f_mt_sms()

The L3 transaction-id in MT-SMS is allocated in the MSC, so any
messages we expect from the MSC must carry c_TIF_ORIG.

Change-Id: I6ea977a7662fdfc9c504f13ac5632ac20a04f522
---
M msc/BSC_ConnectionHandler.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 733daab..8c9b723 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -880,7 +880,7 @@
BSSAP.send(ts_PDU_DTAP_MO(l3_mo, spars.dlci, true));
 
/* expect CP-ACK for CP-DATA(RP-ACK) just sent */
-   l3_mt := tr_ML3_MT_SMS(spars.tid, c_TIF_REPL, tr_CP_ACK_MT);
+   l3_mt := tr_ML3_MT_SMS(spars.tid, c_TIF_ORIG, tr_CP_ACK_MT);
BSSAP.receive(tr_PDU_DTAP_MT(l3_mt, spars.dlci));
 
deactivate(d);

-- 
To view, visit https://gerrit.osmocom.org/7797
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ea977a7662fdfc9c504f13ac5632ac20a04f522
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-ttcn3-hacks[master]: msc: Fix ti_flag mistake in f_mt_sms()

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7797
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6ea977a7662fdfc9c504f13ac5632ac20a04f522
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-msc[master]: sms_queue: fix use-after-free on 'pending'

2018-04-14 Thread Harald Welte

Patch Set 2: Verified+1

-- 
To view, visit https://gerrit.osmocom.org/7796
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No


[MERGED] osmo-msc[master]: sms_queue: fix use-after-free on 'pending'

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: sms_queue: fix use-after-free on 'pending'
..


sms_queue: fix use-after-free on 'pending'

This bug is super obvious: We cannot first call
sms_pending_free(pending) and then in the next line still dereference
the pending->sms_id member.

This bug was introduced in January with Change-Id: 
I3749855fe25d9d4e37ec96b0c2bffbc692b66a78
and apparently nobody has tested any MT-SMS with asan enabled since?

Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Closes: OS#3152
---
M src/libmsc/sms_queue.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index 7d59787..ed11123 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -480,8 +480,8 @@
/* Remember the subscriber and clear the pending entry */
network->sms_queue->pending -= 1;
vsub = vlr_subscr_get(pending->vsub);
-   sms_pending_free(pending);
db_sms_delete_sent_message_by_id(pending->sms_id);
+   sms_pending_free(pending);
/* Attempt to send another SMS to this subscriber */
sms_send_next(vsub);
vlr_subscr_put(vsub);

-- 
To view, visit https://gerrit.osmocom.org/7796
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 


[PATCH] osmo-ttcn3-hacks[master]: msc: Add SMPP_CodecPort

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7799

msc: Add SMPP_CodecPort

Change-Id: I57640ccc5370d6820bc303003e162f27ddc9fcfd
---
A library/SMPP_CodecPort.ttcn
A library/SMPP_CodecPort_CtrlFunct.ttcn
A library/SMPP_CodecPort_CtrlFunctDef.cc
M msc/gen_links.sh
M msc/regen_makefile.sh
5 files changed, 185 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/99/7799/1

diff --git a/library/SMPP_CodecPort.ttcn b/library/SMPP_CodecPort.ttcn
new file mode 100644
index 000..0ac81ae
--- /dev/null
+++ b/library/SMPP_CodecPort.ttcn
@@ -0,0 +1,65 @@
+module SMPP_CodecPort {
+
+/* Simple SMPP Codec Port, translating between raw TCP octetstring payload
+ * towards the IPL4asp port provider, and SMPP primitives
+ * which carry the decoded SMPP data types as payload.
+ *
+ * (C) 2018 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ */
+
+
+import from IPL4asp_PortType all;
+import from IPL4asp_Types all;
+import from SMPP_Types all;
+
+type record SMPP_RecvFrom {
+   ConnectionIdconnId,
+   SMPP_PDUmsg
+}
+
+type record SMPP_Send {
+   ConnectionIdconnId,
+   SMPP_PDUmsg
+}
+
+template (value) SMPP_Send ts_SMPP_Send(ConnectionId conn_id, template (value) 
SMPP_PDU msg) := {
+   connId := conn_id,
+   msg := msg
+}
+
+template SMPP_RecvFrom tr_SMPP_Recv(template ConnectionId conn_id, template 
SMPP_PDU msg) := {
+   connId := conn_id,
+   msg := msg
+}
+
+private function IPL4_to_SMPP_RecvFrom(in ASP_RecvFrom pin, out SMPP_RecvFrom 
pout) {
+   var integer rc;
+   pout.connId := pin.connId;
+   rc := f_decode_SMPP(pin.msg, pout.msg);
+} with { extension "prototype(fast)" }
+
+private function SMPP_to_IPL4_Send(in SMPP_Send pin, out ASP_Send pout) {
+   pout.connId := pin.connId;
+   pout.proto := { tcp := {} };
+   f_encode_SMPP(pin.msg, pout.msg);
+} with { extension "prototype(fast)" }
+
+type port SMPP_CODEC_PT message {
+   out SMPP_Send;
+   in  SMPP_RecvFrom,
+   ASP_ConnId_ReadyToRelease,
+   ASP_Event;
+} with { extension "user IPL4asp_PT
+   out(SMPP_Send -> ASP_Send: function(SMPP_to_IPL4_Send))
+   in(ASP_RecvFrom -> SMPP_RecvFrom: function(IPL4_to_SMPP_RecvFrom);
+  ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
+  ASP_Event -> ASP_Event: simple)"
+}
+
+
+
+}
diff --git a/library/SMPP_CodecPort_CtrlFunct.ttcn 
b/library/SMPP_CodecPort_CtrlFunct.ttcn
new file mode 100644
index 000..2f6d616
--- /dev/null
+++ b/library/SMPP_CodecPort_CtrlFunct.ttcn
@@ -0,0 +1,52 @@
+module SMPP_CodecPort_CtrlFunct {
+
+  import from SMPP_CodecPort all;
+  import from IPL4asp_Types all;
+
+  external function f_IPL4_listen(
+inout SMPP_CODEC_PT portRef,
+in HostName locName,
+in PortNumber locPort,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_connect(
+inout SMPP_CODEC_PT portRef,
+in HostName remName,
+in PortNumber remPort,
+in HostName locName,
+in PortNumber locPort,
+in ConnectionId connId,
+in ProtoTuple proto,
+in OptionList options := {}
+  ) return Result;
+
+  external function f_IPL4_close(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+in ProtoTuple proto := { unspecified := {} }
+  ) return Result;
+
+  external function f_IPL4_setUserData(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+in UserData userData
+  ) return Result;
+
+  external function f_IPL4_getUserData(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+out UserData userData
+  ) return Result;
+
+  external function f_IPL4_setGetMsgLen(
+inout SMPP_CODEC_PT portRef,
+in ConnectionId id,
+inout f_IPL4_getMsgLen f,
+in ro_integer msgLenArgs
+  );
+
+
+}
+
diff --git a/library/SMPP_CodecPort_CtrlFunctDef.cc 
b/library/SMPP_CodecPort_CtrlFunctDef.cc
new file mode 100644
index 000..31603e4
--- /dev/null
+++ b/library/SMPP_CodecPort_CtrlFunctDef.cc
@@ -0,0 +1,66 @@
+#include "IPL4asp_PortType.hh"
+#include "SMPP_CodecPort.hh"
+#include "IPL4asp_PT.hh"
+
+namespace SMPP__CodecPort__CtrlFunct {
+
+  IPL4asp__Types::Result f__IPL4__listen(
+SMPP__CodecPort::SMPP__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+const IPL4asp__Types::ProtoTuple& proto,
+const IPL4asp__Types::OptionList& options)
+  {
+return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, 
options);
+  }
+  
+  IPL4asp__Types::Result f__IPL4__connect(
+SMPP__CodecPort::SMPP__CODEC__PT& portRef,
+const IPL4asp__Types::HostName& remName,
+const IPL4asp__Types::PortNumber& remPort,
+const IPL4asp__Types::HostName& locName,
+const IPL4asp__Types::PortNumber& locPort,
+  

[PATCH] osmo-ttcn3-hacks[master]: msc: Add SMPP tests for MO + MT SMS

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7801

msc: Add SMPP tests for MO + MT SMS

Change-Id: I5349559c7c3096533fb07fcf53f0a44ff7f6567f
---
M library/Osmocom_VTY_Functions.ttcn
M library/SMPP_Templates.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
4 files changed, 269 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/01/7801/1

diff --git a/library/Osmocom_VTY_Functions.ttcn 
b/library/Osmocom_VTY_Functions.ttcn
index 9258fa5..2b74694 100644
--- a/library/Osmocom_VTY_Functions.ttcn
+++ b/library/Osmocom_VTY_Functions.ttcn
@@ -108,11 +108,14 @@
f_vty_transceive(pt, "timeslot " & int2str(ts));
}
 
-function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
+type record of charstring rof_charstring;
+function f_vty_config2(TELNETasp_PT pt, rof_charstring config_nodes, 
charstring cmd)
 {
/* enter config mode; enter node */
f_vty_enter_config(pt);
-   f_vty_transceive(pt, config_node);
+   for (var integer i := 0; i < sizeof(config_nodes); i := i+1) {
+   f_vty_transceive(pt, config_nodes[i]);
+   }
/* execute command */
f_vty_transceive(pt, cmd);
/* leave config mode */
@@ -120,4 +123,10 @@
 }
 
 
+function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd)
+{
+   f_vty_config2(pt, {config_node}, cmd);
+}
+
+
 }
diff --git a/library/SMPP_Templates.ttcn b/library/SMPP_Templates.ttcn
index 9a56cf2..2ff675d 100644
--- a/library/SMPP_Templates.ttcn
+++ b/library/SMPP_Templates.ttcn
@@ -119,6 +119,21 @@
}
 }
 
+template (value) SMPP_PDU ts_SMPP_SUBMIT_SM(SMPP_SM sm) := {
+   header := ts_SMPP_hdr(c_SMPP_command_id_submit_sm, ESME_ROK),
+   body := {
+   submit_sm := sm
+   }
+}
+
+/* Section 5.2.12 esm_class */
+template SMPP_BIT1 tr_ESM_CLASS_DEFAULT := '??00'B;
+template SMPP_BIT1 tr_ESM_CLASS_DATAGRAM := '??01'B;
+template SMPP_BIT1 tr_ESM_CLASS_TRANSACTION := '??10'B;
+template SMPP_BIT1 tr_ESM_CLASS_STORE_FORWARD := '??11'B;
+template SMPP_BIT1 tr_ESM_CLASS_UDHI := '?1??'B;
+template SMPP_BIT1 tr_ESM_CLASS_REPLYP_PATH := '1???'B;
+
 
 
 
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 8c9b723..b7a4f50 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -29,8 +29,10 @@
 import from L3_Templates all;
 import from L3_Common all;
 
+import from SMPP_Emulation all;
+
 /* this component represents a single subscriber connection */
-type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, 
GSUP_ConnHdlr, MGCP_ConnHdlr {
+type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, 
GSUP_ConnHdlr, MGCP_ConnHdlr, SMPP_ConnHdlr {
var BSC_ConnHdlrPars g_pars;
timer g_Tguard := 60.0;
 }
@@ -118,6 +120,8 @@
/* Start guard timer and activate it as default */
g_Tguard.start(t_guard);
activate(as_Tguard());
+   /* Route all SMPP messages for our MSISDN to us */
+   f_create_smpp_expect(hex2str(pars.msisdn));
 }
 
 
@@ -817,6 +821,9 @@
 
var default d := activate(as_other_sms());
 
+   /* just in case this is routed to SMPP.. */
+   f_create_smpp_expect(hex2str(spars.tp.da.tP_DA_NoPad.tP_DAValue));
+
tp_mo := ts_SMS_SUBMIT(spars.tp.msg_ref, spars.tp.da, spars.tp.pid, 
spars.tp.dcs,
 spars.tp.udl, spars.tp.ud);
rp_mo := ts_RP_DATA_MO(spars.rp.msg_ref, spars.rp.orig, spars.rp.dest, 
tp_mo);
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index bb28c74..1ede8e6 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -47,6 +47,10 @@
 import from L3_Templates all;
 import from L3_Common all;
 
+import from SMPP_Types all;
+import from SMPP_Templates all;
+import from SMPP_Emulation all;
+
 const integer NUM_BSC := 2;
 type record of BSSAP_Configuration BSSAP_Configurations;
 
@@ -60,6 +64,7 @@
var MGCP_Emulation_CT vc_MGCP;
var GSUP_Emulation_CT vc_GSUP;
var IPA_Emulation_CT vc_GSUP_IPA;
+   var SMPP_Emulation_CT vc_SMPP;
 
/* only to get events from IPA underneath GSUP */
port IPA_CTRL_PT GSUP_IPA_EVENT;
@@ -90,6 +95,10 @@
integer mp_mgw_port := 2427;
 
charstring mp_msc_mncc := "/tmp/mncc";
+
+   integer mp_msc_smpp_port := 2775;
+   charstring mp_smpp_system_id := "msc_tester";
+   charstring mp_smpp_password := "osmocom1";
 
BSSAP_Configurations mp_bssap_cfg := {
{
@@ -123,6 +132,28 @@
self.stop;
}
 }
+
+function f_init_smpp(charstring id) runs on MTC_CT {
+   id := id & "-SMPP";
+   var EsmePars pars := {
+   mode := MODE_TRANSCEIVER,
+   bind := {
+   system_id := mp_smpp_system_id,
+   password := mp_smpp_password,
+   system_type := "MSC_Tests",
+   

[PATCH] osmo-ttcn3-hacks[master]: msc: Fix ti_flag mistake in f_mt_sms()

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7797

msc: Fix ti_flag mistake in f_mt_sms()

The L3 transaction-id in MT-SMS is allocated in the MSC, so any
messages we expect from the MSC must carry c_TIF_ORIG.

Change-Id: I6ea977a7662fdfc9c504f13ac5632ac20a04f522
---
M msc/BSC_ConnectionHandler.ttcn
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/97/7797/1

diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 733daab..8c9b723 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -880,7 +880,7 @@
BSSAP.send(ts_PDU_DTAP_MO(l3_mo, spars.dlci, true));
 
/* expect CP-ACK for CP-DATA(RP-ACK) just sent */
-   l3_mt := tr_ML3_MT_SMS(spars.tid, c_TIF_REPL, tr_CP_ACK_MT);
+   l3_mt := tr_ML3_MT_SMS(spars.tid, c_TIF_ORIG, tr_CP_ACK_MT);
BSSAP.receive(tr_PDU_DTAP_MT(l3_mt, spars.dlci));
 
deactivate(d);

-- 
To view, visit https://gerrit.osmocom.org/7797
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ea977a7662fdfc9c504f13ac5632ac20a04f522
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-ttcn3-hacks[master]: msc: Add SMPP_Emulation + SMPP_Templates

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7800

msc: Add SMPP_Emulation + SMPP_Templates

Change-Id: I80efe16f603227694c6242d556ae77590271e4c6
---
A library/SMPP_Emulation.ttcn
A library/SMPP_Templates.ttcn
M msc/gen_links.sh
3 files changed, 539 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/00/7800/1

diff --git a/library/SMPP_Emulation.ttcn b/library/SMPP_Emulation.ttcn
new file mode 100644
index 000..83e7801
--- /dev/null
+++ b/library/SMPP_Emulation.ttcn
@@ -0,0 +1,413 @@
+module SMPP_Emulation {
+
+/* SMPP Emulation layer, sitting on top of SMPP_CodecPort.
+ *
+ * (C) 2018 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ */
+
+
+import from Osmocom_Types all;
+import from General_Types all;
+import from SMPP_Types all;
+import from SMPP_Templates all;
+import from SMPP_CodecPort all;
+import from SMPP_CodecPort_CtrlFunct all;
+import from IPL4asp_Types all;
+import from IPL4asp_PortType all;
+import from Socket_API_Definitions all;
+
+/* general "base class" component definition, of which specific implementations
+ * derive themselves by menas of the "extends" feature */
+type component SMPP_ConnHdlr {
+   /* port towards SPPP_Emulation_CT */
+   port SMPP_Conn_PT SMPP;
+   port SMPPEM_PROC_PT SMPP_PROC;
+}
+
+
+type component SMPP_Emulation_CT {
+   /* down-facing port to SMPP Codec port */
+   port SMPP_CODEC_PT SMPP_PORT;
+   var IPL4asp_Types.ConnectionId g_smpp_conn_id := -1;
+
+   var integer g_seq := 1;
+
+   /* up-facing port to Clients */
+   port SMPP_Conn_PT SMPP_CLIENT;
+   port SMPPEM_PROC_PT SMPP_PROC;
+
+   var TransactionData TransactionTable[32];
+   var ExpectData ExpectTable[32];
+}
+
+type port SMPP_Conn_PT message {
+   inout SMPP_PDU;
+} with { extension "internal" };
+
+type record TransactionData {
+   uint32_ttid optional,
+   SMPP_ConnHdlr   vc_conn
+}
+
+type record ExpectData {
+   SMPP_TONdst_ton optional,
+   SMPP_NPIdst_npi optional,
+   charstring  dst_addr,
+   SMPP_ConnHdlr   vc_conn
+}
+
+private function f_trans_id_known(uint32_t tid)
+runs on SMPP_Emulation_CT return boolean {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].tid == tid) {
+   return true;
+   }
+   }
+   return false;
+}
+
+private function f_comp_known(SMPP_ConnHdlr client)
+runs on SMPP_Emulation_CT return boolean {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].vc_conn == client) {
+   return true;
+   }
+   }
+   return false;
+}
+
+private function f_comp_by_trans_id(uint32_t tid)
+runs on SMPP_Emulation_CT return SMPP_ConnHdlr {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].tid == tid) {
+   return TransactionTable[i].vc_conn;
+   }
+   }
+   setverdict(fail, "No componten for SMPP TID ", tid);
+   self.stop;
+}
+
+
+private function f_trans_table_init()
+runs on SMPP_Emulation_CT {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   TransactionTable[i].vc_conn := null;
+   TransactionTable[i].tid := omit;
+   }
+}
+
+private function f_trans_table_add(SMPP_ConnHdlr vc_conn, uint32_t trans_id)
+runs on SMPP_Emulation_CT {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].vc_conn == null) {
+   TransactionTable[i].vc_conn := vc_conn;
+   TransactionTable[i].tid := trans_id;
+   return;
+   }
+   }
+   setverdict(fail, "SMPP Trans table full!");
+   self.stop;
+}
+
+private function f_trans_table_del(uint32_t trans_id)
+runs on SMPP_Emulation_CT {
+   for (var integer i := 0; i < sizeof(TransactionTable); i := i+1) {
+   if (TransactionTable[i].tid == trans_id) {
+   TransactionTable[i].vc_conn := null;
+   TransactionTable[i].tid := omit;
+   return;
+   }
+   }
+   setverdict(fail, "SMPP Trans table attempt to delete non-existant ", 
trans_id);
+   self.stop;
+}
+
+
+
+function f_connect(charstring remote_host, IPL4asp_Types.PortNumber 
remote_port,
+  charstring local_host, IPL4asp_Types.PortNumber local_port)
+runs on SMPP_Emulation_CT {
+   var IPL4asp_Types.Result res;
+   res := SMPP_CodecPort_CtrlFunct.f_IPL4_connect(SMPP_PORT, remote_host, 
remote_port,
+   local_host, local_port, 
0, { tcp :={} });

[PATCH] osmo-ttcn3-hacks[master]: deps: Use SMPP from osmocom fork

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7798

deps: Use SMPP from osmocom fork

the osmocom fork has support for AlertNotification, which upstream
doesn't.  Pull request is pending, so we have to use our osmocom
fork repo meanwhile.

Change-Id: I9b6b120fe74b46183517264d85651ac0d99b4035
---
M deps/Makefile
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/98/7798/1

diff --git a/deps/Makefile b/deps/Makefile
index d1545fd..bf2211b 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -9,7 +9,6 @@
titan.ProtocolModules.IP \
titan.ProtocolModules.L2TP \
titan.ProtocolModules.M3UA \
-   titan.ProtocolModules.SMPP \
titan.ProtocolModules.TCP \
titan.ProtocolModules.UDP \
titan.ProtocolModules.RTP \
@@ -43,6 +42,7 @@
 OSMOGITHUB_REPOS=  titan.TestPorts.SCTPasp \
titan.TestPorts.MTP3asp \
titan.TestPorts.UNIX_DOMAIN_SOCKETasp \
+   titan.ProtocolModules.SMPP \
titan.ProtocolEmulations.M3UA
 
 ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS)
@@ -72,7 +72,7 @@
 titan.ProtocolModules.RTP_commit=  R.5.A
 titan.ProtocolModules.SCTP_commit= R.2.A
 titan.ProtocolModules.SDP_commit=  R.14.A
-titan.ProtocolModules.SMPP_commit= R.2.A
+titan.ProtocolModules.SMPP_commit= R.2.A-1-ge044a36
 titan.ProtocolModules.SNDCP_v7.0.0_commit= R.2.A
 titan.ProtocolModules.SUA_commit=  R.5.A
 titan.ProtocolModules.TCP_commit=  R.3.A

-- 
To view, visit https://gerrit.osmocom.org/7798
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b6b120fe74b46183517264d85651ac0d99b4035
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] osmo-bsc[master]: inform A-RESET FSM about MSC CR timeouts

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: inform A-RESET FSM about MSC CR timeouts
..


inform A-RESET FSM about MSC CR timeouts

The SUBSCR_CONN (GSCON) fsm starts a timer (993210, 20sec.) when the
CR to the MSC is made. When the timer reaches its timeout, then the
SUBSC_CONN FSM terminates. Such a timeout event is also an indicator
for a bad SCCP connection so we should call a_reset_conn_fail() to
inform the A-RESET FSM about the event in order to cause a BSSMAP
reset when too many timeouts occurr consecutively

- Call a_reset_conn_fail() when 993210 expires

Change-Id: I836a552f2ad37c160081246579f842d104d0dd35
Related: OS#3102
---
M src/libbsc/bsc_subscr_conn_fsm.c
1 file changed, 9 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/bsc_subscr_conn_fsm.c b/src/libbsc/bsc_subscr_conn_fsm.c
index a24cb31..a63483e 100644
--- a/src/libbsc/bsc_subscr_conn_fsm.c
+++ b/src/libbsc/bsc_subscr_conn_fsm.c
@@ -1058,8 +1058,15 @@
 
switch (fi->T) {
case 993210:
-   /* MSC has not responded/confirmed connection witH CC */
-   /* N-DISCONNET.req is sent in gscon_cleanup() above */
+   /* MSC has not responded/confirmed connection with CC, this
+* could indicate a bad SCCP connection. We now inform the the
+* FSM that controls the BSSMAP reset about the event. Maybe
+* a BSSMAP reset is necessary. */
+   a_reset_conn_fail(conn->sccp.msc->a.reset);
+
+   /* Since we could not reach the MSC, we give up and terminate
+* the FSM instance now (N-DISCONNET.req is sent in
+* gscon_cleanup() above) */
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL);
break;
case GSM0808_T10_TIMER_NR:  /* Assignment Failed */

-- 
To view, visit https://gerrit.osmocom.org/7794
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I836a552f2ad37c160081246579f842d104d0dd35
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-msc[master]: smpp: Unset esme->acl on socket close

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: smpp: Unset esme->acl on socket close
..


smpp: Unset esme->acl on socket close

We set acl->esme during _process_bind(), but we don't clear it
in case the TCP connection for the ESME is dead.  This leads to
a stale acl->esme pointer, which we will attempt to dereference
the next time a SMS is delivered to a route pointing to this acl,
where it will be a heap use-after-free.

This was discovered using AddressSanitizer and MSC_Tests.ttcn

Closes: OS#3168
Change-Id: I1f140d7f9c7d89f200ddbcd81a8df66de69fb3e4
---
M src/libmsc/smpp_smsc.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index b889b52..7bbb0a4 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -249,6 +249,8 @@
}
smpp_cmd_flush_pending(esme);
llist_del(>list);
+   if (esme->acl)
+   esme->acl->esme = NULL;
talloc_free(esme);
 }
 
@@ -875,6 +877,8 @@
osmo_fd_unregister(>wqueue.bfd);
close(esme->wqueue.bfd.fd);
esme->wqueue.bfd.fd = -1;
+   if (esme->acl)
+   esme->acl->esme = NULL;
smpp_esme_put(esme);
 
return 0;
@@ -891,6 +895,8 @@
osmo_fd_unregister(>wqueue.bfd);
close(esme->wqueue.bfd.fd);
esme->wqueue.bfd.fd = -1;
+   if (esme->acl)
+   esme->acl->esme = NULL;
smpp_esme_put(esme);
} else if (rc < msgb_length(msg)) {
LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id);

-- 
To view, visit https://gerrit.osmocom.org/7795
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f140d7f9c7d89f200ddbcd81a8df66de69fb3e4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-msc[master]: smpp: Unset esme->acl on socket close

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7795
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1f140d7f9c7d89f200ddbcd81a8df66de69fb3e4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-msc[master]: sms_queue: fix use-after-free on 'pending'

2018-04-14 Thread Harald Welte

sms_queue: fix use-after-free on 'pending'

This bug is super obvious: We cannot first call
sms_pending_free(pending) and then in the next line still dereference
the pending->sms_id member.

This bug was introduced in January with Change-Id: 
I3749855fe25d9d4e37ec96b0c2bffbc692b66a78
and apparently nobody has tested any MT-SMS with asan enabled since?

Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Closes: OS#3152
---
M src/libmsc/sms_queue.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/7796/2

diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index 7d59787..ed11123 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -480,8 +480,8 @@
/* Remember the subscriber and clear the pending entry */
network->sms_queue->pending -= 1;
vsub = vlr_subscr_get(pending->vsub);
-   sms_pending_free(pending);
db_sms_delete_sent_message_by_id(pending->sms_id);
+   sms_pending_free(pending);
/* Attempt to send another SMS to this subscriber */
sms_send_next(vsub);
vlr_subscr_put(vsub);

-- 
To view, visit https://gerrit.osmocom.org/7796
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-msc[master]: sms_queue: fix use-after-free on 'pending'

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7796

sms_queue: fix use-after-free on 'pending'

This bug is super obvious: We cannot first call
sms_pending_free(pending) and then in the next line still dereference
the pending->sms_id member.

Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Closes: OS#3152
---
M src/libmsc/sms_queue.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/7796/1

diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index 7d59787..ed11123 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -480,8 +480,8 @@
/* Remember the subscriber and clear the pending entry */
network->sms_queue->pending -= 1;
vsub = vlr_subscr_get(pending->vsub);
-   sms_pending_free(pending);
db_sms_delete_sent_message_by_id(pending->sms_id);
+   sms_pending_free(pending);
/* Attempt to send another SMS to this subscriber */
sms_send_next(vsub);
vlr_subscr_put(vsub);

-- 
To view, visit https://gerrit.osmocom.org/7796
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf17f270cdeb8153036eda3de274dd163bbff7e6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


Build failed in Jenkins: master-asn1c » a1=default,a2=default,a3=default,osmocom-master-debian9 #91

2018-04-14 Thread jenkins
See 


--
[...truncated 3.74 KB...]
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared 
libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for autoconf... /usr/bin/autoconf
checking for autoheader... /usr/bin/autoheader
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style 

[PATCH] osmo-msc[master]: smpp: Unset esme->acl on socket close

2018-04-14 Thread Harald Welte

Review at  https://gerrit.osmocom.org/7795

smpp: Unset esme->acl on socket close

We set acl->esme during _process_bind(), but we don't clear it
in case the TCP connection for the ESME is dead.  This leads to
a stale acl->esme pointer, which we will attempt to dereference
the next time a SMS is delivered to a route pointing to this acl,
where it will be a heap use-after-free.

This was discovered using AddressSanitizer and MSC_Tests.ttcn

Closes: OS#3168
Change-Id: I1f140d7f9c7d89f200ddbcd81a8df66de69fb3e4
---
M src/libmsc/smpp_smsc.c
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/7795/1

diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c
index b889b52..7bbb0a4 100644
--- a/src/libmsc/smpp_smsc.c
+++ b/src/libmsc/smpp_smsc.c
@@ -249,6 +249,8 @@
}
smpp_cmd_flush_pending(esme);
llist_del(>list);
+   if (esme->acl)
+   esme->acl->esme = NULL;
talloc_free(esme);
 }
 
@@ -875,6 +877,8 @@
osmo_fd_unregister(>wqueue.bfd);
close(esme->wqueue.bfd.fd);
esme->wqueue.bfd.fd = -1;
+   if (esme->acl)
+   esme->acl->esme = NULL;
smpp_esme_put(esme);
 
return 0;
@@ -891,6 +895,8 @@
osmo_fd_unregister(>wqueue.bfd);
close(esme->wqueue.bfd.fd);
esme->wqueue.bfd.fd = -1;
+   if (esme->acl)
+   esme->acl->esme = NULL;
smpp_esme_put(esme);
} else if (rc < msgb_length(msg)) {
LOGP(DSMPP, LOGL_ERROR, "[%s] Short write\n", esme->system_id);

-- 
To view, visit https://gerrit.osmocom.org/7795
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f140d7f9c7d89f200ddbcd81a8df66de69fb3e4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-ttcn3-hacks[master]: LAPDm: Re-structure: Merge Frame type A+B which are really t...

2018-04-14 Thread Harald Welte

Patch Set 3: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7254
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7b3079899f42a61d67be03e3a17346af80d7b3be
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-ci[master]: jobs: gerrit-osmo-ttcn3-hacks: Make deps before cleaning

2018-04-14 Thread Harald Welte

Patch Set 3: Verified+1

-- 
To view, visit https://gerrit.osmocom.org/7406
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I07fee78bba5b07c7f3f4359869e00ef2583e0769
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No


[MERGED] osmo-ci[master]: jobs: gerrit-osmo-ttcn3-hacks: Make deps before cleaning

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: jobs: gerrit-osmo-ttcn3-hacks: Make deps before cleaning
..


jobs: gerrit-osmo-ttcn3-hacks: Make deps before cleaning

make clean has subdir/Makefile as dependency. As a result,
subdir/gen_links.sh and subdir/makefile-regen.sh are called, and
ttcn3_makefilegen in there fails because the dep symlinks are done
against missing files (because git repos in deps have not been checked
out).

Additionally, since 61c11e9234b3f9e087aba94380892ab66abc1191 make
deps-update is equivalent to make deps since the dependency tracking
system was improved, so we can remove it as it's not needed anymore.

Change-Id: I07fee78bba5b07c7f3f4359869e00ef2583e0769
---
M jobs/gerrit-verifications.yml
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 640bde7..7613802 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -189,7 +189,8 @@
   slave_axis: !!python/tuple [ttcn3]
   cmd: >
# keep first line with less indent to preserve newlines
-make clean; make deps-update && make compile
+set -e
+make deps; make clean; make compile
 
 jobs:
   - 'gerrit-{repos}'

-- 
To view, visit https://gerrit.osmocom.org/7406
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I07fee78bba5b07c7f3f4359869e00ef2583e0769
Gerrit-PatchSet: 4
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


[MERGED] osmo-bsc[master]: fix handling of state changes in acc ramping

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: fix handling of state changes in acc ramping
..


fix handling of state changes in acc ramping

Take both the operative and administrative states into account
when deciding whether to start ACC ramping, and examine old/new
state values to avoid triggering ramping for a no-op state change.

This requires a fix to gsm_trx_lock_rf(): This function overwrote
the old administrative state of a trx before enqueuing a state
change request towards the BTS.
The BTS will confirm this request with an ACK, at which time a
signal is generated which the ACC ramp code listens to. We must
not overwrite the old state value until the signal has been handled,
otherwise the signal handler cannot tell what the old state was.

Tested with a virtphy setup, nanobts, and osmo-bts.

Change-Id: Ib3291439655598fb5ddc891a3e4cc35b0bad250f
Related: OS#2591
---
M src/libbsc/abis_nm.c
M src/libbsc/acc_ramp.c
M src/libbsc/bsc_init.c
3 files changed, 113 insertions(+), 37 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index 2ee2e24..e3c4408 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -2844,13 +2844,17 @@
 {
uint8_t new_state = locked ? NM_STATE_LOCKED : NM_STATE_UNLOCKED;
 
-   LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Changing adm. state %s -> %s 
[%s]\n", trx->bts->nr, trx->nr,
+
+   if (!trx->bts || !trx->bts->oml_link) {
+   /* Set initial state which will be sent when BTS connects. */
+   trx->mo.nm_state.administrative = new_state;
+   return;
+   }
+
+   LOGP(DNM, LOGL_NOTICE, "(bts=%d,trx=%d) Requesting administrative state 
change %s -> %s [%s]\n",
+trx->bts->nr, trx->nr,
 get_value_string(abis_nm_adm_state_names, 
trx->mo.nm_state.administrative),
 get_value_string(abis_nm_adm_state_names, new_state), reason);
-
-   trx->mo.nm_state.administrative = new_state;
-   if (!trx->bts || !trx->bts->oml_link)
-   return;
 
abis_nm_chg_adm_state(trx->bts, NM_OC_RADIO_CARRIER,
  trx->bts->bts_nr, trx->nr, 0xff,
diff --git a/src/libbsc/acc_ramp.c b/src/libbsc/acc_ramp.c
index 7116107..ff8ff0e 100644
--- a/src/libbsc/acc_ramp.c
+++ b/src/libbsc/acc_ramp.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * Check if an ACC has been permanently barred for a BTS,
@@ -144,6 +145,7 @@
struct nm_statechg_signal_data *nsd = signal_data;
struct acc_ramp *acc_ramp = handler_data;
struct gsm_bts_trx *trx = NULL;
+   bool trigger_ramping = false, abort_ramping = false;
 
/* Handled signals map to an Administrative State Change ACK, or a 
State Changed Event Report. */
if (signal != S_NM_STATECHG_ADM && signal != S_NM_STATECHG_OPER)
@@ -154,37 +156,109 @@
 
trx = nsd->obj;
 
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d,trx=%d) ACC RAMP: administrative state 
%s -> %s\n",
+   acc_ramp->bts->nr, trx->nr,
+   get_value_string(abis_nm_adm_state_names, 
nsd->old_state->administrative),
+   get_value_string(abis_nm_adm_state_names, 
nsd->new_state->administrative));
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d,trx=%d) ACC RAMP: operational state %s 
-> %s\n",
+   acc_ramp->bts->nr, trx->nr,
+   abis_nm_opstate_name(nsd->old_state->operational),
+   abis_nm_opstate_name(nsd->new_state->operational));
+
/* We only care about state changes of the first TRX. */
if (trx->nr != 0)
return 0;
 
/* RSL must already be up. We cannot send RACH system information to 
the BTS otherwise. */
-   if (trx->rsl_link == NULL)
+   if (trx->rsl_link == NULL) {
+   LOGP(DRSL, LOGL_DEBUG, "(bts=%d,trx=%d) ACC RAMP: ignoring 
state change because RSL link is down\n",
+acc_ramp->bts->nr, trx->nr);
return 0;
-
-   /* Trigger or abort ACC ramping based on the new 'RF lock' state of 
this TRX. */
-   switch (nsd->new_state->administrative) {
-   case NM_STATE_UNLOCKED:
-   /*
-* Do not re-trigger ACC ramping if ramping is already in 
progress.
-* A BTS might send several "unlock" change events: One in the 
Administrative
-* State Change ACK, and/or another in a State Changed Event 
Report.
-* For instance, the nanobts is known to send both.
-*/
-   if (!osmo_timer_pending(_ramp->step_timer))
-   acc_ramp_trigger(acc_ramp);
-   break;
-   case NM_STATE_LOCKED:
-   case NM_STATE_SHUTDOWN:
-   acc_ramp_abort(acc_ramp);
-   break;
- 

osmo-bsc[master]: fix handling of state changes in acc ramping

2018-04-14 Thread Harald Welte

Patch Set 4: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7784
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib3291439655598fb5ddc891a3e4cc35b0bad250f
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No


[MERGED] libosmocore[master]: test_gsm0808_enc_dec_cell_id_list_lac(): populate all LACs

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: test_gsm0808_enc_dec_cell_id_list_lac(): populate all LACs
..


test_gsm0808_enc_dec_cell_id_list_lac(): populate all LACs

Change-Id: I7535166a2827c03a954fe72d5d99217e4f25868f
---
M tests/gsm0808/gsm0808_test.c
M tests/gsm0808/gsm0808_test.ok
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 41d85a8..a9ab72b 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -768,13 +768,13 @@
memset(_cil, 0, sizeof(enc_cil));
enc_cil.id_discr = CELL_IDENT_LAC;
enc_cil.id_list[0].lac = 0x0124;
-   enc_cil.id_list[0].lac = 0xABCD;
-   enc_cil.id_list[0].lac = 0x5678;
+   enc_cil.id_list[1].lac = 0xABCD;
+   enc_cil.id_list[2].lac = 0x5678;
enc_cil.id_list_len = 3;
 
msg = msgb_alloc(1024, "output buffer");
rc_enc = gsm0808_enc_cell_id_list2(msg, _cil);
-   EXPECT_ENCODED("1a 07 05 56 78 00 00 00 00");
+   EXPECT_ENCODED("1a 07 05 01 24 ab cd 56 78");
 
rc_dec = gsm0808_dec_cell_id_list2(_cil, msg->data + 2, msg->len - 
2);
OSMO_ASSERT(rc_dec == 7);
diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok
index 0ec6d23..34d7ebf 100644
--- a/tests/gsm0808/gsm0808_test.ok
+++ b/tests/gsm0808/gsm0808_test.ok
@@ -19,7 +19,7 @@
 Testing creating Paging Request
 Testing creating DTAP
 Testing prepend DTAP
-test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 56 78 00 00 00 00 (rc 
= 9)
+test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 01 24 ab cd 56 78 (rc 
= 9)
 --- test_cell_id_list_add
  cell_id_list cgi[0] = {
  }

-- 
To view, visit https://gerrit.osmocom.org/7791
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7535166a2827c03a954fe72d5d99217e4f25868f
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] libosmocore[master]: add gsm0808_{enc,dec}_cell_id

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: add gsm0808_{enc,dec}_cell_id
..


add gsm0808_{enc,dec}_cell_id

Clarify semantics and micro-optimise for the case of single Cell Identifer IEs.
Test in gsm0808_test.c

So far we have gsm0808_enc_cell_id_list2(), but there also exist instances of
single Cell Identifiers (3GPP TS 48.008 3.2.2.17).

It is possible to decode the same using the cell identifier list API, but this
forces the caller to also keep a full struct gsm0808_cell_id_list2 with all its
127 entries around.

E.g. for handover, there are two Cell Identifiers (Serving and Target); I'd
need two full cell id lists for each, and these would be dynamically allocated
for each handover operation, whether it uses them or not.

Related: OS#2283 (inter-BSC HO, BSC side)
Change-Id: I9f9c528965775698ab62ac386af0516192c4b0cc
---
M include/osmocom/gsm/gsm0808_utils.h
M src/gsm/gsm0808_utils.c
M src/gsm/libosmogsm.map
M tests/gsm0808/gsm0808_test.c
M tests/gsm0808/gsm0808_test.ok
5 files changed, 280 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/gsm0808_utils.h 
b/include/osmocom/gsm/gsm0808_utils.h
index 34eae43..8e71b43 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -31,20 +31,27 @@
  /*! (225-1)/2 is the maximum number of elements in a cell identifier list. */
 #define GSM0808_CELL_ID_LIST2_MAXLEN   127
 
-/*! Parsed representation of a cell identifier list IE. */
+/*! Instead of this, use either struct gsm0808_cell_id or 
gsm0808_cell_id_list2.
+ * All elements contain parsed representations of the data in the 
corresponding IE, in host-byte order.
+ */
+union gsm0808_cell_id_u {
+   struct osmo_cell_global_id  global;
+   struct osmo_lac_and_ci_id   lac_and_ci;
+   uint16_tci;
+   struct osmo_location_area_idlai_and_lac;
+   uint16_tlac;
+};
+
+/*! Parsed representation of Cell Identifier IE (3GPP TS 48.008 3.2.2.17) */
+struct gsm0808_cell_id {
+   enum CELL_IDENT id_discr;
+   union gsm0808_cell_id_u id;
+};
+
+/*! Parsed representation of a Cell Identifier List IE (3GPP TS 48.008 
3.2.2.27). */
 struct gsm0808_cell_id_list2 {
enum CELL_IDENT id_discr;
-   union {
-   /*!
-* All elements of these arrays contain parsed representations 
of the
-* data in the corresponding IE, in host-byte order.
-*/
-   struct osmo_cell_global_id  global;
-   struct osmo_lac_and_ci_id   lac_and_ci;
-   uint16_tci;
-   struct osmo_location_area_idlai_and_lac;
-   uint16_tlac;
-   } id_list[GSM0808_CELL_ID_LIST2_MAXLEN];
+   union gsm0808_cell_id_u id_list[GSM0808_CELL_ID_LIST2_MAXLEN];
unsigned int id_list_len;
 };
 
@@ -78,6 +85,8 @@
 const uint8_t *elem, uint8_t len)
 OSMO_DEPRECATED("use gsm0808_dec_cell_id_list2 
instead");
 int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct 
gsm0808_cell_id_list2 *src);
+uint8_t gsm0808_enc_cell_id(struct msgb *msg, const struct gsm0808_cell_id 
*ci);
+int gsm0808_dec_cell_id(struct gsm0808_cell_id *ci, const uint8_t *elem, 
uint8_t len);
 int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch);
 int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
uint8_t perm_spch);
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 996456e..73d9362 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -988,6 +988,57 @@
return added;
 }
 
+/*! Encode Cell Identifier IE (3GPP TS 48.008 3.2.2.17).
+ *  \param[out] msg Message Buffer to which IE is to be appended
+ *  \param[in] ci Cell ID to be encoded
+ *  \returns number of bytes appended to \a msg */
+uint8_t gsm0808_enc_cell_id(struct msgb *msg, const struct gsm0808_cell_id *ci)
+{
+   uint8_t rc;
+   uint8_t *ie_tag;
+   struct gsm0808_cell_id_list2 cil = {
+   .id_discr = ci->id_discr,
+   .id_list = { ci->id },
+   .id_list_len = 1,
+   };
+
+   OSMO_ASSERT(msg);
+   OSMO_ASSERT(ci);
+
+   ie_tag = msg->tail;
+   rc = gsm0808_enc_cell_id_list2(msg, );
+
+   if (rc <= 0)
+   return rc;
+
+   *ie_tag = GSM0808_IE_CELL_IDENTIFIER;
+   return rc;
+}
+
+/*! Decode Cell Identifier IE (3GPP TS 48.008 3.2.2.17).
+ *  \param[out] ci Caller-provided memory to store Cell ID.
+ *  \param[in] elem IE value to be decoded.
+ *  \param[in] len Length of \a elem in 

[MERGED] libosmocore[master]: add gsm0808_cell_id_list_add() to combine two cell identifie...

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: add gsm0808_cell_id_list_add() to combine two cell identifier 
lists
..


add gsm0808_cell_id_list_add() to combine two cell identifier lists

This will be used by the upcoming neighbor_ident API in osmo-bsc, where the vty
interface allows composing neihbor BSS cell identifier lists, and we want to
allow adding individual items from individual user commands.

It will also be useful to accumulate cell identifiers in case a subscriber sees
multiple alternative cells from a neighboring BSS, and we want to pass these on
to the MSC in a Handover Required.

Related: OS#2283 (inter-BSC HO, BSC side)
Change-Id: I5781f5fa5339c92ab2e2620489b002829d206925
---
M include/osmocom/gsm/gsm0808_utils.h
M src/gsm/gsm0808_utils.c
M src/gsm/libosmogsm.map
M tests/gsm0808/gsm0808_test.c
M tests/gsm0808/gsm0808_test.ok
5 files changed, 361 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/gsm0808_utils.h 
b/include/osmocom/gsm/gsm0808_utils.h
index 363fc39..34eae43 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -77,6 +77,7 @@
 int gsm0808_dec_cell_id_list(struct gsm0808_cell_id_list *cil,
 const uint8_t *elem, uint8_t len)
 OSMO_DEPRECATED("use gsm0808_dec_cell_id_list2 
instead");
+int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct 
gsm0808_cell_id_list2 *src);
 int gsm0808_chan_type_to_speech_codec(uint8_t perm_spch);
 int gsm0808_speech_codec_from_chan_type(struct gsm0808_speech_codec *sc,
uint8_t perm_spch);
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index e4872b8..996456e 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -909,6 +909,85 @@
return (int)(elem - old_elem);
 }
 
+static bool same_cell_id_list_entries(const struct gsm0808_cell_id_list2 *a, 
int ai,
+ const struct gsm0808_cell_id_list2 *b, 
int bi)
+{
+   struct gsm0808_cell_id_list2 tmp = {
+   .id_discr = a->id_discr,
+   .id_list_len = 1,
+   };
+   uint8_t buf_a[32 + sizeof(struct msgb)];
+   uint8_t buf_b[32 + sizeof(struct msgb)];
+   struct msgb *msg_a = (void*)buf_a;
+   struct msgb *msg_b = (void*)buf_b;
+
+   msg_a->data_len = 32;
+   msg_b->data_len = 32;
+   msgb_reset(msg_a);
+   msgb_reset(msg_b);
+
+   if (a->id_discr != b->id_discr)
+   return false;
+   if (ai >= a->id_list_len
+   || bi >= b->id_list_len)
+   return false;
+
+   tmp.id_list[0] = a->id_list[ai];
+   gsm0808_enc_cell_id_list2(msg_a, );
+
+   tmp.id_list[0] = b->id_list[bi];
+   gsm0808_enc_cell_id_list2(msg_b, );
+
+   if (msg_a->len != msg_b->len)
+   return false;
+   if (memcmp(msg_a->data, msg_b->data, msg_a->len))
+   return false;
+
+   return true;
+}
+
+/*! Append entries from one Cell Identifier List to another.
+ * The cell identifier types must be identical between the two lists.
+ * \param dst[out]  Append entries to this list.
+ * \param src[in]   Append these entries to \a dst.
+ * \returns the nr of items added, or negative on error: -EINVAL if the 
id_discr mismatch
+ *   between the lists, -ENOSPC if the destination list does not have enough 
space. If an error is
+ *   returned, \a dst may have already been changed (particularly on -ENOSPC). 
Note that a return value
+ *   of zero may occur when the src->id_list_len is zero, or when all entries 
from \a src already exist
+ *   in \a dst, and does not indicate error per se. */
+int gsm0808_cell_id_list_add(struct gsm0808_cell_id_list2 *dst, const struct 
gsm0808_cell_id_list2 *src)
+{
+   int i, j;
+   int added = 0;
+
+   if (dst->id_list_len == 0
+   && dst->id_discr != CELL_IDENT_BSS)
+   dst->id_discr = src->id_discr;
+   else if (dst->id_discr != src->id_discr)
+   return -EINVAL;
+
+   for (i = 0; i < src->id_list_len; i++) {
+   /* don't add duplicate entries */
+   bool skip = false;
+   for (j = 0; j < dst->id_list_len; j++) {
+   if (same_cell_id_list_entries(dst, j, src, i)) {
+   skip = true;
+   break;
+   }
+   }
+   if (skip)
+   continue;
+
+   if (dst->id_list_len >= ARRAY_SIZE(dst->id_list))
+   return -ENOSPC;
+
+   dst->id_list[dst->id_list_len++] = src->id_list[i];
+   added ++;
+   }
+
+   return added;
+}
+
 /*! Convert the representation of the permitted speech 

[MERGED] libosmocore[master]: test_gsm0808_enc_dec_cell_id_list_lac(): validate encoded bytes

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: test_gsm0808_enc_dec_cell_id_list_lac(): validate encoded bytes
..


test_gsm0808_enc_dec_cell_id_list_lac(): validate encoded bytes

Change-Id: I81b1ffbe6a5ec566c112492c2cbaf99c018c45bb
---
M tests/gsm0808/gsm0808_test.c
M tests/gsm0808/gsm0808_test.ok
2 files changed, 9 insertions(+), 8 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 8c184dd..41d85a8 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -750,6 +750,13 @@
msgb_free(msg);
 }
 
+#define EXPECT_ENCODED(hexstr) do { \
+   const char *enc_str = msgb_hexdump(msg); \
+   printf("%s: encoded: %s(rc = %u)\n", __func__, enc_str, 
rc_enc); \
+   OSMO_ASSERT(strcmp(enc_str, hexstr " ") == 0); \
+   OSMO_ASSERT(rc_enc == msg->len); \
+   } while(0)
+
 static void test_gsm0808_enc_dec_cell_id_list_lac()
 {
struct gsm0808_cell_id_list2 enc_cil;
@@ -767,7 +774,7 @@
 
msg = msgb_alloc(1024, "output buffer");
rc_enc = gsm0808_enc_cell_id_list2(msg, _cil);
-   OSMO_ASSERT(rc_enc == 9);
+   EXPECT_ENCODED("1a 07 05 56 78 00 00 00 00");
 
rc_dec = gsm0808_dec_cell_id_list2(_cil, msg->data + 2, msg->len - 
2);
OSMO_ASSERT(rc_dec == 7);
@@ -1255,13 +1262,6 @@
 
printf("--- %s done\n", __func__);
 }
-
-#define EXPECT_ENCODED(hexstr) do { \
-   const char *enc_str = msgb_hexdump(msg); \
-   printf("%s: encoded: %s(rc = %u)\n", __func__, enc_str, 
rc_enc); \
-   OSMO_ASSERT(strcmp(enc_str, hexstr " ") == 0); \
-   OSMO_ASSERT(rc_enc == msg->len); \
-   } while(0)
 
 static void test_gsm0808_enc_dec_cell_id_lac()
 {
diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok
index 27170f2..0ec6d23 100644
--- a/tests/gsm0808/gsm0808_test.ok
+++ b/tests/gsm0808/gsm0808_test.ok
@@ -19,6 +19,7 @@
 Testing creating Paging Request
 Testing creating DTAP
 Testing prepend DTAP
+test_gsm0808_enc_dec_cell_id_list_lac: encoded: 1a 07 05 56 78 00 00 00 00 (rc 
= 9)
 --- test_cell_id_list_add
  cell_id_list cgi[0] = {
  }

-- 
To view, visit https://gerrit.osmocom.org/7790
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I81b1ffbe6a5ec566c112492c2cbaf99c018c45bb
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] libosmocore[master]: add tlv_parse2(), capable of multiple instances of the same IE

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: add tlv_parse2(), capable of multiple instances of the same IE
..


add tlv_parse2(), capable of multiple instances of the same IE

Allow passing multiple struct tlv_parsed in an array, to allow parsing as many
repeated IEs as are expected by the caller.

>From tlv_parse(), call tlv_parse2() with dec_multiple = 1 to yield the previous
behavior. tlv_parse() remains valid API.

An example of multiple IEs is the BSSMAP Handover Request, containing Cell
Identifier (Serving) and Cell Identifier (Target), both defined by 3GPP TS
48.008 3.2.2.17 with identical IE tags; both are mandatory.

Related: OS#2283 (inter-BSC HO, BSC side)
Change-Id: Id04008eaf0a1cafdbdc11b7efc556e3035b1c84d
---
M include/osmocom/gsm/tlv.h
M src/gsm/libosmogsm.map
M src/gsm/tlv_parser.c
M tests/tlv/tlv_test.c
4 files changed, 83 insertions(+), 24 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h
index 8654893..996f6aa 100644
--- a/include/osmocom/gsm/tlv.h
+++ b/include/osmocom/gsm/tlv.h
@@ -433,6 +433,9 @@
   const uint8_t *buf, int buf_len);
 int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def,
  const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2);
+int tlv_parse2(struct tlv_parsed *dec, int dec_multiples,
+  const struct tlv_definition *def, const uint8_t *buf, int 
buf_len,
+  uint8_t lv_tag, uint8_t lv_tag2);
 /* take a master (src) tlv def and fill up all empty slots in 'dst' */
 void tlv_def_patch(struct tlv_definition *dst, const struct tlv_definition 
*src);
 
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index d99121e..4d009e0 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -406,6 +406,7 @@
 tlv_def_patch;
 tlv_dump;
 tlv_parse;
+tlv_parse2;
 tlv_parse_one;
 tvlv_att_def;
 vtvlv_gan_att_def;
diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c
index f693971..6e089f7 100644
--- a/src/gsm/tlv_parser.c
+++ b/src/gsm/tlv_parser.c
@@ -220,7 +220,12 @@
return len;
 }
 
-/*! Parse an entire buffer of TLV encoded Information Elements
+/*! Parse an entire buffer of TLV encoded Information Elements.
+ * In case of multiple occurences of an IE, keep only the first occurence.
+ * Most GSM related protocols clearly indicate that in case of duplicate
+ * IEs, only the first occurrence shall be used, while any further occurrences
+ * shall be ignored.  See e.g. 3GPP TS 24.008 Section 8.6.3.
+ * For multiple occurences, use tlv_parse2().
  *  \param[out] dec caller-allocated pointer to \ref tlv_parsed
  *  \param[in] def structure defining the valid TLV tags / configurations
  *  \param[in] buf the input data buffer to be parsed
@@ -233,38 +238,77 @@
  const uint8_t *buf, int buf_len, uint8_t lv_tag,
  uint8_t lv_tag2)
 {
+   return tlv_parse2(dec, 1, def, buf, buf_len, lv_tag, lv_tag2);
+}
+
+/*! Like tlv_parse(), but capable of decoding multiple occurences of the same 
IE.
+ * Parse an entire buffer of TLV encoded Information Elements.
+ * To decode multiple occurences of IEs, provide in dec an _array_ of 
tlv_parsed, and
+ * pass the size of that array in dec_multiples. The first occurence of each IE
+ * is stored in dec[0], the second in dec[1] and so forth. If there are more
+ * occurences than the array length given in dec_multiples, the remaining
+ * occurences are dropped.
+ *  \param[out] dec caller-allocated pointer to \ref tlv_parsed
+ *  \param[in] dec_multiples length of the tlv_parsed[] in \a dec.
+ *  \param[in] def structure defining the valid TLV tags / configurations
+ *  \param[in] buf the input data buffer to be parsed
+ *  \param[in] buf_len length of the input data buffer
+ *  \param[in] lv_tag an initial LV tag at the start of the buffer
+ *  \param[in] lv_tag2 a second initial LV tag following the \a lv_tag
+ *  \returns number of TLV entries parsed; negative in case of error
+ */
+int tlv_parse2(struct tlv_parsed *dec, int dec_multiples,
+  const struct tlv_definition *def, const uint8_t *buf, int 
buf_len,
+  uint8_t lv_tag, uint8_t lv_tag2)
+{
int ofs = 0, num_parsed = 0;
uint16_t len;
+   int dec_i;
 
-   memset(dec, 0, sizeof(*dec));
+   for (dec_i = 0; dec_i < dec_multiples; dec_i++)
+   memset([dec_i], 0, sizeof(*dec));
 
if (lv_tag) {
+   const uint8_t *val;
+   uint16_t parsed_len;
if (ofs > buf_len)
return -1;
-   dec->lv[lv_tag].val = [ofs+1];
-   dec->lv[lv_tag].len = buf[ofs];
-   len = dec->lv[lv_tag].len + 1;
-   if (ofs + len > buf_len) {
-   dec->lv[lv_tag].val = NULL;
-   

[MERGED] libosmocore[master]: add osmo_cgi_name()

2018-04-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: add osmo_cgi_name()
..


add osmo_cgi_name()

This will be used by cell idenitifier list code, like upcoming neighbor_ident
VTY in osmo-bsc and regression tests.

Change-Id: Iebc5cdf61b697b1603900993fc265af3eca0cedf
---
M include/osmocom/gsm/gsm23003.h
M src/gsm/gsm23003.c
M src/gsm/libosmogsm.map
3 files changed, 31 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/gsm23003.h b/include/osmocom/gsm/gsm23003.h
index 02e7971..fd4f369 100644
--- a/include/osmocom/gsm/gsm23003.h
+++ b/include/osmocom/gsm/gsm23003.h
@@ -99,6 +99,8 @@
 const char *osmo_plmn_name(const struct osmo_plmn_id *plmn);
 const char *osmo_plmn_name2(const struct osmo_plmn_id *plmn);
 const char *osmo_lai_name(const struct osmo_location_area_id *lai);
+const char *osmo_cgi_name(const struct osmo_cell_global_id *cgi);
+const char *osmo_cgi_name2(const struct osmo_cell_global_id *cgi);
 
 void osmo_plmn_to_bcd(uint8_t *bcd_dst, const struct osmo_plmn_id *plmn);
 void osmo_plmn_from_bcd(const uint8_t *bcd_src, struct osmo_plmn_id *plmn);
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 574400d..2c3b21e 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -133,6 +133,33 @@
return buf;
 }
 
+static const char *_cgi_name(const struct osmo_cell_global_id *cgi, char *buf, 
size_t buflen)
+{
+   snprintf(buf, buflen, "%s-%u", osmo_lai_name(>lai), 
cgi->cell_identity);
+   return buf;
+}
+
+/*! Return MCC-MNC-LAC-CI as string, in a static buffer.
+ * \param[in] cgi  CGI to encode.
+ * \returns Static string buffer.
+ */
+const char *osmo_cgi_name(const struct osmo_cell_global_id *cgi)
+{
+   static char buf[32];
+   return _cgi_name(cgi, buf, sizeof(buf));
+}
+
+/*! Same as osmo_cgi_name(), but uses a different static buffer.
+ * Useful for printing two distinct CGIs in the same printf format.
+ * \param[in] cgi  CGI to encode.
+ * \returns Static string buffer.
+ */
+const char *osmo_cgi_name2(const struct osmo_cell_global_id *cgi)
+{
+   static char buf[32];
+   return _cgi_name(cgi, buf, sizeof(buf));
+}
+
 static void to_bcd(uint8_t *bcd, uint16_t val)
 {
bcd[2] = val % 10;
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 31717d5..a6ea47d 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -277,6 +277,8 @@
 osmo_plmn_name2;
 osmo_lai_name;
 osmo_rai_name;
+osmo_cgi_name;
+osmo_cgi_name2;
 osmo_mnc_from_str;
 osmo_mnc_cmp;
 osmo_plmn_cmp;

-- 
To view, visit https://gerrit.osmocom.org/7786
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iebc5cdf61b697b1603900993fc265af3eca0cedf
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bsc[master]: inform A-RESET FSM about MSC CR timeouts

2018-04-14 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7794
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I836a552f2ad37c160081246579f842d104d0dd35
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: jibuf: Estimate src clock skew

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7781
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifae633d53107417a8e2f9b0f200d2711db72d199
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: jibuf: re-sync clock out of sync timestamps

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7779
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I33556b33d7549654442d9bdd7f31128792506652
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: tests: jibuf_tool: Add seq.plt

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7780
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I37bb3ab372b7ad7c3c1d09c8134827c932bf8bf8
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: jibuf: Take RTP marker into account

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7778
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie142acfb45650e0af775f58226fd191beaf8178e
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: tests: jibuf_tool: Add parameters to control size of buffer

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8a7fa39985f8d197e24c32cab80299aba2d03087
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: tests: jibuf_tool: Add OSMUX support

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7776
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0f02da0329e6739ff340d31113161bb520b1b760
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: tests: jibuf_tool: Initial commit

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7774
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I92307c8b1483dd488339771462290aae0ae5689a
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


libosmo-netif[master]: tests: jibuf_tool: Improve jibuf_test to read pcaps

2018-04-14 Thread Harald Welte

Patch Set 2: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/7775
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7a13c823fb70e0adbc5fa0726fd66b15dc40014e
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No