Change in osmo-gsm-tester[master]: ms: Use the new API to pass credentials to the event server

2018-06-18 Thread Holger Freyther
Holger Freyther has posted comments on this change. ( 
https://gerrit.osmocom.org/9663 )

Change subject: ms: Use the new API to pass credentials to the event server
..


Patch Set 1:

> I don't really understand the purpose of this commit. You seem to
 > be changing code to use recvmsg to get the sender address, but then
 > I only see you are passing the address and doing nothing useful
 > with it.

What this will give us:

 * Bi-directional communication between mobile and the testcase
 * By using autobind not having to pick a unique filename

It's true that the test is not making use of it at all. Bi-directional
communication will be needed to implement your idea of a o-fono
like interface (without having to have 10k connections).

 > Then, you start using this new API unix_passcred, which enables
 > being able to send credentials over the socket (not sending them),
 > but I don't see any new code or changed code actually sending the
 > credentials.

The side-effect of this socket option is the autobinding. If one commentt
it out then the event_server will get 'None' as remote address.


--
To view, visit https://gerrit.osmocom.org/9663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
Gerrit-Change-Number: 9663
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 19:29:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: gsm 04.80: Add value_string for component type and op code

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9654 )

Change subject: gsm 04.80: Add value_string for component type and op code
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9654
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2615a88db5224d65f37c7cc505e183ec8b196e8a
Gerrit-Change-Number: 9654
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:42:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: Fix coding style

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9623 )

Change subject: lms: Fix coding style
..

lms: Fix coding style

In Change-Id Ib2fca81b76d027b08e2891056fa076d071597783 we introduced
some coding style violations.  Let's make newly-added code follows
standard Osmocom coding style.

Change-Id: Ib7ddd275014f03a2eed3cddc02b1356e2b00c0bc
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 10 insertions(+), 10 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index c4d5f96..815a4c5 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -100,19 +100,19 @@

LMS_RegisterLogHandler(_log_callback);

-if ((n = LMS_GetDeviceList(NULL)) < 0)
-LOG(ERROR) << "LMS_GetDeviceList(NULL) failed";
-LOG(DEBUG) << "Devices found: " << n;
-if (n < 1)
-return -1;
+   if ((n = LMS_GetDeviceList(NULL)) < 0)
+   LOG(ERROR) << "LMS_GetDeviceList(NULL) failed";
+   LOG(DEBUG) << "Devices found: " << n;
+   if (n < 1)
+   return -1;

-info_list = new lms_info_str_t[n];
+   info_list = new lms_info_str_t[n];

-if (LMS_GetDeviceList(info_list) < 0)//Populate device 
list
-LOG(ERROR) << "LMS_GetDeviceList(info_list) failed";
+   if (LMS_GetDeviceList(info_list) < 0)
+   LOG(ERROR) << "LMS_GetDeviceList(info_list) failed";

-for (i = 0; i < n; i++) //print device list
-   LOG(DEBUG) << "Device [" << i << "]: " << info_list[i];
+   for (i = 0; i < n; i++)
+   LOG(DEBUG) << "Device [" << i << "]: " << info_list[i];

rc = LMS_Open(_lms_dev, info_list[0], NULL);
if (rc != 0) {

--
To view, visit https://gerrit.osmocom.org/9623
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib7ddd275014f03a2eed3cddc02b1356e2b00c0bc
Gerrit-Change-Number: 9623
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-hlr[master]: gsup_server: Add "priv" pointer and make it point to 'struct hlr'

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9655 )

Change subject: gsup_server: Add "priv" pointer and make it point to 'struct 
hlr'
..

gsup_server: Add "priv" pointer and make it point to 'struct hlr'

Change-Id: Iada68996b7f4cbdcca92b254ddaf6b88b962e6f1
---
M src/gsup_server.c
M src/gsup_server.h
M src/hlr.c
3 files changed, 8 insertions(+), 3 deletions(-)

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



diff --git a/src/gsup_server.c b/src/gsup_server.c
index 4b8a0fa..e75bbd7 100644
--- a/src/gsup_server.c
+++ b/src/gsup_server.c
@@ -292,7 +292,7 @@
 struct osmo_gsup_server *
 osmo_gsup_server_create(void *ctx, const char *ip_addr, uint16_t tcp_port,
osmo_gsup_read_cb_t read_cb,
-   struct llist_head *lu_op_lst)
+   struct llist_head *lu_op_lst, void *priv)
 {
struct osmo_gsup_server *gsups;
int rc;
@@ -312,6 +312,7 @@
goto failed;

gsups->read_cb = read_cb;
+   gsups->priv = priv;

rc = ipa_server_link_open(gsups->link);
if (rc < 0)
diff --git a/src/gsup_server.h b/src/gsup_server.h
index e49d283..9c4d483 100644
--- a/src/gsup_server.h
+++ b/src/gsup_server.h
@@ -16,6 +16,9 @@
 typedef int (*osmo_gsup_read_cb_t)(struct osmo_gsup_conn *conn, struct msgb 
*msg);

 struct osmo_gsup_server {
+   /* private data of the application/user */
+   void *priv;
+
/* list of osmo_gsup_conn */
struct llist_head clients;

@@ -53,7 +56,8 @@
 const char *ip_addr,
 uint16_t tcp_port,
 osmo_gsup_read_cb_t read_cb,
-struct llist_head *lu_op_lst);
+struct llist_head *lu_op_lst,
+void *priv);

 void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups);

diff --git a/src/hlr.c b/src/hlr.c
index 940165f..643dfff 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -600,7 +600,7 @@
}

g_hlr->gs = osmo_gsup_server_create(hlr_ctx, g_hlr->gsup_bind_addr, 
OSMO_GSUP_PORT,
-   read_cb, _lu_ops);
+   read_cb, _lu_ops, g_hlr);
if (!g_hlr->gs) {
LOGP(DMAIN, LOGL_FATAL, "Error starting GSUP server\n");
exit(1);

--
To view, visit https://gerrit.osmocom.org/9655
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iada68996b7f4cbdcca92b254ddaf6b88b962e6f1
Gerrit-Change-Number: 9655
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in pysim[master]: __init__: allow wildcards in expected SW for send_apdu_checksw()

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9571 )

Change subject: __init__: allow wildcards in expected SW for send_apdu_checksw()
..

__init__: allow wildcards in expected SW for send_apdu_checksw()

The method send_apdu_checksw() is used to check the SW of the final
response against some pre defined value. However, in many cases the
last two digits of the SW are used to return varying information
(e.g. length information or a more specific status info). To cover
those cases it would be helfpul to define status words that contain
wildcards (e.g. 61**) in order to be able to accept all SWs from
6100 to 61ff.

- When the user supplies an expected SW with wildcards, mask out
  those digits in the response before comparing

Change-Id: I5bfc0522b4228b5d9b3415f6e708abcf0da0a7b7
---
M pySim/transport/__init__.py
1 file changed, 13 insertions(+), 2 deletions(-)

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



diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index dd04bba..0a71117 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -77,12 +77,23 @@
"""send_apdu_checksw(pdu,sw): Sends an APDU and check returned 
SW

   pdu: string of hexadecimal characters (ex. 
"A0A4023F00")
-  sw : string of 4 hexadecimal characters (ex. "9000")
+  sw : string of 4 hexadecimal characters (ex. "9000"). The
+   user may mask out certain digits using a '?' to add 
some
+   ambiguity if needed.
   return : tuple(data, sw), where
data : string (in hex) of returned data (ex. 
"074F4E")
sw   : string (in hex) of status word (ex. "9000")
"""
rv = self.send_apdu(pdu)
-   if sw.lower() != rv[1]:
+
+# Create a masked version of the returned status word
+   sw_masked = ""
+   for i in range(0, 4):
+   if sw.lower()[i] == '?':
+   sw_masked = sw_masked + '?'
+   else:
+   sw_masked = sw_masked + rv[1][i].lower()
+
+   if sw.lower() != sw_masked:
raise RuntimeError("SW match failed ! Expected %s and 
got %s." % (sw.lower(), rv[1]))
return rv

--
To view, visit https://gerrit.osmocom.org/9571
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5bfc0522b4228b5d9b3415f6e708abcf0da0a7b7
Gerrit-Change-Number: 9571
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 


Change in osmo-hlr[master]: gsup_server: Add "priv" pointer and make it point to 'struct hlr'

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9655 )

Change subject: gsup_server: Add "priv" pointer and make it point to 'struct 
hlr'
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9655
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iada68996b7f4cbdcca92b254ddaf6b88b962e6f1
Gerrit-Change-Number: 9655
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:43:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in pysim[master]: __init__: allow wildcards in expected SW for send_apdu_checksw()

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9571 )

Change subject: __init__: allow wildcards in expected SW for send_apdu_checksw()
..


Patch Set 2: Verified+1


--
To view, visit https://gerrit.osmocom.org/9571
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5bfc0522b4228b5d9b3415f6e708abcf0da0a7b7
Gerrit-Change-Number: 9571
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:43:54 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: .gitignore: ignore src/libgsupclient/gsup_test_client

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9660 )

Change subject: .gitignore: ignore src/libgsupclient/gsup_test_client
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1edf048207aaa0ced7a6ad0ae48df3f7d2533dc1
Gerrit-Change-Number: 9660
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 11:58:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: .gitignore: ignore src/libgsupclient/gsup_test_client

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9660 )

Change subject: .gitignore: ignore src/libgsupclient/gsup_test_client
..

.gitignore: ignore src/libgsupclient/gsup_test_client

Change-Id: I1edf048207aaa0ced7a6ad0ae48df3f7d2533dc1
---
M .gitignore
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index a502ad4..4263f5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,6 +53,7 @@
 tests/msc_vlr/msc_vlr_test_*
 !tests/msc_vlr/msc_vlr_test_*.*
 tests/msc_vlr/msc_vlr_test_*.o
+src/libgsupclient/gsup_test_client


 tests/atconfig

--
To view, visit https://gerrit.osmocom.org/9660
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1edf048207aaa0ced7a6ad0ae48df3f7d2533dc1
Gerrit-Change-Number: 9660
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in osmo-trx[master]: lms: Call set_antennas() during open() method

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9620 )

Change subject: lms: Call set_antennas() during open() method
..

lms: Call set_antennas() during open() method

Without this call, the antenna/path configuration is not applied.

Change-Id: I0bca58266b59f1315ec72b6407fe4f4495aff678
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index b1f4519..518e581 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -178,6 +178,11 @@

LOG(DEBUG) << "LPFBW: Rx=" << lpfbw_rx << " Tx=" << lpfbw_tx;

+   if (!set_antennas()) {
+   LOG(ALERT) << "LMS antenna setting failed";
+   return -1;
+   }
+
/* Perform Rx and Tx calibration */
for (i=0; ihttps://gerrit.osmocom.org/9620
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0bca58266b59f1315ec72b6407fe4f4495aff678
Gerrit-Change-Number: 9620
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-trx[master]: move set_antennas() from UHD to generic radioDevice base class

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9618 )

Change subject: move set_antennas() from UHD to generic radioDevice base class
..

move set_antennas() from UHD to generic radioDevice base class

Change-Id: I806143e9db21f0be4dcc6a376b3a630be7aeb3ba
---
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/radioDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.h
4 files changed, 29 insertions(+), 33 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.h 
b/Transceiver52M/device/lms/LMSDevice.h
index 99eed43..7b3479f 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -196,8 +196,6 @@
inline double numberWritten() {
return samplesWritten;
}
-
-   std::vector < std::string > tx_paths, rx_paths;
 };

 #endif // _LMS_DEVICE_H_
diff --git a/Transceiver52M/device/radioDevice.h 
b/Transceiver52M/device/radioDevice.h
index c5cd461..469b574 100644
--- a/Transceiver52M/device/radioDevice.h
+++ b/Transceiver52M/device/radioDevice.h
@@ -19,6 +19,7 @@
 #include 

 #include "GSMCommon.h"
+#include "Logger.h"

 extern "C" {
 #include "config_defs.h"
@@ -163,6 +164,34 @@
   virtual double numberRead()=0;
   virtual double numberWritten()=0;

+  std::vector tx_paths, rx_paths;
+  bool set_antennas() {
+   unsigned int i;
+
+   for (i = 0; i < tx_paths.size(); i++) {
+   if (tx_paths[i] == "")
+   continue;
+   LOG(DEBUG) << "Configuring channel " << i << " with antenna " 
<< tx_paths[i];
+   if (!setTxAntenna(tx_paths[i], i)) {
+   LOG(ALERT) << "Failed configuring channel " << i << " 
with antenna " << tx_paths[i];
+   return false;
+   }
+   }
+
+   for (i = 0; i < rx_paths.size(); i++) {
+   if (rx_paths[i] == "")
+   continue;
+   LOG(DEBUG) << "Configuring channel " << i << " with antenna " 
<< rx_paths[i];
+   if (!setRxAntenna(rx_paths[i], i)) {
+   LOG(ALERT) << "Failed configuring channel " << i << " 
with antenna " << rx_paths[i];
+   return false;
+   }
+   }
+   LOG(INFO) << "Antennas configured successfully";
+   return true;
+  }
+
+
 };

 #endif
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp 
b/Transceiver52M/device/uhd/UHDDevice.cpp
index a0052c8..77a3446 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -291,7 +291,6 @@

std::vector tx_gains, rx_gains;
std::vector tx_freqs, rx_freqs;
-   std::vector tx_paths, rx_paths;
size_t tx_spp, rx_spp;

bool started;
@@ -307,7 +306,6 @@
void init_gains();
void set_channels(bool swap);
void set_rates();
-   bool set_antennas();
bool parse_dev_type();
bool flush_recv(size_t num_pkts);
int check_rx_md_err(uhd::rx_metadata_t , ssize_t num_smpls);
@@ -458,33 +456,6 @@
LOG(INFO) << "Rates configured for " << desc.str;
 }

-bool uhd_device::set_antennas()
-{
-   unsigned int i;
-
-   for (i = 0; i < tx_paths.size(); i++) {
-   if (tx_paths[i] == "")
-   continue;
-   LOG(DEBUG) << "Configuring channel " << i << " with antenna " 
<< tx_paths[i];
-   if (!setTxAntenna(tx_paths[i], i)) {
-   LOG(ALERT) << "Failed configuring channel " << i << " 
with antenna " << tx_paths[i];
-   return false;
-   }
-   }
-
-   for (i = 0; i < rx_paths.size(); i++) {
-   if (rx_paths[i] == "")
-   continue;
-   LOG(DEBUG) << "Configuring channel " << i << " with antenna " 
<< rx_paths[i];
-   if (!setRxAntenna(rx_paths[i], i)) {
-   LOG(ALERT) << "Failed configuring channel " << i << " 
with antenna " << rx_paths[i];
-   return false;
-   }
-   }
-   LOG(INFO) << "Antennas configured successfully";
-   return true;
-}
-
 double uhd_device::setTxGain(double db, size_t chan)
 {
if (iface == MULTI_ARFCN)
diff --git a/Transceiver52M/device/usrp1/USRPDevice.h 
b/Transceiver52M/device/usrp1/USRPDevice.h
index 6304ea1..efdedb3 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.h
+++ b/Transceiver52M/device/usrp1/USRPDevice.h
@@ -203,8 +203,6 @@
   inline double getSampleRate() { return actualSampleRate; }
   inline double numberRead() { return samplesRead; }
   inline double numberWritten() { return samplesWritten; }
-
-  std::vector tx_paths, rx_paths;
 };


Change in osmo-trx[master]: radioDevice: Move tx_sps from derived into base class

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9621 )

Change subject: radioDevice: Move tx_sps from derived into base class
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9621
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I73b4aa2705c5049561e2d7b21301a0d2b3c96ced
Gerrit-Change-Number: 9621
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:40:54 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: radioDevice: better encapsulation in base class

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9622 )

Change subject: radioDevice: better encapsulation in base class
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9622
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib885675a7612a392aa7f75fca81269ddcff2f6ab
Gerrit-Change-Number: 9622
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:41:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9674 )

Change subject: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, 
TC_ho_into_this_bsc
..


Patch Set 1:

(5 comments)

https://gerrit.osmocom.org/#/c/9674/1/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/9674/1/bsc/BSC_Tests.ttcn@2492
PS1, Line 2492: template PDU_BSSAP tr_BSSMAP_HandoverRequired modifies 
tr_BSSAP_BSSMAP := {
should go to BSSMAP_Templates.ttcn


https://gerrit.osmocom.org/#/c/9674/1/bsc/BSC_Tests.ttcn@2502
PS1, Line 2502: template PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring 
layer3info) modifies ts_BSSAP_BSSMAP := {
should go to BSSMAP_Templates.ttcn and should be a template (value) PDU_BSSAP 
if it's for sending.


https://gerrit.osmocom.org/#/c/9674/1/bsc/BSC_Tests.ttcn@2520
PS1, Line 2520: template PDU_ML3_NW_MS ts_RR_HandoverCommand := {
should be template (value) as it's a send template, and should go into 
L3_Templates.ttcn


https://gerrit.osmocom.org/#/c/9674/1/bsc/BSC_Tests.ttcn@2668
PS1, Line 2668: template PDU_BSSAP ts_BSSMAP_HandoverRequest(
template (value) and BSSMAP_Templates.ttcn


https://gerrit.osmocom.org/#/c/9674/1/bsc/BSC_Tests.ttcn@2726
PS1, Line 2726: template PDU_BSSAP 
tr_BSSMAP_HandoverRequestAcknowledge(octetstring layer3info)
BSSMAP_Templates.ttcn



--
To view, visit https://gerrit.osmocom.org/9674
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
Gerrit-Change-Number: 9674
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Mon, 18 Jun 2018 10:11:40 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: radioDevice: Move tx_sps from derived into base class

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9621 )

Change subject: radioDevice: Move tx_sps from derived into base class
..

radioDevice: Move tx_sps from derived into base class

All three derived classes use a tx_sps member, let's move this into
the base class.

Change-Id: I73b4aa2705c5049561e2d7b21301a0d2b3c96ced
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/radioDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.h
6 files changed, 18 insertions(+), 17 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 518e581..68d4b97 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -40,13 +40,14 @@
 #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */
 #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)

-LMSDevice::LMSDevice(size_t sps, size_t chans,
+LMSDevice::LMSDevice(size_t tx_sps, size_t chans,
 const std::vector& tx_paths,
 const std::vector& rx_paths):
-   m_lms_dev(NULL), sps(sps), chans(chans)
+   m_lms_dev(NULL), chans(chans)
 {
LOG(INFO) << "creating LMS device...";

+   this->tx_sps = tx_sps;
this->tx_paths = tx_paths;
this->rx_paths = rx_paths;

@@ -135,8 +136,8 @@
goto out_close;
print_range("Sample Rate", _sr);

-   LOG(DEBUG) << "Setting sample rate to " << GSMRATE*sps << " " << sps;
-   if (LMS_SetSampleRate(m_lms_dev, GSMRATE*sps, 32) < 0)
+   LOG(DEBUG) << "Setting sample rate to " << GSMRATE*tx_sps << " " << 
tx_sps;
+   if (LMS_SetSampleRate(m_lms_dev, GSMRATE*tx_sps, 32) < 0)
goto out_close;

if (LMS_GetSampleRate(m_lms_dev, LMS_CH_RX, 0, _host, _rf))
@@ -144,7 +145,7 @@
LOG(DEBUG) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf;

/* FIXME: make this device/model dependent, like 
UHDDevice:dev_param_map! */
-   ts_offset = static_cast(8.9e-5 * GSMRATE * sps); /* time * 
sample_rate */
+   ts_offset = static_cast(8.9e-5 * GSMRATE * tx_sps); /* time 
* sample_rate */

switch (ref) {
case REF_INTERNAL:
@@ -362,7 +363,7 @@
 bool LMSDevice::flush_recv(size_t num_pkts)
 {
#define CHUNK 625
-   int len = CHUNK * sps;
+   int len = CHUNK * tx_sps;
short *buffer = new short[len * 2];
int rc;
lms_stream_meta_t rx_metadata = {};
diff --git a/Transceiver52M/device/lms/LMSDevice.h 
b/Transceiver52M/device/lms/LMSDevice.h
index ef6d2b4..0fe4c15 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -46,7 +46,7 @@
std::vector m_last_tx_underruns;
std::vector m_last_tx_overruns;

-   size_t sps, chans;
+   size_t chans;
double actualSampleRate;///< the actual USRP sampling rate

unsigned long long samplesRead; ///< number of samples read from LMS
@@ -65,7 +65,7 @@
 public:

/** Object constructor */
-   LMSDevice(size_t sps, size_t chans,
+   LMSDevice(size_t tx_sps, size_t chans,
  const std::vector& tx_paths,
  const std::vector& rx_paths);

diff --git a/Transceiver52M/device/radioDevice.h 
b/Transceiver52M/device/radioDevice.h
index 469b574..a9328ec 100644
--- a/Transceiver52M/device/radioDevice.h
+++ b/Transceiver52M/device/radioDevice.h
@@ -165,6 +165,7 @@
   virtual double numberWritten()=0;

   std::vector tx_paths, rx_paths;
+  size_t tx_sps;
   bool set_antennas() {
unsigned int i;

diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp 
b/Transceiver52M/device/uhd/UHDDevice.cpp
index 77a3446..ddcad3a 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -282,7 +282,7 @@
enum TxWindowType tx_window;
enum uhd_dev_type dev_type;

-   size_t tx_sps, rx_sps, chans;
+   size_t rx_sps, chans;
double tx_rate, rx_rate;

double tx_gain_min, tx_gain_max;
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp 
b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 7f73f43..07ba1c9 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -58,12 +58,12 @@

 const double USRPDevice::masterClockRate = 52.0e6;

-USRPDevice::USRPDevice(size_t sps)
+USRPDevice::USRPDevice(size_t tx_sps)
 {
   LOG(INFO) << "creating USRP device...";

-  this->sps = sps;
-  decimRate = (unsigned int) round(masterClockRate/((GSMRATE) * (double) sps));
+  this->tx_sps = 

Change in osmo-trx[master]: usrp1: Fail in case of unsupported configuration

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9625 )

Change subject: usrp1: Fail in case of unsupported configuration
..

usrp1: Fail in case of unsupported configuration

There might be some configuration that's not supported by osmo-bts-usrp1,
and we should reject that properly.

Change-Id: Ic7308ce0c57439fe97668bd31801c4bf76b797ad
Closes: OS#3348
---
M Transceiver52M/device/usrp1/USRPDevice.cpp
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp 
b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 7a31c97..5705e22 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -655,5 +655,17 @@
   const std::vector& tx_paths,
   const std::vector& rx_paths)
 {
+   if (tx_sps != rx_sps) {
+   LOG(ERROR) << "USRP1 requires tx_sps == rx_sps";
+   return NULL;
+   }
+   if (chans != 1) {
+   LOG(ERROR) << "USRP1 supports only 1 channel";
+   return NULL;
+   }
+   if (lo_offset != 0.0) {
+   LOG(ERROR) << "USRP1 doesn't support lo_offset";
+   return NULL;
+   }
return new USRPDevice(tx_sps, rx_sps, iface, chans, lo_offset, 
tx_paths, rx_paths);
 }

--
To view, visit https://gerrit.osmocom.org/9625
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic7308ce0c57439fe97668bd31801c4bf76b797ad
Gerrit-Change-Number: 9625
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-trx[master]: radioDevice: better encapsulation in base class

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9622 )

Change subject: radioDevice: better encapsulation in base class
..

radioDevice: better encapsulation in base class

It's not good style to have the derived classes initialize members
inherited from the base class using "this->foo = bar".  Rather, let's
make the base class have a constructor, and call that constructor to
initialize the members of the base class.

While doing this
* rename 'offset' to 'lo_offset' to avoid confusion with timestamp offset
* move 'InterfaceType' into the base class
* move 'chans' into the base class
* move 'rx_sps' into the base class
* mark base class members as 'protected'

Change-Id: Ib885675a7612a392aa7f75fca81269ddcff2f6ab
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/radioDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.h
6 files changed, 38 insertions(+), 34 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 68d4b97..c4d5f96 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -40,17 +40,14 @@
 #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */
 #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)

-LMSDevice::LMSDevice(size_t tx_sps, size_t chans,
+LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t 
chans, double lo_offset,
 const std::vector& tx_paths,
 const std::vector& rx_paths):
-   m_lms_dev(NULL), chans(chans)
+   RadioDevice(tx_sps, rx_sps, iface, chans, lo_offset, tx_paths, 
rx_paths),
+   m_lms_dev(NULL)
 {
LOG(INFO) << "creating LMS device...";

-   this->tx_sps = tx_sps;
-   this->tx_paths = tx_paths;
-   this->rx_paths = rx_paths;
-
m_lms_stream_rx.resize(chans);
m_lms_stream_tx.resize(chans);

@@ -624,9 +621,9 @@
 }

 RadioDevice *RadioDevice::make(size_t tx_sps, size_t rx_sps,
-  InterfaceType iface, size_t chans, double offset,
+  InterfaceType iface, size_t chans, double 
lo_offset,
   const std::vector < std::string > _paths,
   const std::vector < std::string > _paths)
 {
-   return new LMSDevice(tx_sps, chans, tx_paths, rx_paths);
+   return new LMSDevice(tx_sps, rx_sps, iface, chans, lo_offset, tx_paths, 
rx_paths);
 }
diff --git a/Transceiver52M/device/lms/LMSDevice.h 
b/Transceiver52M/device/lms/LMSDevice.h
index 0fe4c15..349efbb 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -46,7 +46,6 @@
std::vector m_last_tx_underruns;
std::vector m_last_tx_overruns;

-   size_t chans;
double actualSampleRate;///< the actual USRP sampling rate

unsigned long long samplesRead; ///< number of samples read from LMS
@@ -65,7 +64,7 @@
 public:

/** Object constructor */
-   LMSDevice(size_t tx_sps, size_t chans,
+   LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t 
chans, double lo_offset,
  const std::vector& tx_paths,
  const std::vector& rx_paths);

diff --git a/Transceiver52M/device/radioDevice.h 
b/Transceiver52M/device/radioDevice.h
index a9328ec..5d001fb 100644
--- a/Transceiver52M/device/radioDevice.h
+++ b/Transceiver52M/device/radioDevice.h
@@ -164,8 +164,20 @@
   virtual double numberRead()=0;
   virtual double numberWritten()=0;

+  protected:
+  size_t tx_sps, rx_sps;
+  InterfaceType iface;
+  size_t chans;
+  double lo_offset;
   std::vector tx_paths, rx_paths;
-  size_t tx_sps;
+
+  RadioDevice(size_t tx_sps, size_t rx_sps, InterfaceType type, size_t chans, 
double offset,
+  const std::vector& tx_paths,
+  const std::vector& rx_paths):
+   tx_sps(tx_sps), rx_sps(rx_sps), iface(type), chans(chans), 
lo_offset(offset),
+   tx_paths(tx_paths), rx_paths(rx_paths)
+   { }
+
   bool set_antennas() {
unsigned int i;

diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp 
b/Transceiver52M/device/uhd/UHDDevice.cpp
index ddcad3a..4af8f87 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -282,12 +282,10 @@
enum TxWindowType tx_window;
enum uhd_dev_type dev_type;

-   size_t rx_sps, chans;
double tx_rate, rx_rate;

double tx_gain_min, tx_gain_max;
double rx_gain_min, rx_gain_max;
-   double offset;

std::vector tx_gains, rx_gains;
std::vector 

Change in libosmocore[master]: gsm 04.80: Add value_string for component type and op code

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9654 )

Change subject: gsm 04.80: Add value_string for component type and op code
..

gsm 04.80: Add value_string for component type and op code

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

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h
index fafa1f4..e928d83 100644
--- a/include/osmocom/gsm/gsm0480.h
+++ b/include/osmocom/gsm/gsm0480.h
@@ -7,6 +7,16 @@
 #include 
 #include 

+extern const struct value_string gsm0480_comp_type_names[];
+static inline const char *gsm0480_comp_type_name(uint8_t comp_type) {
+   return get_value_string(gsm0480_comp_type_names, comp_type);
+}
+
+extern const struct value_string gsm0480_op_code_names[];
+static inline const char *gsm0480_op_code_name(uint8_t op_code) {
+   return get_value_string(gsm0480_op_code_names, op_code);
+}
+
 /**
  * According to the GSM 04.80 (version 5.0.0) specification Annex A
  * "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD
diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c
index 300c0ed..165b309 100644
--- a/src/gsm/gsm0480.c
+++ b/src/gsm/gsm0480.c
@@ -3,6 +3,7 @@
 /*
  * (C) 2010 by Holger Hans Peter Freyther 
  * (C) 2009 by Mike Haben 
+ * (C) 2018 by Harald Welte 
  *
  * All Rights Reserved
  *
@@ -35,6 +36,37 @@
 #include 
 #include 

+const struct value_string gsm0480_comp_type_names[] = {
+   { GSM0480_CTYPE_INVOKE, "Invoke" },
+   { GSM0480_CTYPE_RETURN_RESULT,  "ReturnResult" },
+   { GSM0480_CTYPE_RETURN_ERROR,   "ReturnError" },
+   { GSM0480_CTYPE_REJECT, "Reject" },
+   { 0, NULL }
+};
+
+const struct value_string gsm0480_op_code_names[] = {
+   { GSM0480_OP_CODE_REGISTER_SS,  "RegisterSS" },
+   { GSM0480_OP_CODE_ERASE_SS, "EraseSS" },
+   { GSM0480_OP_CODE_ACTIVATE_SS,  "ActivateSS" },
+   { GSM0480_OP_CODE_DEACTIVATE_SS,"DeactivateSS" },
+   { GSM0480_OP_CODE_INTERROGATE_SS,   "IngerrogateSS" },
+   { GSM0480_OP_CODE_NOTIFY_SS,"NotifySS" },
+   { GSM0480_OP_CODE_REGISTER_PASSWORD,"RegisterPassword" },
+   { GSM0480_OP_CODE_GET_PASSWORD, "GetPassword" },
+   { GSM0480_OP_CODE_PROCESS_USS_DATA, "ProcessUSSD" },
+   { GSM0480_OP_CODE_FORWARD_CHECK_SS_IND, "ForwardChecckSSind" },
+   { GSM0480_OP_CODE_PROCESS_USS_REQ,  "ProcessUssReq" },
+   { GSM0480_OP_CODE_USS_REQUEST,  "UssRequest" },
+   { GSM0480_OP_CODE_USS_NOTIFY,   "UssNotify" },
+   { GSM0480_OP_CODE_FORWARD_CUG_INFO, "ForwardCugInfo" },
+   { GSM0480_OP_CODE_SPLIT_MPTY,   "SplitMPTY" },
+   { GSM0480_OP_CODE_RETRIEVE_MPTY,"RetrieveMPTY" },
+   { GSM0480_OP_CODE_HOLD_MPTY,"HoldMPTY" },
+   { GSM0480_OP_CODE_BUILD_MPTY,   "BuildMPTY" },
+   { GSM0480_OP_CODE_FORWARD_CHARGE_ADVICE,"ForwardChargeAdvice" },
+   { 0, NULL }
+};
+
 static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, uint8_t tag)
 {
uint8_t *data = msgb_push(msgb, 2);
diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map
index 4d9811b..3dccb22 100644
--- a/src/gsm/libosmogsm.map
+++ b/src/gsm/libosmogsm.map
@@ -95,6 +95,8 @@
 gsm0480_decode_ss_request;
 gsm0480_wrap_facility;
 gsm0480_wrap_invoke;
+gsm0480_comp_type_names;
+gsm0480_op_code_names;

 gsm0502_calc_paging_group;
 

--
To view, visit https://gerrit.osmocom.org/9654
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2615a88db5224d65f37c7cc505e183ec8b196e8a
Gerrit-Change-Number: 9654
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-trx[master]: lms: Fail in case of unsupported configuration

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9624 )

Change subject: lms: Fail in case of unsupported configuration
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9624
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f82edce589030a4407f6150fb7e8abe6417c1f2
Gerrit-Change-Number: 9624
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:42:16 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: usrp1: Fail in case of unsupported configuration

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9625 )

Change subject: usrp1: Fail in case of unsupported configuration
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9625
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic7308ce0c57439fe97668bd31801c4bf76b797ad
Gerrit-Change-Number: 9625
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:42:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: Fix support for rx_paths / tx_paths

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9619 )

Change subject: lms: Fix support for rx_paths / tx_paths
..

lms: Fix support for rx_paths / tx_paths

Before this patch, any configuration in osmo-trx.cfg regarding the rx
and tx "antenna" (path) would have been completely ignored, as the
radioDevice::make() function would simply drop those arguments to the
floor.

Change-Id: Ie50f854abbc9dcf351cddc052d10206382e1d5d3
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
2 files changed, 10 insertions(+), 3 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index c531a7f..b1f4519 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -40,11 +40,16 @@
 #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */
 #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)

-LMSDevice::LMSDevice(size_t sps, size_t chans):
+LMSDevice::LMSDevice(size_t sps, size_t chans,
+const std::vector& tx_paths,
+const std::vector& rx_paths):
m_lms_dev(NULL), sps(sps), chans(chans)
 {
LOG(INFO) << "creating LMS device...";

+   this->tx_paths = tx_paths;
+   this->rx_paths = rx_paths;
+
m_lms_stream_rx.resize(chans);
m_lms_stream_tx.resize(chans);

@@ -617,5 +622,5 @@
   const std::vector < std::string > _paths,
   const std::vector < std::string > _paths)
 {
-   return new LMSDevice(tx_sps, chans);
+   return new LMSDevice(tx_sps, chans, tx_paths, rx_paths);
 }
diff --git a/Transceiver52M/device/lms/LMSDevice.h 
b/Transceiver52M/device/lms/LMSDevice.h
index 7b3479f..ef6d2b4 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -65,7 +65,9 @@
 public:

/** Object constructor */
-   LMSDevice(size_t sps, size_t chans);
+   LMSDevice(size_t sps, size_t chans,
+ const std::vector& tx_paths,
+ const std::vector& rx_paths);

/** Instantiate the LMS */
int open(const std::string , int ref, bool swap_channels);

--
To view, visit https://gerrit.osmocom.org/9619
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie50f854abbc9dcf351cddc052d10206382e1d5d3
Gerrit-Change-Number: 9619
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-trx[master]: lms: Fix coding style

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9623 )

Change subject: lms: Fix coding style
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9623
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib7ddd275014f03a2eed3cddc02b1356e2b00c0bc
Gerrit-Change-Number: 9623
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 09:41:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: Fail in case of unsupported configuration

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9624 )

Change subject: lms: Fail in case of unsupported configuration
..

lms: Fail in case of unsupported configuration

There might be some configuration that's not supported by osmo-bts-lms,
and we should reject that properly.

Change-Id: I6f82edce589030a4407f6150fb7e8abe6417c1f2
Closes: OS#3347
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 8 insertions(+), 0 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 815a4c5..16585e6 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -625,5 +625,13 @@
   const std::vector < std::string > _paths,
   const std::vector < std::string > _paths)
 {
+   if (tx_sps != rx_sps) {
+   LOG(ERROR) << "LMS Requires tx_sps == rx_sps";
+   return NULL;
+   }
+   if (lo_offset != 0.0) {
+   LOG(ERROR) << "LMS doesn't support lo_offset";
+   return NULL;
+   }
return new LMSDevice(tx_sps, rx_sps, iface, chans, lo_offset, tx_paths, 
rx_paths);
 }

--
To view, visit https://gerrit.osmocom.org/9624
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6f82edce589030a4407f6150fb7e8abe6417c1f2
Gerrit-Change-Number: 9624
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-bsc[master]: cosmetic / linking: move str_to_imsi() out of abis_rsl.c

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9665 )

Change subject: cosmetic / linking: move str_to_imsi() out of abis_rsl.c
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6e90831d7e618ce3c8e7417082a82c97f6681668
Gerrit-Change-Number: 9665
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 10:12:51 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: ttcn3-tcpdump-stop.sh: print colored verdict

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9675 )

Change subject: ttcn3-tcpdump-stop.sh: print colored verdict
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9675
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0d2d6171430f1eebb5377edac5e237a99ddbd743
Gerrit-Change-Number: 9675
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 10:08:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmocom-bb[master]: lua: Add API to enable passing credentials

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9662 )

Change subject: lua: Add API to enable passing credentials
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9662
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4a5eef611f524f5d21cb6a7f4eace22b8ba60d0
Gerrit-Change-Number: 9662
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 10:13:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: verify_value_string_arrays_are_terminated.py: allow dir args and no args

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9544 )

Change subject: verify_value_string_arrays_are_terminated.py: allow dir args 
and no args
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9544
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I36456383906b6295c798b82aa131dda21f8efc02
Gerrit-Change-Number: 9544
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 18 Jun 2018 10:13:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9674

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

Change subject: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, 
TC_ho_into_this_bsc
..

bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
---
M bsc/BSC_Tests.ttcn
M bsc/osmo-bsc.cfg
M library/BSSMAP_Templates.ttcn
M library/L3_Templates.ttcn
4 files changed, 320 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/74/9674/3
--
To view, visit https://gerrit.osmocom.org/9674
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
Gerrit-Change-Number: 9674
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 


Change in libosmocore[master]: gsm: lapdm.c: Add missing new line char in notice log string

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/9676


Change subject: gsm: lapdm.c: Add missing new line char in notice log string
..

gsm: lapdm.c: Add missing new line char in notice log string

Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
---
M src/gsm/lapdm.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/9676/1

diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index 3a6fc5b..ba9b3df 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -709,7 +709,7 @@
memcpy(>mctx, , sizeof(mctx.dl->mctx));
rc =lapdm_rx_not_permitted(le, );
if (rc > 0) {
-   LOGP(DLLAPD, LOGL_NOTICE, "received message not 
permitted");
+   LOGP(DLLAPD, LOGL_NOTICE, "received message not 
permitted\n");
msgb_free(msg);
rsl_rll_error(rc, );
return -EINVAL;

--
To view, visit https://gerrit.osmocom.org/9676
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
Gerrit-Change-Number: 9676
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmocom-bb[master]: lua: Add API to enable passing credentials

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/9662 )

Change subject: lua: Add API to enable passing credentials
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9662
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4a5eef611f524f5d21cb6a7f4eace22b8ba60d0
Gerrit-Change-Number: 9662
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 13:07:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


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

2018-06-18 Thread jenkins
See 


--
[...truncated 3.81 KB...]
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 of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible 

Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9671

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

Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO
..

large refactoring: use FSMs for lchans; add inter-BSC HO

Add FSMs:

- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
  signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.

Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.

- Add logging macros for each FSM type:
  - LOG_TS()
  - LOG_LCHAN()
  - LOG_MGWEP(), LOG_CI()
  - LOG_ASSIGNMENT()
  - LOG_HO()
  These log with the osmo_fsm_inst where present.
  New style decision: logging without a final newline char is awkward,
  especially for gsmtap logging and when other logs interleave LOGPC() calls;
  we have various cases where the final \n goes missing, and also this invokes
  the log category checking N times instead of once.
  So I decided to make these macros *always* append a newline, but only if
  there is no final newline yet. I hope that the compiler optimizes the
  strlen() of the constant format strings away. Thus I can log with or without
  typing "\n" and always get an \n termination anyway.

General:

- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
  with dedicated FSM timeouts, states and events.

- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
  These can be used (with some macro magic) to define a state's timeout once,
  and not make mistakes for each osmo_fsm_inst_state_chg().

Details:

bsc_subscr_conn_fsm.c:

- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
  mgw_endpoint_fsm.

- There is exactly one state for an ongoing Assignment, with all details
  handled in conn->assignment.fi. The state relies on the assignment_fsm's
  timeout.

- There is one state for an ongoing Handover; except for an incoming Handover
  from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
  are both established.

- move bssmap_add_lcls_status() to osmo_bsc_lcls.c

abis_rsl.c:

- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain 
send/receive functions in
  abis_rsl.c

- reduce some rsl functions to merely send a message, rename to "_tx_".
  - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan 
state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this 
function.

- move all timers and error/release handling away into various FSMs.

- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
  lchan passed, but just mode,type that they require. Rename to
  ipacc_speech_mode*() and ipacc_payload_type().

- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
  message received during BSSMAP Handover Command.

- move various logging to LOG_LCHAN() in order to log with the lchan FSM 
instance.
  One drawback is that the lchan FSM is limited to one logging category, i.e. 
this moves some logging
  from DRR to DRSL. It might actually make sense to combine those categories.

- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for 
performance.

- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 
condition (I hope that's
  correct).

- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right 
away, so that during
  inter-bsc HO we can make an RR Handover Command to send via the MSC to the 
remote BSS.

assignment_fsm.c:

- the Chan Mode Modify in case of re-using the same lchan is not implemented
  yet, because this was also missing in the previous implementation.

Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/abis_rsl.h
A include/osmocom/bsc/assignment_fsm.h
M include/osmocom/bsc/bsc_api.h
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bsc_subscriber.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/debug.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/handover_fsm.h
A include/osmocom/bsc/lchan_fsm.h
A include/osmocom/bsc/lchan_select.h
A include/osmocom/bsc/mgw_endpoint_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/osmo_bsc.h
M include/osmocom/bsc/osmo_bsc_lcls.h
A include/osmocom/bsc/timeslot_fsm.h
M src/ipaccess/Makefile.am
M 

Change in libosmocore[master]: gsm: lapdm.c: Add missing new line char in notice log string

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9676 )

Change subject: gsm: lapdm.c: Add missing new line char in notice log string
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9676
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
Gerrit-Change-Number: 9676
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 17:31:46 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: gsm: lapdm.c: Add missing new line char in notice log string

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9676 )

Change subject: gsm: lapdm.c: Add missing new line char in notice log string
..

gsm: lapdm.c: Add missing new line char in notice log string

Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
---
M src/gsm/lapdm.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/gsm/lapdm.c b/src/gsm/lapdm.c
index 3a6fc5b..ba9b3df 100644
--- a/src/gsm/lapdm.c
+++ b/src/gsm/lapdm.c
@@ -709,7 +709,7 @@
memcpy(>mctx, , sizeof(mctx.dl->mctx));
rc =lapdm_rx_not_permitted(le, );
if (rc > 0) {
-   LOGP(DLLAPD, LOGL_NOTICE, "received message not 
permitted");
+   LOGP(DLLAPD, LOGL_NOTICE, "received message not 
permitted\n");
msgb_free(msg);
rsl_rll_error(rc, );
return -EINVAL;

--
To view, visit https://gerrit.osmocom.org/9676
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
Gerrit-Change-Number: 9676
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in libosmocore[master]: gsm: lapdm.c: Add missing new line char in notice log string

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9676 )

Change subject: gsm: lapdm.c: Add missing new line char in notice log string
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9676
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I92c78ea01570dc1f4be11b113c07f0aa3b342c8f
Gerrit-Change-Number: 9676
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 17:31:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: add and tweak inter-BSC HO API

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9672 )

Change subject: add and tweak inter-BSC HO API
..

add and tweak inter-BSC HO API

Add:
gsm0808_create_handover_detect()
gsm0808_create_handover_complete()
gsm0808_create_handover_failure()

To existing structs gsm0808_old_bss_to_new_bss_info and
gsm0808_handover_required, add a final 'more_items' flag that makes future
extensions API and ABI compatible.

Fix the msgb string for Handover Request Ack.

Extend some API doc comments.

Related: OS#2283 (inter-BSC Handover, BSC side, MT)
Change-Id: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
---
M include/osmocom/gsm/gsm0808.h
M include/osmocom/gsm/gsm_utils.h
M src/gsm/gsm0808.c
M src/gsm/libosmogsm.map
4 files changed, 129 insertions(+), 2 deletions(-)

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



diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index d704aa9..5ae0af8 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -103,6 +103,7 @@
} current_channel_type_2;

/* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
 };

 /*! 3GPP TS 48.008 §3.2.1.9 HANDOVER REQUIRED */
@@ -120,6 +121,7 @@
struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info;

/* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
 };
 struct msgb *gsm0808_create_handover_required(const struct 
gsm0808_handover_required *params);

@@ -127,6 +129,44 @@
 uint8_t chosen_channel, 
uint8_t chosen_encr_alg,
 uint8_t chosen_speech_version);

+struct msgb *gsm0808_create_handover_detect();
+
+struct gsm0808_handover_complete {
+   bool rr_cause_present;
+   uint8_t rr_cause;
+
+   bool speech_codec_chosen_present;
+   struct gsm0808_speech_codec speech_codec_chosen;
+
+   struct gsm0808_speech_codec_list codec_list_bss_supported; /*< omit 
when .len == 0 */
+
+   bool chosen_encr_alg_present;
+   uint8_t chosen_encr_alg;
+
+   bool chosen_channel_present;
+   uint8_t chosen_channel;
+
+   bool lcls_bss_status_present;
+   enum gsm0808_lcls_status lcls_bss_status;
+
+   /* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
+};
+struct msgb *gsm0808_create_handover_complete(const struct 
gsm0808_handover_complete *params);
+
+struct gsm0808_handover_failure {
+   uint16_t cause;
+
+   bool rr_cause_present;
+   uint8_t rr_cause;
+
+   struct gsm0808_speech_codec_list codec_list_bss_supported; /*< omit 
when .len == 0 */
+
+   /* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
+};
+struct msgb *gsm0808_create_handover_failure(const struct 
gsm0808_handover_failure *params);
+
 struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id);
 void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);

diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
index 83e29ca..6ff4459 100644
--- a/include/osmocom/gsm/gsm_utils.h
+++ b/include/osmocom/gsm/gsm_utils.h
@@ -30,6 +30,8 @@

 #include 
 #include 
+#include 
+#include 

 #define ADD_MODULO(sum, delta, modulo) do {\
if ((sum += delta) >= modulo)   \
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 3a63137..625de81 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -739,14 +739,16 @@
return msg;
 }

-/*! Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 
3.2.1.10. */
+/*! Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 
3.2.1.10.
+ * Sent from the MT BSC back to the MSC when it has allocated an lchan to 
handover to.
+ * l3_info is the RR Handover Command that the MO BSC sends to the MS to move 
over. */
 struct msgb *gsm0808_create_handover_request_ack(const uint8_t *l3_info, 
uint8_t l3_info_len,
 uint8_t chosen_channel, 
uint8_t chosen_encr_alg,
 uint8_t chosen_speech_version)
 {
struct msgb *msg;

-   msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, 
"BSSMAP-HANDOVER-ACCEPT-ACK");
+   msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, 
"BSSMAP-HANDOVER-REQUEST-ACK");
if (!msg)
return NULL;

@@ -764,6 +766,86 @@
return msg;
 }

+/*! Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40.
+ * Sent from the MT BSC back to the MSC when the MS has sent a handover RACH 
request and the MT BSC has
+ * received the Handover Detect message. */

Change in libosmocore[master]: add and tweak inter-BSC HO API

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9672 )

Change subject: add and tweak inter-BSC HO API
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9672
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Gerrit-Change-Number: 9672
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 18 Jun 2018 17:32:57 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


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

2018-06-18 Thread jenkins
See 


--
[...truncated 714.66 KB...]
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../../include/osmocom/ranap/RANAP_PLMNs-in-shared-network.h:27:2: note: in 
expansion of macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberM {
  ^
  CC   RANAP_SNA-Access-Information.lo
  CC   RANAP_SNAC.lo
  CC   RANAP_Service-Handover.lo
  CC   RANAP_Source-ToTarget-TransparentContainer.lo
  CC   RANAP_SourceeNodeB-ToTargeteNodeB-TransparentContainer.lo
  CC   RANAP_SourceCellID.lo
  CC   RANAP_SourceBSS-ToTargetBSS-TransparentContainer.lo
In file included from 
:8:0,
 from ../../include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:14,
 from 
../../include/osmocom/ranap/RANAP_SNA-Access-Information.h:14,
 from RANAP_SNA-Access-Information.c:7:
../../include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:27:23: warning: ‘struct 
MemberC’ declared inside parameter list will not be visible outside of this 
definition or declaration
  A_SEQUENCE_OF(struct MemberC {
   ^
:17:16:
 note: in definition of macro ‘A_SET_OF’
   void (*free)(type *);   \
^~~~
../../include/osmocom/ranap/RANAP_AuthorisedPLMNs.h:27:2: note: in expansion of 
macro ‘A_SEQUENCE_OF’
  A_SEQUENCE_OF(struct MemberC {
  ^
  CC   RANAP_SourceID.lo
  CC   RANAP_SourceRNC-ID.lo
  CC   RANAP_SourceRNC-ToTargetRNC-TransparentContainer.lo
  CC   RANAP_IRAT-Measurement-Configuration.lo
  CC   RANAP_IRATmeasurementParameters.lo
  CC   RANAP_RSRQ-Type.lo
  CC   RANAP_RSRQ-Extension.lo
  CC   RANAP_EUTRANFrequencies.lo
  CC   RANAP_MeasBand.lo
  CC   RANAP_SubscriberProfileIDforRFP.lo
In file included from 
:8:0,
 from ../../include/osmocom/ranap/RANAP_EUTRANFrequencies.h:14,
 from 
../../include/osmocom/ranap/RANAP_IRATmeasurementParameters.h:15,
 from RANAP_IRATmeasurementParameters.c:7:
../../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 
:8:0,
 from ../../include/osmocom/ranap/RANAP_EUTRANFrequencies.h:14,
 from 
../../include/osmocom/ranap/RANAP_IRATmeasurementParameters.h:15,
 from 
../../include/osmocom/ranap/RANAP_IRAT-Measurement-Configuration.h:15,
 from RANAP_IRAT-Measurement-Configuration.c:7:
../../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 {
  ^
  CC   RANAP_SourceStatisticsDescriptor.lo
  CC   RANAP_SupportedRAB-ParameterBitrateList.lo
  CC   RANAP_SupportedBitrate.lo
  CC   RANAP_SourceUTRANCellID.lo
In file included from 

Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9671

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

Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO
..

large refactoring: use FSMs for lchans; add inter-BSC HO

Add FSMs:

- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
  signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.

Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.

- Add logging macros for each FSM type:
  - LOG_TS()
  - LOG_LCHAN()
  - LOG_MGWEP(), LOG_CI()
  - LOG_ASSIGNMENT()
  - LOG_HO()
  These log with the osmo_fsm_inst where present.
  New style decision: logging without a final newline char is awkward,
  especially for gsmtap logging and when other logs interleave LOGPC() calls;
  we have various cases where the final \n goes missing, and also this invokes
  the log category checking N times instead of once.
  So I decided to make these macros *always* append a newline, but only if
  there is no final newline yet. I hope that the compiler optimizes the
  strlen() of the constant format strings away. Thus I can log with or without
  typing "\n" and always get an \n termination anyway.

General:

- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
  with dedicated FSM timeouts, states and events.

- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
  These can be used (with some macro magic) to define a state's timeout once,
  and not make mistakes for each osmo_fsm_inst_state_chg().

Details:

bsc_subscr_conn_fsm.c:

- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
  mgw_endpoint_fsm.

- There is exactly one state for an ongoing Assignment, with all details
  handled in conn->assignment.fi. The state relies on the assignment_fsm's
  timeout.

- There is one state for an ongoing Handover; except for an incoming Handover
  from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
  are both established.

- move bssmap_add_lcls_status() to osmo_bsc_lcls.c

abis_rsl.c:

- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain 
send/receive functions in
  abis_rsl.c

- reduce some rsl functions to merely send a message, rename to "_tx_".
  - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan 
state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this 
function.

- move all timers and error/release handling away into various FSMs.

- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
  lchan passed, but just mode,type that they require. Rename to
  ipacc_speech_mode*() and ipacc_payload_type().

- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
  message received during BSSMAP Handover Command.

- move various logging to LOG_LCHAN() in order to log with the lchan FSM 
instance.
  One drawback is that the lchan FSM is limited to one logging category, i.e. 
this moves some logging
  from DRR to DRSL. It might actually make sense to combine those categories.

- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for 
performance.

- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 
condition (I hope that's
  correct).

- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right 
away, so that during
  inter-bsc HO we can make an RR Handover Command to send via the MSC to the 
remote BSS.

assignment_fsm.c:

- the Chan Mode Modify in case of re-using the same lchan is not implemented
  yet, because this was also missing in the previous implementation.

Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/abis_rsl.h
A include/osmocom/bsc/assignment_fsm.h
M include/osmocom/bsc/bsc_api.h
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bsc_subscriber.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/debug.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/handover_fsm.h
A include/osmocom/bsc/lchan_fsm.h
A include/osmocom/bsc/lchan_select.h
A include/osmocom/bsc/mgw_endpoint_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/osmo_bsc.h
M include/osmocom/bsc/osmo_bsc_lcls.h
A include/osmocom/bsc/timeslot_fsm.h
M src/ipaccess/Makefile.am
M 

Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/9671 )

Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO
..


Patch Set 5:

The build fails because of the libosmocore dependency on the new gsm0808 
encoding functions for inter-bsc ho I03ee7ce840ecfa0b6a33358e7385528aabd4873f


--
To view, visit https://gerrit.osmocom.org/9671
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366
Gerrit-Change-Number: 9671
Gerrit-PatchSet: 5
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 18 Jun 2018 16:11:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: add and tweak inter-BSC HO API

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/9672 )

Change subject: add and tweak inter-BSC HO API
..


Patch Set 1:

osmo-bsc "large refactoring" patch needs this to build


--
To view, visit https://gerrit.osmocom.org/9672
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Gerrit-Change-Number: 9672
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 18 Jun 2018 16:11:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: bsc: handover: actually send Handover Detect

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9673 )

Change subject: bsc: handover: actually send Handover Detect
..

bsc: handover: actually send Handover Detect

Until now, the test went from RR Handover Command directly to RR Handover
Complete, and osmo-bsc didn't mind it. However, the normal handover procedure
requires an RSL Handover Detect to be sent in-between those. Send that.

Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
---
M bsc/MSC_ConnectionHandler.ttcn
M library/RSL_Types.ttcn
2 files changed, 13 insertions(+), 0 deletions(-)

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



diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 0846762..2042979 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -877,6 +877,10 @@
 * before performing a hand-over */
f_rslem_resume(RSL1_PROC);

+   /* send handover detect */
+   RSL1.send(ts_RSL_HANDO_DET(new_chan_nr));
+   f_sleep(0.3);
+
/* send handover complete over the new channel */
var PDU_ML3_MS_NW l3_tx := 
valueof(ts_RRM_HandoverComplete('00'O));
RSL1.send(ts_RSL_DATA_IND(new_chan_nr, 
valueof(ts_RslLinkID_DCCH(0)),
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index 3804d40..e1f6af0 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -1309,6 +1309,15 @@
}
}

+   /* 8.4.7 BTS -> BSC */
+   template (value) RSL_Message ts_RSL_HANDO_DET(template (value) 
RslChannelNr chan_nr) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_HANDO_DET,
+   ies := {
+   t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := 
chan_nr})
+   }
+   }
+

/* COMMON CHANNEL MANAGEMENT MESSAGES */


--
To view, visit https://gerrit.osmocom.org/9673
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
Gerrit-Change-Number: 9673
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in osmo-ttcn3-hacks[master]: bsc: handover: actually send Handover Detect

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9673 )

Change subject: bsc: handover: actually send Handover Detect
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9673
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
Gerrit-Change-Number: 9673
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 17:33:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: bsc: handover: actually send Handover Detect

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9673

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

Change subject: bsc: handover: actually send Handover Detect
..

bsc: handover: actually send Handover Detect

Until now, the test went from RR Handover Command directly to RR Handover
Complete, and osmo-bsc didn't mind it. However, the normal handover procedure
requires an RSL Handover Detect to be sent in-between those. Send that.

Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
---
M bsc/MSC_ConnectionHandler.ttcn
M library/RSL_Types.ttcn
2 files changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/73/9673/2
--
To view, visit https://gerrit.osmocom.org/9673
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
Gerrit-Change-Number: 9673
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 


Change in osmo-ttcn3-hacks[master]: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9674

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

Change subject: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, 
TC_ho_into_this_bsc
..

bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
---
M bsc/BSC_Tests.ttcn
M bsc/osmo-bsc.cfg
M library/BSSMAP_Templates.ttcn
M library/L3_Templates.ttcn
4 files changed, 330 insertions(+), 36 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/74/9674/2
--
To view, visit https://gerrit.osmocom.org/9674
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
Gerrit-Change-Number: 9674
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 


Change in osmo-ttcn3-hacks[master]: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9674 )

Change subject: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, 
TC_ho_into_this_bsc
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9674
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
Gerrit-Change-Number: 9674
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 17:34:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: cosmetic / linking: move str_to_imsi() out of abis_rsl.c

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9665 )

Change subject: cosmetic / linking: move str_to_imsi() out of abis_rsl.c
..

cosmetic / linking: move str_to_imsi() out of abis_rsl.c

Move to gsm_04_08_utils.c so that it's possible to use it without
linking/stubbing all of RSL.

Change-Id: I6e90831d7e618ce3c8e7417082a82c97f6681668
---
M include/osmocom/bsc/abis_rsl.h
M include/osmocom/bsc/gsm_04_08_utils.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_utils.c
M src/osmo-bsc/paging.c
M src/osmo-bsc/pcu_sock.c
6 files changed, 14 insertions(+), 11 deletions(-)

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



diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index fc21238..2fe8c38 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -68,7 +68,6 @@

 int abis_rsl_rcvmsg(struct msgb *msg);

-uint64_t str_to_imsi(const char *imsi_str);
 int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
enum rsl_rel_mode release_mode);

diff --git a/include/osmocom/bsc/gsm_04_08_utils.h 
b/include/osmocom/bsc/gsm_04_08_utils.h
index bdfca71..4349a37 100644
--- a/include/osmocom/bsc/gsm_04_08_utils.h
+++ b/include/osmocom/bsc/gsm_04_08_utils.h
@@ -39,3 +39,5 @@
 return msgb_alloc_headroom(GSM48_ALLOC_SIZE, GSM48_ALLOC_HEADROOM,
name);
 }
+
+uint64_t str_to_imsi(const char *imsi_str);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index add4390..ab3658d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -167,16 +167,6 @@
return lchan;
 }

-/* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */
-uint64_t str_to_imsi(const char *imsi_str)
-{
-   uint64_t ret;
-
-   ret = strtoull(imsi_str, NULL, 10);
-
-   return ret;
-}
-
 static struct msgb *rsl_msgb_alloc(void)
 {
return msgb_alloc_headroom(RSL_ALLOC_SIZE, RSL_ALLOC_HEADROOM,
diff --git a/src/osmo-bsc/gsm_04_08_utils.c b/src/osmo-bsc/gsm_04_08_utils.c
index 5bfdf97..e9aeb55 100644
--- a/src/osmo-bsc/gsm_04_08_utils.c
+++ b/src/osmo-bsc/gsm_04_08_utils.c
@@ -703,3 +703,13 @@
return gsm48_extract_mi(classmark2_lv, length - classmark_offset,
mi_string, mi_type);
 }
+
+/* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */
+uint64_t str_to_imsi(const char *imsi_str)
+{
+   uint64_t ret;
+
+   ret = strtoull(imsi_str, NULL, 10);
+
+   return ret;
+}
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 886d28b..feb9fea 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 

 void *tall_paging_ctx = NULL;

diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 5a3fefa..8a3c331 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 

 static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg);
 uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx);

--
To view, visit https://gerrit.osmocom.org/9665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6e90831d7e618ce3c8e7417082a82c97f6681668
Gerrit-Change-Number: 9665
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in osmo-gsm-tester[master]: ms: Remove debug left over for the test

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/9664 )

Change subject: ms: Remove debug left over for the test
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/9664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I17aa97a99cb1b1f9205b3a951370fe5ad49ae3dc
Gerrit-Change-Number: 9664
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 13:12:51 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-tester[master]: ms: Use the new API to pass credentials to the event server

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/9663 )

Change subject: ms: Use the new API to pass credentials to the event server
..


Patch Set 1:

I don't really understand the purpose of this commit. You seem to be changing 
code to use recvmsg to get the sender address, but then I only see you are 
passing the address and doing nothing useful with it.

Then, you start using this new API unix_passcred, which enables being able to 
send credentials over the socket (not sending them), but I don't see any new 
code or changed code actually sending the credentials.


--
To view, visit https://gerrit.osmocom.org/9663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
Gerrit-Change-Number: 9663
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 18 Jun 2018 13:12:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9670

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

Change subject: add gsm_timers, for Tnnn definitions usable by FSMs
..

add gsm_timers, for Tnnn definitions usable by FSMs

Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
A include/osmocom/bsc/gsm_timers.h
M src/ipaccess/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
M src/osmo-bsc/bts_siemens_bs11.c
M src/osmo-bsc/gsm_data.c
A src/osmo-bsc/gsm_timers.c
A src/osmo-bsc/gsm_timers_vty.c
M src/osmo-bsc/net_init.c
M src/osmo-bsc/paging.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/nanobts_omlattr/nanobts_omlattr_test.c
23 files changed, 514 insertions(+), 180 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/70/9670/2
--
To view, visit https://gerrit.osmocom.org/9670
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6
Gerrit-Change-Number: 9670
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9671

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

Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO
..

large refactoring: use FSMs for lchans; add inter-BSC HO

Add FSMs:

- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
  signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.

Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.

- Add logging macros for each FSM type:
  - LOG_TS()
  - LOG_LCHAN()
  - LOG_MGWEP(), LOG_CI()
  - LOG_ASSIGNMENT()
  - LOG_HO()
  These log with the osmo_fsm_inst where present.
  New style decision: logging without a final newline char is awkward,
  especially for gsmtap logging and when other logs interleave LOGPC() calls;
  we have various cases where the final \n goes missing, and also this invokes
  the log category checking N times instead of once.
  So I decided to make these macros *always* append a newline, but only if
  there is no final newline yet. I hope that the compiler optimizes the
  strlen() of the constant format strings away. Thus I can log with or without
  typing "\n" and always get an \n termination anyway.

General:

- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
  with dedicated FSM timeouts, states and events.

- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
  These can be used (with some macro magic) to define a state's timeout once,
  and not make mistakes for each osmo_fsm_inst_state_chg().

Details:

bsc_subscr_conn_fsm.c:

- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
  mgw_endpoint_fsm.

- There is exactly one state for an ongoing Assignment, with all details
  handled in conn->assignment.fi. The state relies on the assignment_fsm's
  timeout.

- There is one state for an ongoing Handover; except for an incoming Handover
  from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
  are both established.

- move bssmap_add_lcls_status() to osmo_bsc_lcls.c

abis_rsl.c:

- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain 
send/receive functions in
  abis_rsl.c

- reduce some rsl functions to merely send a message, rename to "_tx_".
  - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan 
state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this 
function.

- move all timers and error/release handling away into various FSMs.

- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
  lchan passed, but just mode,type that they require. Rename to
  ipacc_speech_mode*() and ipacc_payload_type().

- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
  message received during BSSMAP Handover Command.

- move various logging to LOG_LCHAN() in order to log with the lchan FSM 
instance.
  One drawback is that the lchan FSM is limited to one logging category, i.e. 
this moves some logging
  from DRR to DRSL. It might actually make sense to combine those categories.

- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for 
performance.

- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 
condition (I hope that's
  correct).

- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right 
away, so that during
  inter-bsc HO we can make an RR Handover Command to send via the MSC to the 
remote BSS.

assignment_fsm.c:

- the Chan Mode Modify in case of re-using the same lchan is not implemented
  yet, because this was also missing in the previous implementation.

Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/abis_rsl.h
A include/osmocom/bsc/assignment_fsm.h
M include/osmocom/bsc/bsc_api.h
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bsc_subscriber.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/debug.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/handover_fsm.h
A include/osmocom/bsc/lchan_fsm.h
A include/osmocom/bsc/lchan_select.h
A include/osmocom/bsc/mgw_endpoint_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/osmo_bsc.h
M include/osmocom/bsc/osmo_bsc_lcls.h
A include/osmocom/bsc/timeslot_fsm.h
M src/Makefile.am
M 

Change in osmo-bsc[master]: inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9666

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

Change subject: inter-BSC HO: add neighbor_ident API to manage 
neighbor-BSS-cells
..

inter-BSC HO: add neighbor_ident API to manage neighbor-BSS-cells

Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/neighbor_ident.h
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/handover_logic.c
A src/osmo-bsc/neighbor_ident.c
A src/osmo-bsc/neighbor_ident_vty.c
M src/osmo-bsc/net_init.c
M src/osmo-bsc/system_information.c
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
A tests/handover/neighbor_ident_test.c
A tests/handover/neighbor_ident_test.err
A tests/handover/neighbor_ident_test.ok
A tests/neighbor_ident.vty
M tests/testsuite.at
21 files changed, 1,960 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/9666/2
--
To view, visit https://gerrit.osmocom.org/9666
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0153d7069817fba9146ddc11214de2757d7d37bf
Gerrit-Change-Number: 9666
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/9670 )

Change subject: add gsm_timers, for Tnnn definitions usable by FSMs
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/9670/1/include/osmocom/bsc/gsm_timers.h
File include/osmocom/bsc/gsm_timers.h:

https://gerrit.osmocom.org/#/c/9670/1/include/osmocom/bsc/gsm_timers.h@1
PS1, Line 1: /* API to define Tnnn timers globally, configure in VTY and use 
for FSM state changes. */
If it's worthy, this might move to libosmocore instead, next to fsm.h



--
To view, visit https://gerrit.osmocom.org/9670
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6
Gerrit-Change-Number: 9670
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 18 Jun 2018 15:30:25 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: ttcn3-tcpdump-stop.sh: print colored verdict

2018-06-18 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/9675 )

Change subject: ttcn3-tcpdump-stop.sh: print colored verdict
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9675
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0d2d6171430f1eebb5377edac5e237a99ddbd743
Gerrit-Change-Number: 9675
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 18 Jun 2018 22:02:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Jenkins build is back to normal : master-osmo-iuh » a1=default,a2=default,a3=default,osmocom-master-debian9 #1404

2018-06-18 Thread jenkins
See 




Change in osmo-bsc[master]: doc: update/fix FSM charts

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9667


Change subject: doc: update/fix FSM charts
..

doc: update/fix FSM charts

Change-Id: I29e31b753e23a4207662e0e385a337e7df836f45
---
M doc/Makefile.am
A doc/assignment-fsm.dot
M doc/assignment.msc
A doc/handover-inter-bsc-mo-fsm.dot
A doc/handover-inter-bsc-mt-fsm.dot
M doc/handover-inter-bsc-mt.msc
A doc/handover-intra-bsc-fsm.dot
M doc/handover.msc
M doc/lchan-fsm.dot
M doc/lchan.msc
A doc/mgw-endpoint-fsm.dot
M doc/ms-channel-request.msc
12 files changed, 185 insertions(+), 26 deletions(-)



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

diff --git a/doc/Makefile.am b/doc/Makefile.am
index ca0470d..2a855eb 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -15,8 +15,13 @@
$(NULL)

 dot: \
+   $(builddir)/assignment-fsm.png \
$(builddir)/timeslot-fsm.png \
$(builddir)/lchan-fsm.png \
+   $(builddir)/mgw-endpoint-fsm.png \
+   $(builddir)/handover-intra-bsc-fsm.png \
+   $(builddir)/handover-inter-bsc-mo-fsm.png \
+   $(builddir)/handover-inter-bsc-mt-fsm.png \
$(NULL)

 $(builddir)/%.png: $(srcdir)/%.msc
diff --git a/doc/assignment-fsm.dot b/doc/assignment-fsm.dot
new file mode 100644
index 000..90f7621
--- /dev/null
+++ b/doc/assignment-fsm.dot
@@ -0,0 +1,35 @@
+digraph G {
+rankdir=TB;
+
+   WAIT_LCHAN_ACTIVE
+   WAIT_RR_ASS_COMPLETE
+   WAIT_LCHAN_ESTABLISHED
+   WAIT_MGW_ENDPOINT_TO_MSC
+   terminate [shape=box]
+
+   gscon [label="conn FSM",shape=box3d];
+   gscon2 [label="conn FSM",shape=box3d];
+   lchan [label="lchan FSM",shape=box3d];
+   old_lchan [label="old lchan",shape=box3d];
+
+   invisible [style="invisible"]
+   invisible -> gscon [label="GSCON_EV_A_ASSIGNMENT_CMD",style=dashed]
+   invisible -> old_lchan [style=invisible,arrowhead=none]
+
+   gscon -> WAIT_LCHAN_ACTIVE [label="assignment_fsm_start()",style=dashed]
+WAIT_LCHAN_ACTIVE -> lchan 
[label="lchan_activate()\nFOR_ASSIGNMENT",style=dashed]
+   lchan -> WAIT_LCHAN_ACTIVE 
[label="ASSIGNMENT_EV_\nLCHAN_\nACTIVE,ERROR",style=dashed]
+   lchan -> WAIT_LCHAN_ESTABLISHED 
[label="ASSIGNMENT_EV_\nLCHAN_\nESTABLISHED,ERROR",style=dashed]
+
+   WAIT_LCHAN_ACTIVE -> WAIT_RR_ASS_COMPLETE
+
+   WAIT_RR_ASS_COMPLETE -> old_lchan [label="RR 
Assignment\nCommand",style=dashed,constraint=false]
+   lchan -> WAIT_RR_ASS_COMPLETE [label="RR 
Assignment\nComplete",style=dashed]
+
+   WAIT_RR_ASS_COMPLETE -> WAIT_LCHAN_ESTABLISHED
+
+   WAIT_LCHAN_ESTABLISHED -> WAIT_MGW_ENDPOINT_TO_MSC [label="TCH"]
+   WAIT_LCHAN_ESTABLISHED -> terminate [label="non-TCH"]
+   WAIT_MGW_ENDPOINT_TO_MSC -> terminate
+   terminate -> gscon2 [label="GSCON_EV_\nASSIGNMENT_END",style=dashed]
+}
diff --git a/doc/assignment.msc b/doc/assignment.msc
index 9f10ea1..872161f 100644
--- a/doc/assignment.msc
+++ b/doc/assignment.msc
@@ -6,7 +6,7 @@
ms note mgw_msc [label="lchan allocation sequence for BSSMAP Assignment 
Request"];

bsc_gscon <= mgw_msc [label="BSSMAP Assignment Request"];
-   bsc_gscon abox bsc_gscon [label="ST_ASSIGNMENT_\nWAIT_LCHAN"];
+   bsc_gscon abox bsc_gscon [label="ST_ASSIGNMENT_\nWAIT_LCHAN\nT10?"];

bsc_lchan <- bsc_gscon [label="lchan_select_by_chan_mode(chan_mode)"];
|||;
@@ -15,13 +15,13 @@
bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];
---;
|||;
-   bsc_gscon box bsc_gscon [label="store lchan pointer in 
conn->lchan_for_assignment"];
+   bsc_gscon box bsc_gscon [label="store lchan pointer in 
conn->assignment.new_lchan"];
bsc_lchan <- bsc_gscon [label="lchan_activate(FOR_ASSIGNMENT)"];
...;
|||;
--- [label="on lchan FSM error or timeout"];
-   bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ALLOC_ERROR"];
-   bsc_gscon box bsc_gscon [label="'forget' all about 
conn->lchan_for_assignment"];
+   bsc_lchan -> bsc_gscon [label="GSCON_EV_LCHAN_ERROR"];
+   bsc_gscon box bsc_gscon [label="'forget' all about 
conn->assignment.new_lchan"];
bsc_gscon => mgw_msc [label="BSSMAP Assignment Failure"];
bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];
--- [label="END: 'on error'"];
@@ -49,9 +49,9 @@
bsc_gscon -> bsc_lchan [label="LCHAN_EV_MGW_ENDPOINT_ERROR"];
bsc_lchan note bsc_gscon [label="conn FSM timeout handler exits and 
relies on the lchan FSM
signalling error, which should actually happen immediately:"];
-   bsc_gscon <- bsc_lchan [label="GSCON_EV_LCHAN_ALLOC_ERROR"];
+   bsc_gscon <- bsc_lchan [label="GSCON_EV_LCHAN_ERROR"];
bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];
-   bsc_gscon box bsc_gscon [label="'forget' all about 
conn->lchan_for_assignment"];
+   bsc_gscon box bsc_gscon [label="'forget' all about 

Change in osmo-bsc[master]: fix / clarify rsl dtap cache

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9668


Change subject: fix / clarify rsl dtap cache
..

fix / clarify rsl dtap cache

In certain situations like handover or assignment, DTAP must not go out via RSL
directly but is cached to be submitted later. Make sure that all RSL DTAP
sending adheres to this:

gscon_submit_rsl_dtap() is the new "public" API to request an RSL DTAP to be
sent. Depending on the gscon's state, this ends up in the cache or is sent
directly. When caching, there is no way to tell whether sending will succeed or
not, so semantically it does not make sense to even return a result code. Just
return void. Change all "public" callers to gscon_submit_rsl_dtap().

Merge gsm0808_submit_dtap() and submit_dtap() guts to gsm0808_send_rsl_dtap(),
static in bsc_subscr_conn_fsm.c: directly send DTAP, assume a conn->lchan to be
present, or otherwise trigger a BSSMAP Clear Request.

The static submit_dtap() becomes a thin convenience wrapper.

Move ho_dtap_cache* functions to bsc_subscr_conn_fsm.c and rename to
gscon_dtap_cache_* -- they are not only for handover, also for assignment.

Function gsm0808_submit_dtap() m
Introduce function gscon_submit_rsl_dtap()

Change-Id: I6ffd7aa641c8905292c769400048c96aa0949585
---
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/bsc_api.c
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/gsm_04_08_utils.c
M src/osmo-bsc/gsm_04_80_utils.c
M src/osmo-bsc/osmo_bsc_api.c
M tests/bsc/bsc_test.c
9 files changed, 185 insertions(+), 160 deletions(-)



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

diff --git a/include/osmocom/bsc/bsc_subscr_conn_fsm.h 
b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
index e8226f4..0d373eb 100644
--- a/include/osmocom/bsc/bsc_subscr_conn_fsm.h
+++ b/include/osmocom/bsc/bsc_subscr_conn_fsm.h
@@ -66,6 +66,11 @@

 struct gsm_subscriber_connection;
 struct gsm_network;
+struct msgb;

 /* Allocate a subscriber connection and its associated FSM */
 struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network 
*net);
+
+void gscon_submit_rsl_dtap(struct gsm_subscriber_connection *conn,
+  struct msgb *msg, int link_id, int allow_sacch);
+void gscon_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 76a1b30..6ee95f7 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -120,8 +120,8 @@
struct gsm_classmark classmark;

/* Cache DTAP messages during handover/assignment 
(msgb_enqueue()/msgb_dequeue())*/
-   struct llist_head ho_dtap_cache;
-   unsigned int ho_dtap_cache_len;
+   struct llist_head dtap_cache;
+   unsigned int dtap_cache_len;

struct {
int failures;
diff --git a/src/osmo-bsc/bsc_api.c b/src/osmo-bsc/bsc_api.c
index 4cf11a4..2c799e3 100644
--- a/src/osmo-bsc/bsc_api.c
+++ b/src/osmo-bsc/bsc_api.c
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -41,10 +42,6 @@

 #define GSM0808_T10_VALUE6, 0

-#define HO_DTAP_CACHE_MSGB_CB_LINK_ID 0
-#define HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1
-
-static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
 static void handle_release(struct gsm_subscriber_connection *conn, struct  
gsm_lchan *lchan);
 static void handle_chan_ack(struct gsm_subscriber_connection *conn, struct  
gsm_lchan *lchan);
 static void handle_chan_nack(struct gsm_subscriber_connection *conn, struct  
gsm_lchan *lchan);
@@ -116,97 +113,6 @@
return 0;
 }

-static void ho_dtap_cache_add(struct gsm_subscriber_connection *conn, struct 
msgb *msg,
- int link_id, bool allow_sacch)
-{
-   if (conn->ho_dtap_cache_len >= 23) {
-   LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages,"
-" already reached sane maximum of %u cached messages\n",
-bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len);
-   msgb_free(msg);
-   return;
-   }
-   conn->ho_dtap_cache_len ++;
-   LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n",
-bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len);
-   msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id;
-   msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0;
-   msgb_enqueue(>ho_dtap_cache, msg);
-}
-
-void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send)
-{
-   struct msgb *msg;
-   unsigned int flushed_count = 0;
-
-   if (conn->secondary_lchan || conn->ho) {
-   LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, 
handover/assignment is still ongoing\n",
-   

Change in osmo-bsc[master]: add gsm_timers, for Tnnn definitions usable by FSMs

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9670


Change subject: add gsm_timers, for Tnnn definitions usable by FSMs
..

add gsm_timers, for Tnnn definitions usable by FSMs

This reverts commit c0990acd03807631fb426ca0123d9fc402e97ca1.

Change-Id: If212fcd042051b6fa53484254223614c5b93a9c6
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
A include/osmocom/bsc/gsm_timers.h
M src/ipaccess/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
M src/osmo-bsc/bts_siemens_bs11.c
M src/osmo-bsc/gsm_data.c
A src/osmo-bsc/gsm_timers.c
A src/osmo-bsc/gsm_timers_vty.c
M src/osmo-bsc/net_init.c
M src/osmo-bsc/paging.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/nanobts_omlattr/nanobts_omlattr_test.c
23 files changed, 513 insertions(+), 180 deletions(-)



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

diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 18737a3..82a2e26 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -18,6 +18,7 @@
gsm_04_08_utils.h \
gsm_04_80.h \
gsm_data.h \
+   gsm_timers.h \
handover.h \
handover_cfg.h \
handover_decision.h \
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 6ee95f7..ce7a8fe 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -32,6 +32,8 @@
 #include 
 #include 

+#define GSM_T3122_DEFAULT 10
+
 struct mgcp_client_conf;
 struct mgcp_client;
 struct mgcp_ctx;
@@ -1189,23 +1191,6 @@
bsc_ctr_description,
 };

-#define GSM_T3101_DEFAULT 3/* s */
-#define GSM_T3103_DEFAULT 5/* s */
-#define GSM_T3105_DEFAULT 100  /* ms */
-#define GSM_T3107_DEFAULT 5/* s */
-#define GSM_T3109_DEFAULT 5/* s, must be 2s + radio_link_timeout*0.48 */
-#define GSM_T3111_DEFAULT 2/* s */
-#define GSM_T3113_DEFAULT 10   /* s */
-#define GSM_T3115_DEFAULT 10
-#define GSM_T3117_DEFAULT 10
-#define GSM_T3119_DEFAULT 10
-#define GSM_T3122_DEFAULT 10
-#define GSM_T3141_DEFAULT 10
-#define GSM_T10_DEFAULT 6  /* RR Assignment timeout, in seconds */
-#define GSM_T7_DEFAULT 10  /* inter-BSC MO Handover first timeout, in 
seconds */
-#define GSM_T8_DEFAULT 10  /* inter-BSC MO Handover second timeout, in 
seconds */
-#define GSM_T101_DEFAULT 10/* inter-BSC MT Handover timeout, in seconds */
-
 struct gsm_tz {
int override; /* if 0, use system's time zone instead. */
int hr; /* hour */
@@ -1237,23 +1222,8 @@
unsigned int num_bts;
struct llist_head bts_list;

-   /* timer values */
-   int T3101;
-   int T3103; /*< Handover timeout */
-   int T3105;
-   int T3107;
-   int T3109;
-   int T3111;
-   int T3113;
-   int T3115;
-   int T3117;
-   int T3119;
-   int T3122;
-   int T3141;
-   int T10; /*< RR Assignment timeout, in seconds */
-   int T7; /*< inter-BSC handover MO timeout from Handover Required to 
Handover Command */
-   int T8; /*< inter-BSC handover MO timeout from Handover Command to 
final Clear*/
-   int T101; /*< inter-BSC handover MT timeout from Handover Request to 
Handover Accept */
+   /* shall reference gsm_network_T[] */
+   struct T_def *T_defs;

enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T];

@@ -1287,9 +1257,6 @@
 * pointer is NULL to indicate absence of a bsc_subscribers list. */
struct llist_head *bsc_subscribers;

-   /* Periodic location update default value */
-   uint8_t t3212;
-
/* Timer for periodic channel load measurements to maintain each BTS's 
T3122. */
struct osmo_timer_list t3122_chan_load_timer;

diff --git a/include/osmocom/bsc/gsm_timers.h b/include/osmocom/bsc/gsm_timers.h
new file mode 100644
index 000..fde8c93
--- /dev/null
+++ b/include/osmocom/bsc/gsm_timers.h
@@ -0,0 +1,55 @@
+/* API to define Tnnn timers globally, configure in VTY and use for FSM state 
changes. */
+#pragma once
+
+#include 
+#include 
+
+struct osmo_fsm_inst;
+struct vty;
+
+enum T_unit {
+   T_S = 0,/*< most T are in seconds, keep 0 as default. */
+   T_MS,   /*< milliseconds */
+   T_M,/*< minutes */
+   T_CUSTOM,
+};
+
+extern const struct value_string T_unit_names[];
+static inline const char *T_unit_name(enum T_unit val)
+{ return get_value_string(T_unit_names, val); }
+
+/* Define a GSM timer of the form Tnnn, with unit, default value and doc 
string. */
+struct T_def {
+   const int T; /*< T1234 number */
+   const int default_val; /*< 

Change in osmo-bsc[master]: cosmetic / linking: move str_to_imsi() out of abis_rsl.c

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9665


Change subject: cosmetic / linking: move str_to_imsi() out of abis_rsl.c
..

cosmetic / linking: move str_to_imsi() out of abis_rsl.c

Move to gsm_04_08_utils.c so that it's possible to use it without
linking/stubbing all of RSL.

Change-Id: I6e90831d7e618ce3c8e7417082a82c97f6681668
---
M include/osmocom/bsc/abis_rsl.h
M include/osmocom/bsc/gsm_04_08_utils.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/gsm_04_08_utils.c
M src/osmo-bsc/paging.c
M src/osmo-bsc/pcu_sock.c
6 files changed, 14 insertions(+), 11 deletions(-)



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

diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h
index fc21238..2fe8c38 100644
--- a/include/osmocom/bsc/abis_rsl.h
+++ b/include/osmocom/bsc/abis_rsl.h
@@ -68,7 +68,6 @@

 int abis_rsl_rcvmsg(struct msgb *msg);

-uint64_t str_to_imsi(const char *imsi_str);
 int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id,
enum rsl_rel_mode release_mode);

diff --git a/include/osmocom/bsc/gsm_04_08_utils.h 
b/include/osmocom/bsc/gsm_04_08_utils.h
index bdfca71..4349a37 100644
--- a/include/osmocom/bsc/gsm_04_08_utils.h
+++ b/include/osmocom/bsc/gsm_04_08_utils.h
@@ -39,3 +39,5 @@
 return msgb_alloc_headroom(GSM48_ALLOC_SIZE, GSM48_ALLOC_HEADROOM,
name);
 }
+
+uint64_t str_to_imsi(const char *imsi_str);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index add4390..ab3658d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -167,16 +167,6 @@
return lchan;
 }

-/* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */
-uint64_t str_to_imsi(const char *imsi_str)
-{
-   uint64_t ret;
-
-   ret = strtoull(imsi_str, NULL, 10);
-
-   return ret;
-}
-
 static struct msgb *rsl_msgb_alloc(void)
 {
return msgb_alloc_headroom(RSL_ALLOC_SIZE, RSL_ALLOC_HEADROOM,
diff --git a/src/osmo-bsc/gsm_04_08_utils.c b/src/osmo-bsc/gsm_04_08_utils.c
index 5bfdf97..e9aeb55 100644
--- a/src/osmo-bsc/gsm_04_08_utils.c
+++ b/src/osmo-bsc/gsm_04_08_utils.c
@@ -703,3 +703,13 @@
return gsm48_extract_mi(classmark2_lv, length - classmark_offset,
mi_string, mi_type);
 }
+
+/* As per TS 03.03 Section 2.2, the IMSI has 'not more than 15 digits' */
+uint64_t str_to_imsi(const char *imsi_str)
+{
+   uint64_t ret;
+
+   ret = strtoull(imsi_str, NULL, 10);
+
+   return ret;
+}
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 886d28b..feb9fea 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 

 void *tall_paging_ctx = NULL;

diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 5a3fefa..8a3c331 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 

 static int pcu_sock_send(struct gsm_bts *bts, struct msgb *msg);
 uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx);

--
To view, visit https://gerrit.osmocom.org/9665
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e90831d7e618ce3c8e7417082a82c97f6681668
Gerrit-Change-Number: 9665
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-bsc[master]: code bomb: refactor just about everything for inter-bsc HO

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9671


Change subject: code bomb: refactor just about everything for inter-bsc HO
..

code bomb: refactor just about everything for inter-bsc HO

This is way too large, yet the typical tangle of modification onto
modifications needs to be squashed to make sensible bits of them later for
code review...

Change-Id: I82e3f918295daa83274a4cf803f046979f284366
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/abis_rsl.h
A include/osmocom/bsc/assignment_fsm.h
M include/osmocom/bsc/bsc_api.h
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bsc_subscriber.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/debug.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/handover_fsm.h
A include/osmocom/bsc/lchan_fsm.h
A include/osmocom/bsc/lchan_select.h
A include/osmocom/bsc/mgw_endpoint_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/osmo_bsc.h
M include/osmocom/bsc/osmo_bsc_lcls.h
A include/osmocom/bsc/timeslot_fsm.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/abis_rsl.c
A src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/bsc_api.c
D src/osmo-bsc/bsc_dyn_ts.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/bsc_subscriber.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_ericsson_rbs2000.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/bts_nokia_site.c
M src/osmo-bsc/bts_siemens_bs11.c
M src/osmo-bsc/chan_alloc.c
M src/osmo-bsc/gsm_04_08_utils.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/handover_decision.c
M src/osmo-bsc/handover_decision_2.c
A src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/handover_logic.c
A src/osmo-bsc/lchan_fsm.c
A src/osmo-bsc/lchan_select.c
M src/osmo-bsc/meas_feed.c
A src/osmo-bsc/mgw_endpoint_fsm.c
M src/osmo-bsc/neighbor_ident_vty.c
M src/osmo-bsc/osmo_bsc_api.c
D src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_grace.c
M src/osmo-bsc/osmo_bsc_lcls.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/paging.c
M src/osmo-bsc/pcu_sock.c
M src/osmo-bsc/system_information.c
A src/osmo-bsc/timeslot_fsm.c
A src/stubs/lchan_fsm_stubs.c
A src/stubs/ts_fsm_stubs.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/handover/handover_test.c
M tests/handover/neighbor_ident_test.c
M tests/nanobts_omlattr/Makefile.am
68 files changed, 8,245 insertions(+), 4,793 deletions(-)



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


--
To view, visit https://gerrit.osmocom.org/9671
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366
Gerrit-Change-Number: 9671
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in libosmocore[master]: add and tweak inter-BSC HO API

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9672


Change subject: add and tweak inter-BSC HO API
..

add and tweak inter-BSC HO API

Add:
gsm0808_create_handover_detect()
gsm0808_create_handover_complete()
gsm0808_create_handover_failure()

To existing structs gsm0808_old_bss_to_new_bss_info and
gsm0808_handover_required, add a final 'more_items' flag that makes future
extensions API and ABI compatible.

Fix the msgb string for Handover Request Ack.

Extend some API doc comments.

Related: OS#2283 (inter-BSC Handover, BSC side, MT)
Change-Id: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
---
M include/osmocom/gsm/gsm0808.h
M include/osmocom/gsm/gsm_utils.h
M src/gsm/gsm0808.c
M src/gsm/libosmogsm.map
4 files changed, 129 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/9672/1

diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index d704aa9..5ae0af8 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -103,6 +103,7 @@
} current_channel_type_2;

/* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
 };

 /*! 3GPP TS 48.008 §3.2.1.9 HANDOVER REQUIRED */
@@ -120,6 +121,7 @@
struct gsm0808_old_bss_to_new_bss_info old_bss_to_new_bss_info;

/* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
 };
 struct msgb *gsm0808_create_handover_required(const struct 
gsm0808_handover_required *params);

@@ -127,6 +129,44 @@
 uint8_t chosen_channel, 
uint8_t chosen_encr_alg,
 uint8_t chosen_speech_version);

+struct msgb *gsm0808_create_handover_detect();
+
+struct gsm0808_handover_complete {
+   bool rr_cause_present;
+   uint8_t rr_cause;
+
+   bool speech_codec_chosen_present;
+   struct gsm0808_speech_codec speech_codec_chosen;
+
+   struct gsm0808_speech_codec_list codec_list_bss_supported; /*< omit 
when .len == 0 */
+
+   bool chosen_encr_alg_present;
+   uint8_t chosen_encr_alg;
+
+   bool chosen_channel_present;
+   uint8_t chosen_channel;
+
+   bool lcls_bss_status_present;
+   enum gsm0808_lcls_status lcls_bss_status;
+
+   /* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
+};
+struct msgb *gsm0808_create_handover_complete(const struct 
gsm0808_handover_complete *params);
+
+struct gsm0808_handover_failure {
+   uint16_t cause;
+
+   bool rr_cause_present;
+   uint8_t rr_cause;
+
+   struct gsm0808_speech_codec_list codec_list_bss_supported; /*< omit 
when .len == 0 */
+
+   /* more items are defined in the spec and may be added later */
+   bool more_items; /*< always set this to false */
+};
+struct msgb *gsm0808_create_handover_failure(const struct 
gsm0808_handover_failure *params);
+
 struct msgb *gsm0808_create_dtap(struct msgb *msg, uint8_t link_id);
 void gsm0808_prepend_dtap_header(struct msgb *msg, uint8_t link_id);

diff --git a/include/osmocom/gsm/gsm_utils.h b/include/osmocom/gsm/gsm_utils.h
index 83e29ca..6ff4459 100644
--- a/include/osmocom/gsm/gsm_utils.h
+++ b/include/osmocom/gsm/gsm_utils.h
@@ -30,6 +30,8 @@

 #include 
 #include 
+#include 
+#include 

 #define ADD_MODULO(sum, delta, modulo) do {\
if ((sum += delta) >= modulo)   \
diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c
index 3a63137..625de81 100644
--- a/src/gsm/gsm0808.c
+++ b/src/gsm/gsm0808.c
@@ -739,14 +739,16 @@
return msg;
 }

-/*! Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 
3.2.1.10. */
+/*! Create BSSMAP HANDOVER REQUEST ACKNOWLEDGE message, 3GPP TS 48.008 
3.2.1.10.
+ * Sent from the MT BSC back to the MSC when it has allocated an lchan to 
handover to.
+ * l3_info is the RR Handover Command that the MO BSC sends to the MS to move 
over. */
 struct msgb *gsm0808_create_handover_request_ack(const uint8_t *l3_info, 
uint8_t l3_info_len,
 uint8_t chosen_channel, 
uint8_t chosen_encr_alg,
 uint8_t chosen_speech_version)
 {
struct msgb *msg;

-   msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, 
"BSSMAP-HANDOVER-ACCEPT-ACK");
+   msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, 
"BSSMAP-HANDOVER-REQUEST-ACK");
if (!msg)
return NULL;

@@ -764,6 +766,86 @@
return msg;
 }

+/*! Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40.
+ * Sent from the MT BSC back to the MSC when the MS has sent a handover RACH 
request and the MT BSC has
+ * received the Handover Detect message. */
+struct msgb 

Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO

2018-06-18 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/9671

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

Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO
..

large refactoring: use FSMs for lchans; add inter-BSC HO

Add FSMs:

- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
  signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.

Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.

- Add logging macros for each FSM type:
  - LOG_TS()
  - LOG_LCHAN()
  - LOG_MGWEP(), LOG_CI()
  - LOG_ASSIGNMENT()
  - LOG_HO()
  These log with the osmo_fsm_inst where present.
  New style decision: logging without a final newline char is awkward,
  especially for gsmtap logging and when other logs interleave LOGPC() calls;
  we have various cases where the final \n goes missing, and also this invokes
  the log category checking N times instead of once.
  So I decided to make these macros *always* append a newline, but only if
  there is no final newline yet. I hope that the compiler optimizes the
  strlen() of the constant format strings away. Thus I can log with or without
  typing "\n" and always get an \n termination anyway.

General:

- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
  with dedicated FSM timeouts, states and events.

- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
  These can be used (with some macro magic) to define a state's timeout once,
  and not make mistakes for each osmo_fsm_inst_state_chg().

Details:

bsc_subscr_conn_fsm.c:

- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
  mgw_endpoint_fsm.

- There is exactly one state for an ongoing Assignment, with all details
  handled in conn->assignment.fi. The state relies on the assignment_fsm's
  timeout.

- There is one state for an ongoing Handover; except for an incoming Handover
  from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
  are both established.

- move bssmap_add_lcls_status() to osmo_bsc_lcls.c

abis_rsl.c:

- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain 
send/receive functions in
  abis_rsl.c

- reduce some rsl functions to merely send a message, rename to "_tx_".
  - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan 
state out into the
lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this 
function.

- move all timers and error/release handling away into various FSMs.

- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
  lchan passed, but just mode,type that they require. Rename to
  ipacc_speech_mode*() and ipacc_payload_type().

- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
  message received during BSSMAP Handover Command.

- move various logging to LOG_LCHAN() in order to log with the lchan FSM 
instance.
  One drawback is that the lchan FSM is limited to one logging category, i.e. 
this moves some logging
  from DRR to DRSL. It might actually make sense to combine those categories.

- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for 
performance.

- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 
condition (I hope that's
  correct).

- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right 
away, so that during
  inter-bsc HO we can make an RR Handover Command to send via the MSC to the 
remote BSS.

assignment_fsm.c:

- the Chan Mode Modify in case of re-using the same lchan is not implemented
  yet, because this was also missing in the previous implementation.

Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/abis_rsl.h
A include/osmocom/bsc/assignment_fsm.h
M include/osmocom/bsc/bsc_api.h
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bsc_subscriber.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/debug.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/handover_fsm.h
A include/osmocom/bsc/lchan_fsm.h
A include/osmocom/bsc/lchan_select.h
A include/osmocom/bsc/mgw_endpoint_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/osmo_bsc.h
M include/osmocom/bsc/osmo_bsc_lcls.h
A include/osmocom/bsc/timeslot_fsm.h
M src/Makefile.am
M 

Change in osmo-ttcn3-hacks[master]: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9674


Change subject: bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, 
TC_ho_into_this_bsc
..

bsc: inter-BSC HO: add TC_ho_out_of_this_bsc, TC_ho_into_this_bsc

Change-Id: Id22852d4be7f127d827e7a8beeec55db27c07f03
---
M bsc/BSC_Tests.ttcn
M bsc/osmo-bsc.cfg
2 files changed, 330 insertions(+), 36 deletions(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0107091..ca7b275 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -33,6 +33,8 @@
 import from RSL_Types all;
 import from RSL_Emulation all;
 import from MGCP_Emulation all;
+import from MGCP_Templates all;
+import from MGCP_Types all;

 import from Osmocom_CTRL_Functions all;
 import from Osmocom_CTRL_Types all;
@@ -43,6 +45,7 @@

 import from MobileL3_CommonIE_Types all;
 import from MobileL3_Types all;
+import from MobileL3_RRM_Types all;
 import from L3_Templates all;
 import from GSM_RR_Types all;

@@ -2067,41 +2070,6 @@
f_vty_ss_action("handover " & int2str(new_bts_nr), bts_nr, trx_nr, 
chan_nr);
 }

-/* intra-BSC hand-over between BTS0 and BTS1 */
-private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr {
-   g_pars := valueof(t_def_TestHdlrPars);
-   var template PDU_BSSAP exp_compl := f_gen_exp_compl();
-   var PDU_BSSAP ass_cmd := f_gen_ass_req();
-   const OCT8 kc := '0001020304050607'O;
-
-   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelType);
-   ass_cmd.pdu.bssmap.assignmentRequest.codecList := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
-
-   f_establish_fully(ass_cmd, exp_compl);
-
-   var HandoverState hs := {
-   rr_ho_cmpl_seen := false,
-   handover_done := false,
-   old_chan_nr := -
-   };
-   /* issue hand-over command on VTY */
-   f_vty_handover(0, 0, g_chan_nr, 1);
-   /* temporarily suspend DChan processing on BTS1 to avoid race with 
RSLEM_register */
-   f_rslem_suspend(RSL1_PROC);
-   alt {
-   [] as_handover(hs);
-   /* FIXME: somehow determine that the hand-over has completed, by MGCP 
MDCX? */
-   }
-}
-
-testcase TC_ho_int() runs on test_CT {
-   var MSC_ConnHdlr vc_conn;
-   f_init(2, true);
-   f_sleep(1.0);
-   vc_conn := f_start_handler(refers(f_tc_ho_int));
-   vc_conn.done;
-}
-
 /* OS#3041: Open and close N connections in a normal fashion, and expect no
  * BSSMAP Reset just because of that. */
 testcase TC_bssap_rlsd_does_not_cause_bssmap_reset() runs on test_CT {
@@ -2481,6 +2449,327 @@
* is the info correct on delayed PCU (re)connect?
  */

+
+/***
+ * Handover
+ ***/
+
+/* intra-BSC hand-over between BTS0 and BTS1 */
+private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr {
+   g_pars := valueof(t_def_TestHdlrPars);
+   var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+   var PDU_BSSAP ass_cmd := f_gen_ass_req();
+   const OCT8 kc := '0001020304050607'O;
+
+   ass_cmd.pdu.bssmap.assignmentRequest.channelType := 
valueof(ts_BSSMAP_IE_ChannelType);
+   ass_cmd.pdu.bssmap.assignmentRequest.codecList := 
valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+
+   f_establish_fully(ass_cmd, exp_compl);
+
+   var HandoverState hs := {
+   rr_ho_cmpl_seen := false,
+   handover_done := false,
+   old_chan_nr := -
+   };
+   /* issue hand-over command on VTY */
+   f_vty_handover(0, 0, g_chan_nr, 1);
+   /* temporarily suspend DChan processing on BTS1 to avoid race with 
RSLEM_register */
+   f_rslem_suspend(RSL1_PROC);
+   alt {
+   [] as_handover(hs);
+   /* FIXME: somehow determine that the hand-over has completed, by MGCP 
MDCX? */
+   }
+}
+
+testcase TC_ho_int() runs on test_CT {
+   var MSC_ConnHdlr vc_conn;
+   f_init(2, true);
+   f_sleep(1.0);
+   vc_conn := f_start_handler(refers(f_tc_ho_int));
+   vc_conn.done;
+}
+
+template PDU_BSSAP tr_BSSMAP_HandoverRequired modifies tr_BSSAP_BSSMAP := {
+   pdu := {
+   bssmap := {
+   handoverRequired := {
+   messageType := '11'O
+   }
+   }
+   }
+}
+
+template PDU_BSSAP ts_BSSMAP_HandoverCommand(octetstring layer3info) modifies 
ts_BSSAP_BSSMAP := {
+   pdu := {
+   bssmap := {
+   handoverCommand := {
+   messageType := '13'O,
+   layer3Information := {
+   elementIdentifier := '17'O,
+   lengthIndicator 

Change in osmo-ttcn3-hacks[master]: bsc: handover: actually send Handover Detect

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9673


Change subject: bsc: handover: actually send Handover Detect
..

bsc: handover: actually send Handover Detect

Until now, the test went from RR Handover Command directly to RR Handover
Complete, and osmo-bsc didn't mind it. However, the normal handover procedure
requires an RSL Handover Detect to be sent in-between those. Send that.

Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
---
M bsc/MSC_ConnectionHandler.ttcn
1 file changed, 12 insertions(+), 0 deletions(-)



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

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 0846762..9661ce3 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -858,6 +858,14 @@
RslChannelNr old_chan_nr
 };

+template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr 
chan_nr) := {
+   msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
+   msg_type := RSL_MT_HANDO_DET,
+   ies := {
+   t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
+   }
+}
+
 altstep as_handover(inout HandoverState st) runs on MSC_ConnHdlr {
var RSL_Message rsl;
[not st.rr_ho_cmpl_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> 
value rsl {
@@ -877,6 +885,10 @@
 * before performing a hand-over */
f_rslem_resume(RSL1_PROC);

+   /* send handover detect */
+   RSL1.send(ts_RSL_HANDO_DET(new_chan_nr));
+   f_sleep(0.3);
+
/* send handover complete over the new channel */
var PDU_ML3_MS_NW l3_tx := 
valueof(ts_RRM_HandoverComplete('00'O));
RSL1.send(ts_RSL_DATA_IND(new_chan_nr, 
valueof(ts_RslLinkID_DCCH(0)),

--
To view, visit https://gerrit.osmocom.org/9673
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
Gerrit-Change-Number: 9673
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-ttcn3-hacks[master]: ttcn3-tcpdump-stop.sh: print colored verdict

2018-06-18 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/9675


Change subject: ttcn3-tcpdump-stop.sh: print colored verdict
..

ttcn3-tcpdump-stop.sh: print colored verdict

Change-Id: I0d2d6171430f1eebb5377edac5e237a99ddbd743
---
M ttcn3-tcpdump-stop.sh
1 file changed, 8 insertions(+), 0 deletions(-)



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

diff --git a/ttcn3-tcpdump-stop.sh b/ttcn3-tcpdump-stop.sh
index a085bf7..9404841 100755
--- a/ttcn3-tcpdump-stop.sh
+++ b/ttcn3-tcpdump-stop.sh
@@ -2,6 +2,14 @@

 PIDFILE=/tmp/tcpdump.pid
 TESTCASE=$1
+VERDICT="$2"
+
+if [ x"$VERDICT" = x"pass" ]; then
+   echo "\033[1;32m== $TESTCASE $VERDICT ==\033[0m"
+else
+   echo "\033[1;31m-- $TESTCASE $VERDICT --\033[0m"
+fi
+echo

 if [ "z$TTCN3_PCAP_PATH" = "z" ]; then
TTCN3_PCAP_PATH=/tmp

--
To view, visit https://gerrit.osmocom.org/9675
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d2d6171430f1eebb5377edac5e237a99ddbd743
Gerrit-Change-Number: 9675
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-gsm-tester[master]: ms: Use the new API to pass credentials to the event server

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9663 )

Change subject: ms: Use the new API to pass credentials to the event server
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9663
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9b9ac6267f40345baf7dbb3becaecf264a5df5f
Gerrit-Change-Number: 9663
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 08:10:26 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-tester[master]: ms: Remove debug left over for the test

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9664 )

Change subject: ms: Remove debug left over for the test
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/9664
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I17aa97a99cb1b1f9205b3a951370fe5ad49ae3dc
Gerrit-Change-Number: 9664
Gerrit-PatchSet: 1
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Mon, 18 Jun 2018 08:10:19 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: bsc: fix TC_chan_rel_hard_rlsd_ms_dead: ignore RLL REL

2018-06-18 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9626 )

Change subject: bsc: fix TC_chan_rel_hard_rlsd_ms_dead: ignore RLL REL
..

bsc: fix TC_chan_rel_hard_rlsd_ms_dead: ignore RLL REL

The intention is to ignore RLL REL requests, and not to actually block the alt
statement in f_expect_chan_rel() if any RLL REL messages show up.

Change-Id: I3bbcdc41d186a3464cd4adb5c5b770bdec056993
---
M bsc/BSC_Tests.ttcn
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 2f99bcb..0107091 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -816,6 +816,11 @@
f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch));
repeat;
}
+   [not handle_rll_rel] 
IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,
+   tr_RSL_REL_REQ(rsl_chan_nr, ?))) {
+   /* Do not reply, just continue */
+   repeat;
+   }
/* Expect RF channel release from BSC on Abis */
[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,

tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) {

--
To view, visit https://gerrit.osmocom.org/9626
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3bbcdc41d186a3464cd4adb5c5b770bdec056993
Gerrit-Change-Number: 9626
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Change in osmo-ttcn3-hacks[master]: bsc: handover: actually send Handover Detect

2018-06-18 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9673 )

Change subject: bsc: handover: actually send Handover Detect
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/9673/1/bsc/MSC_ConnectionHandler.ttcn
File bsc/MSC_ConnectionHandler.ttcn:

https://gerrit.osmocom.org/#/c/9673/1/bsc/MSC_ConnectionHandler.ttcn@861
PS1, Line 861: template (value) RSL_Message ts_RSL_HANDO_DET(template (value) 
RslChannelNr chan_nr) := {
this should go to RSL_Types.ttcn like all other RSLtemplates



--
To view, visit https://gerrit.osmocom.org/9673
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
Gerrit-Change-Number: 9673
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Mon, 18 Jun 2018 08:12:19 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in openbsc[master]: bsc-nat: Fix missing help description for -T timestamp cmdline option

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9641 )

Change subject: bsc-nat: Fix missing help description for -T timestamp cmdline 
option
..

bsc-nat: Fix missing help description for -T timestamp cmdline option

Change-Id: I6a6fc3574630c0893797388bbbdeabe14572f988
---
M openbsc/src/osmo-bsc_nat/bsc_nat.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c 
b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index e912f60..a9f1c0b 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1464,6 +1464,7 @@
printf("  -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable 
debugging\n");
printf("  -D --daemonize Fork the process into a background daemon\n");
printf("  -s --disable-color\n");
+   printf("  -T --timestamp. Print a timestamp in the debug output.\n");
printf("  -c --config-file filename The config file to use.\n");
printf("  -m --msc=IP. The address of the MSC.\n");
printf("  -l --local=IP. The local address of this BSC.\n");

--
To view, visit https://gerrit.osmocom.org/9641
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6a6fc3574630c0893797388bbbdeabe14572f988
Gerrit-Change-Number: 9641
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in openbsc[master]: bsc-nat: Add -V param to print version

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9642 )

Change subject: bsc-nat: Add -V param to print version
..

bsc-nat: Add -V param to print version

Change-Id: I4dbf97905749aa9379bc6b6b448953d8b1825545
---
M openbsc/src/osmo-bsc_nat/bsc_nat.c
1 file changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c 
b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index a9f1c0b..ba7f542 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1465,6 +1465,7 @@
printf("  -D --daemonize Fork the process into a background daemon\n");
printf("  -s --disable-color\n");
printf("  -T --timestamp. Print a timestamp in the debug output.\n");
+   printf("  -V --version. Print the version of OsmoBSCNAT.\n");
printf("  -c --config-file filename The config file to use.\n");
printf("  -m --msc=IP. The address of the MSC.\n");
printf("  -l --local=IP. The local address of this BSC.\n");
@@ -1481,12 +1482,13 @@
{"config-file", 1, 0, 'c'},
{"disable-color", 0, 0, 's'},
{"timestamp", 0, 0, 'T'},
+   {"version", 0, 0, 'V' },
{"msc", 1, 0, 'm'},
{"local", 1, 0, 'l'},
{0, 0, 0, 0}
};

-   c = getopt_long(argc, argv, "hd:sTPc:m:l:D",
+   c = getopt_long(argc, argv, "hd:sTVPc:m:l:D",
long_options, _index);
if (c == -1)
break;
@@ -1511,6 +1513,10 @@
case 'T':
log_set_print_timestamp(osmo_stderr_target, 1);
break;
+   case 'V':
+   print_version(1);
+   exit(0);
+   break;
case 'm':
msc_ip = optarg;
break;

--
To view, visit https://gerrit.osmocom.org/9642
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4dbf97905749aa9379bc6b6b448953d8b1825545
Gerrit-Change-Number: 9642
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in openbsc[master]: bsc-sccplite: Add -V param to print version

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9643 )

Change subject: bsc-sccplite: Add -V param to print version
..

bsc-sccplite: Add -V param to print version

Change-Id: Iad663d36d70196408806de664a39863f4d12238b
---
M openbsc/src/osmo-bsc/osmo_bsc_main.c
1 file changed, 7 insertions(+), 1 deletion(-)

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



diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c 
b/openbsc/src/osmo-bsc/osmo_bsc_main.c
index 022cd3d..be24cbd 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_main.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c
@@ -81,6 +81,7 @@
printf("  -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM enable 
debugging\n");
printf("  -s --disable-color\n");
printf("  -T --timestamp. Print a timestamp in the debug output.\n");
+   printf("  -V --version. Print the version of OsmoBSC.\n");
printf("  -c --config-file filename The config file to use.\n");
printf("  -l --local=IP. The local address of the MGCP.\n");
printf("  -e --log-level number. Set a global loglevel.\n");
@@ -99,6 +100,7 @@
{"config-file", 1, 0, 'c'},
{"disable-color", 0, 0, 's'},
{"timestamp", 0, 0, 'T'},
+   {"version", 0, 0, 'V' },
{"local", 1, 0, 'l'},
{"log-level", 1, 0, 'e'},
{"rf-ctl", 1, 0, 'r'},
@@ -106,7 +108,7 @@
{0, 0, 0, 0}
};

-   c = getopt_long(argc, argv, "hd:DsTc:e:r:t",
+   c = getopt_long(argc, argv, "hd:DsTVc:e:r:t",
long_options, _index);
if (c == -1)
break;
@@ -131,6 +133,10 @@
case 'T':
log_set_print_timestamp(osmo_stderr_target, 1);
break;
+   case 'V':
+   print_version(1);
+   exit(0);
+   break;
case 'e':
log_set_log_level(osmo_stderr_target, atoi(optarg));
break;

--
To view, visit https://gerrit.osmocom.org/9643
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iad663d36d70196408806de664a39863f4d12238b
Gerrit-Change-Number: 9643
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


Change in openbsc[master]: gsm0408_dispatch: Fix uninitialized var warning

2018-06-18 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9640 )

Change subject: gsm0408_dispatch: Fix uninitialized var warning
..

gsm0408_dispatch: Fix uninitialized var warning

Got this warning since my upgrade to gcc 8.1.0. Quick check tells me
it's probably a false positive, but let's fix the warning anyway.

openbsc/openbsc/src/libmsc/gsm_04_08.c: In function ‘gsm0408_dispatch’:
openbsc/openbsc/src/libmsc/gsm_04_08.c:1260:5: error: ‘res_len’ may be used 
uninitialized in this function [-Werror=maybe-uninitialized]
  if (res_len != 4) {
 ^
openbsc/openbsc/src/libmsc/gsm_04_08.c:1223:10: note: ‘res_len’ was declared 
here
  uint8_t res_len;
  ^~~

Change-Id: Ifa45f73645c9ab022c18a012abe03214aa21526f
---
M openbsc/src/libmsc/gsm_04_08.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 006de7f..09e35cc 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -1220,7 +1220,7 @@
 {
struct gsm_network *net = conn->network;
uint8_t res[16];
-   uint8_t res_len;
+   uint8_t res_len = 0;
int rc;
bool is_r99;


--
To view, visit https://gerrit.osmocom.org/9640
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa45f73645c9ab022c18a012abe03214aa21526f
Gerrit-Change-Number: 9640
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol