Change in osmo-mgw[master]: generate shorter 'I:' conn IDs

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10676 )

Change subject: generate shorter 'I:' conn IDs
..


Patch Set 3:

The previous patch indeed affected the maximum length that even 
libosmo-mgcp-client was able to handle. Instead, I have revisited the conn id 
code and put various unit tests in place (and fixed a few bugs). Now this patch 
clearly changes only the generated id.


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia290c22a91fca0e5aa44515fca6df00064aff100
Gerrit-Change-Number: 10676
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 03 Sep 2018 21:15:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-mgw[master]: mgcp_verify_ci(): return meaningful error codes

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10753


Change subject: mgcp_verify_ci(): return meaningful error codes
..

mgcp_verify_ci(): return meaningful error codes

Instead of just -1, return RFC3435 error codes that can be used to compose a
FAIL message response. Note that the return value stays compatible in that it
returns 0 on a valid Connection Identifier, nonzero otherwise.

The idea is to be able to distinguish between "Conn ID not found" and "Conn ID
invalid" in mgcp_test.c's expected output, in upcoming change
I8d6cc96be252bb486e94f343a8c7cae641ff9429.

Change-Id: Ifc17f2893cc4b9a865f3ffcb9888bbf1039337a6
---
M src/libosmo-mgcp/mgcp_msg.c
M src/libosmo-mgcp/mgcp_protocol.c
2 files changed, 12 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/53/10753/1

diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index c4e66ff..f732158 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -430,16 +430,19 @@
 /*! Check if the specified connection id seems plausible.
   * \param[in] endp pointer to endpoint
   * \param{in] connection id to verify
-  * \returns 0 when connection id is valid and exists, nozero on error.
+  * \returns 0 when connection id is valid and exists, an RFC3435 error code 
on error.
   */
 int mgcp_verify_ci(struct mgcp_endpoint *endp, const char *conn_id)
 {
+   /* For invalid conn_ids, return 510 "The transaction could not be 
executed, because some
+* unspecified protocol error was detected." */
+
/* Check for null identifiers */
if (!conn_id) {
LOGP(DLMGCP, LOGL_ERROR,
 "endpoint:0x%x invalid ConnectionIdentifier (missing)\n",
 ENDPOINT_NUMBER(endp));
-   return -1;
+   return 510;
}

/* Check for empty connection identifiers */
@@ -447,7 +450,7 @@
LOGP(DLMGCP, LOGL_ERROR,
 "endpoint:0x%x invalid ConnectionIdentifier (empty)\n",
 ENDPOINT_NUMBER(endp));
-   return -1;
+   return 510;
}

/* Check for over long connection identifiers */
@@ -455,7 +458,7 @@
LOGP(DLMGCP, LOGL_ERROR,
 "endpoint:0x%x invalid ConnectionIdentifier (too long) 
0x%s\n",
 ENDPOINT_NUMBER(endp), conn_id);
-   return -1;
+   return 510;
}

/* Check if connection exists */
@@ -466,7 +469,9 @@
 "endpoint:0x%x no connection found under ConnectionIdentifier 
0x%s\n",
 ENDPOINT_NUMBER(endp), conn_id);

-   return -1;
+   /* When the conn_id was not found, return error code 515 "The 
transaction refers to an incorrect
+* connection-id (may have been already deleted)." */
+   return 515;
 }

 /*! Extract individual lines from MCGP message.
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 7f4a7b8..bc191b5 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -999,10 +999,8 @@
break;
case 'I':
conn_id = (const char *)line + 3;
-   if (mgcp_verify_ci(endp, conn_id) != 0) {
-   error_code = 515;
+   if ((error_code = mgcp_verify_ci(endp, conn_id)))
goto error3;
-   }
break;
case 'L':
local_options = (const char *)line + 3;
@@ -1185,10 +1183,8 @@
break;
case 'I':
conn_id = (const char *)line + 3;
-   if (mgcp_verify_ci(endp, conn_id) != 0) {
-   error_code = 515;
+   if ((error_code = mgcp_verify_ci(endp, conn_id)))
goto error3;
-   }
break;
case 'Z':
silent = strcmp("noanswer", line + 3) == 0;

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc17f2893cc4b9a865f3ffcb9888bbf1039337a6
Gerrit-Change-Number: 10753
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: mgcp_client_test: cosmetically re-arrange reply_to() args

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10746


Change subject: mgcp_client_test: cosmetically re-arrange reply_to() args
..

mgcp_client_test: cosmetically re-arrange reply_to() args

I want to test arbitrary length Conn IDs ('I:'), and hence don't want to pass
the conn_id as int, but rather just include it in the message string. Prepare
for that by eliminating the extra conn_id arg and just pass a params string.

Change-Id: Ib2e718dda3aa1f6e9979dee823d973dd002e2318
---
M tests/mgcp_client/mgcp_client_test.c
1 file changed, 6 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/10746/1

diff --git a/tests/mgcp_client/mgcp_client_test.c 
b/tests/mgcp_client/mgcp_client_test.c
index 2662fc1..84ba3b4 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -77,14 +77,14 @@
 struct mgcp_client *mgcp = NULL;

 static int reply_to(mgcp_trans_id_t trans_id, int code, const char *comment,
-int conn_id, const char *params)
+   const char *params)
 {
static char compose[4096 - 128];
int len;

len = snprintf(compose, sizeof(compose),
-  "%d %u %s\r\nI: %d\n\n%s",
-  code, trans_id, comment, conn_id, params);
+  "%d %u %s\r\n%s",
+  code, trans_id, comment, params);
OSMO_ASSERT(len < sizeof(compose));
OSMO_ASSERT(len > 0);

@@ -148,7 +148,8 @@
msg = mgcp_msg_crcx(mgcp, 23, 42, MGCP_CONN_LOOPBACK);
trans_id = dummy_mgcp_send(msg);

-   reply_to(trans_id, 200, "OK", 1,
+   reply_to(trans_id, 200, "OK",
+   "I: 1\n\n"
"v=0\r\n"
"o=- 1 23 IN IP4 10.9.1.120\r\n"
"s=-\r\n"
@@ -335,7 +336,7 @@
OSMO_ASSERT(mgcp_client_cancel(mgcp, trans_id) == 0);

fprintf(stderr, "- late response gets discarded\n");
-   OSMO_ASSERT(reply_to(trans_id, 200, "OK", 1, "v=0\r\n") == -ENOENT);
+   OSMO_ASSERT(reply_to(trans_id, 200, "OK", "I: 1\n\nv=0\r\n") == 
-ENOENT);

fprintf(stderr, "- canceling again does nothing\n");
OSMO_ASSERT(mgcp_client_cancel(mgcp, trans_id) == -ENOENT);

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2e718dda3aa1f6e9979dee823d973dd002e2318
Gerrit-Change-Number: 10746
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: mgcp_conn_get(): compare conn Id ('I:') case insensitively

2018-09-03 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10677

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

Change subject: mgcp_conn_get(): compare conn Id ('I:') case insensitively
..

mgcp_conn_get(): compare conn Id ('I:') case insensitively

The Connection Identifier is defined as a hex string, so clients may send the
ID back in lower case. Convert to upper case before comparing.

A specific SCCPlite MSC is observed to DLCX with Connection Identifier in lower
case, which would mismatch pefore this patch.

Add test_conn_id_matching() in mgcp_test.c to verify case insensitivity.

Cosmetic: use strcmp(), not strncmp(). In the presence of a terminating nul as
we can assume here, this makes no functional difference, but it clarifies the
code.

Related: OS#3508
Change-Id: I8e52278c3abe9e9c8c848c2b1538bce443f68a43
---
M src/libosmo-mgcp/mgcp_conn.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 57 insertions(+), 1 deletion(-)


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8e52278c3abe9e9c8c848c2b1538bce443f68a43
Gerrit-Change-Number: 10677
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-mgw[master]: mgcp_client: error on too long conn id

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10750


Change subject: mgcp_client: error on too long conn id
..

mgcp_client: error on too long conn id

Instead of just silently truncating the conn ID if it is too long, rather
verify its length and return an error where applicable.

Adjust expected test output.

Change-Id: If2a1aab1f13e771a6705c430e3c75bd42477a23b
---
M src/libosmo-mgcp-client/mgcp_client.c
M tests/mgcp_client/mgcp_client_test.err
M tests/mgcp_client/mgcp_client_test.ok
3 files changed, 11 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/10750/1

diff --git a/src/libosmo-mgcp-client/mgcp_client.c 
b/src/libosmo-mgcp-client/mgcp_client.c
index e9d7b3f..2a8cc15 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -550,6 +550,7 @@
 char label, const char *line)
 {
char label_string[4];
+   size_t rc;

/* Detect empty parameters */
if (strlen(line) < 4)
@@ -562,7 +563,14 @@

/* Copy payload part of the string to destinations (the label string
 * is always 3 chars long) */
-   osmo_strlcpy(result, line + 3, result_len);
+   rc = osmo_strlcpy(result, line + 3, result_len);
+   if (rc >= result_len) {
+   LOGP(DLMGCP, LOGL_ERROR,
+"Failed to parse MGCP response (parameter label: %c):"
+" the received conn ID is too long: %zu, maximum is %u 
characters\n",
+label, rc, result_len - 1);
+   return -ENOSPC;
+   }
return 0;

 response_parse_failure:
diff --git a/tests/mgcp_client/mgcp_client_test.err 
b/tests/mgcp_client/mgcp_client_test.err
index 1d5a1a0..b20f93f 100644
--- a/tests/mgcp_client/mgcp_client_test.err
+++ b/tests/mgcp_client/mgcp_client_test.err
@@ -66,4 +66,6 @@
 DLMGCP ptmap contains illegal mapping: codec=0 maps to pt=100
 DLMGCP ptmap contains illegal mapping: codec=113 maps to pt=2
 DLMGCP ptmap contains illegal mapping: codec=0 maps to pt=100
+DLMGCP Failed to parse MGCP response (parameter label: I): the received conn 
ID is too long: 39, maximum is 32 characters
+DLMGCP Cannot parse MGCP response (head parameters)
 Done
diff --git a/tests/mgcp_client/mgcp_client_test.ok 
b/tests/mgcp_client/mgcp_client_test.ok
index aedb247..40e32ba 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -264,20 +264,4 @@
 a=ptime:20

 -
-response cb received:
-  head.response_code = 200
-  head.trans_id = 1
-  head.conn_id = 123456789abcdef0123456789ABCDEF0
-  head.comment = OK
-  audio_port = 16002
-  audio_ip = 10.9.1.120
-  ptime = 20
-  codecs_len = 2
-  codecs[0] = 112
-  codecs[1] = 110
-  ptmap_len = 2
-  ptmap[0].codec = 112
-  ptmap[0].pt = 110
-  ptmap[1].codec = 110
-  ptmap[1].pt = 96
 Done

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If2a1aab1f13e771a6705c430e3c75bd42477a23b
Gerrit-Change-Number: 10750
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: fix mgcp_verify_ci(): off-by-one in max len check

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10754


Change subject: fix mgcp_verify_ci(): off-by-one in max len check
..

fix mgcp_verify_ci(): off-by-one in max len check

MGCP_CONN_ID_MAXLEN actually includes a terminating nul, so we need to compare
strlen() against MGCP_CONN_ID_MAXLEN-1.

Log the length if it is too long.

Add MDCX_TOO_LONG_CI test to mgcp_test.c, testing a conn id of 33 characters.
Before this patch, the test returns error code 515 meaning "not found", while
now it returns 510 meaning "invalid", showing the off-by-one. Same is
illustrated by the error log ("not found" before, "too long" now), but the
error log is not verified by mgcp_test.c.

Change-Id: I8d6cc96be252bb486e94f343a8c7cae641ff9429
---
M src/libosmo-mgcp/mgcp_msg.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 23 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/54/10754/1

diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index f732158..648d86b 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -454,10 +454,10 @@
}

/* Check for over long connection identifiers */
-   if (strlen(conn_id) > MGCP_CONN_ID_MAXLEN) {
+   if (strlen(conn_id) > (MGCP_CONN_ID_MAXLEN-1)) {
LOGP(DLMGCP, LOGL_ERROR,
-"endpoint:0x%x invalid ConnectionIdentifier (too long) 
0x%s\n",
-ENDPOINT_NUMBER(endp), conn_id);
+"endpoint:0x%x invalid ConnectionIdentifier (too long: %zu 
> %d) 0x%s\n",
+ENDPOINT_NUMBER(endp), strlen(conn_id), 
MGCP_CONN_ID_MAXLEN-1, conn_id);
return 510;
}

diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 2f3a8a7..c40eabc 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -230,6 +230,12 @@
"I: %s\r\n" \
"L: p:20, a:AMR, nt:IN\r\n"

+#define MDCX_TOO_LONG_CI \
+   "MDCX 18983222 1@mgw MGCP 1.0\r\n" \
+   "I: 123456789012345678901234567890123\n"
+
+#define MDCX_TOO_LONG_CI_RET "510 18983222 FAIL\r\n"
+
 #define SHORT2 "CRCX 1"
 #define SHORT2_RET "510 00 FAIL\r\n"
 #define SHORT3 "CRCX 1 1@mgw"
@@ -510,6 +516,7 @@
{"DLCX", DLCX, DLCX_RET, PTYPE_IGNORE,.extra_fmtp = "a=fmtp:126 0/1/2"},
{"CRCX", CRCX_NO_LCO_NO_SDP, CRCX_NO_LCO_NO_SDP_RET, 97},
{"CRCX", CRCX_X_OSMO_IGN, CRCX_X_OSMO_IGN_RET, 97},
+   {"MDCX_TOO_LONG_CI", MDCX_TOO_LONG_CI, MDCX_TOO_LONG_CI_RET},
 };

 static const struct mgcp_test retransmit[] = {
diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok
index 915d45e..ddda751 100644
--- a/tests/mgcp/mgcp_test.ok
+++ b/tests/mgcp/mgcp_test.ok
@@ -443,6 +443,19 @@
 Dummy packets: 2

 
+Testing MDCX_TOO_LONG_CI
+creating message from statically defined input:
+-8<-
+MDCX 18983222 1@mgw MGCP 1.0
+I: 123456789012345678901234567890123
+
+-8<-
+checking response:
+using message as statically defined for comparison
+Response matches our expectations.
+(response does not contain a connection id)
+
+
 Testing CRCX
 creating message from statically defined input:
 -8<-

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8d6cc96be252bb486e94f343a8c7cae641ff9429
Gerrit-Change-Number: 10754
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: generate shorter 'I:' conn IDs

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10676 )

Change subject: generate shorter 'I:' conn IDs
..


Set Ready For Review


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia290c22a91fca0e5aa44515fca6df00064aff100
Gerrit-Change-Number: 10676
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 03 Sep 2018 21:13:57 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-mgw[master]: doc: fix mgcp_verify_ci() return val doc

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10752


Change subject: doc: fix mgcp_verify_ci() return val doc
..

doc: fix mgcp_verify_ci() return val doc

Match the '\returns' doc to the actual implementation.

Change-Id: I6f89abd56ffcda8ba0276db1bc3381fa372e35a4
---
M src/libosmo-mgcp/mgcp_msg.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/52/10752/1

diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 49d0380..c4e66ff 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -430,7 +430,8 @@
 /*! Check if the specified connection id seems plausible.
   * \param[in] endp pointer to endpoint
   * \param{in] connection id to verify
-  * \returns 1 when connection id seems plausible, 0 on error */
+  * \returns 0 when connection id is valid and exists, nozero on error.
+  */
 int mgcp_verify_ci(struct mgcp_endpoint *endp, const char *conn_id)
 {
/* Check for null identifiers */

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f89abd56ffcda8ba0276db1bc3381fa372e35a4
Gerrit-Change-Number: 10752
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: mgcp_client_test: use "\r\n\r\n" instead of "\n\n"

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10747


Change subject: mgcp_client_test: use "\r\n\r\n" instead of "\n\n"
..

mgcp_client_test: use "\r\n\r\n" instead of "\n\n"

The separator between MGCP and SDP section is typically "\r\n\r\n". For some
reason the test so far used "\n\n" instead, rather use the standard separator.

Change-Id: I41c73722e5fae00663bcf96de0b57b7155809a06
---
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.ok
2 files changed, 6 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/47/10747/1

diff --git a/tests/mgcp_client/mgcp_client_test.c 
b/tests/mgcp_client/mgcp_client_test.c
index 84ba3b4..4e7e0a7 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -149,7 +149,7 @@
trans_id = dummy_mgcp_send(msg);

reply_to(trans_id, 200, "OK",
-   "I: 1\n\n"
+   "I: 1\r\n\r\n"
"v=0\r\n"
"o=- 1 23 IN IP4 10.9.1.120\r\n"
"s=-\r\n"
@@ -336,7 +336,7 @@
OSMO_ASSERT(mgcp_client_cancel(mgcp, trans_id) == 0);

fprintf(stderr, "- late response gets discarded\n");
-   OSMO_ASSERT(reply_to(trans_id, 200, "OK", "I: 1\n\nv=0\r\n") == 
-ENOENT);
+   OSMO_ASSERT(reply_to(trans_id, 200, "OK", "I: 1\r\n\r\nv=0\r\n") == 
-ENOENT);

fprintf(stderr, "- canceling again does nothing\n");
OSMO_ASSERT(mgcp_client_cancel(mgcp, trans_id) == -ENOENT);
diff --git a/tests/mgcp_client/mgcp_client_test.ok 
b/tests/mgcp_client/mgcp_client_test.ok
index 58c4b82..4b1e78c 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -11,8 +11,8 @@
 composed response:
 -
 200 1 OK
-I: 1
-
+I: 1
+
 v=0
 o=- 1 23 IN IP4 10.9.1.120
 s=-
@@ -141,8 +141,8 @@
 composed response:
 -
 200 1 OK
-I: 1
-
+I: 1
+
 v=0

 -

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I41c73722e5fae00663bcf96de0b57b7155809a06
Gerrit-Change-Number: 10747
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: mgcp_conn_get(): match conn Id ('I:') despite leading zeros

2018-09-03 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10678

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

Change subject: mgcp_conn_get(): match conn Id ('I:') despite leading zeros
..

mgcp_conn_get(): match conn Id ('I:') despite leading zeros

The Connection Identifier is defined as a hex string, so clients may send the
ID back with or without leading zeros. Ignore all leading zeros when comparing.

A specific SCCPlite MSC is observed to DLCX with Connection Identifier with
leading zeros removed, which would mismatch pefore this patch.

Extend test_conn_id_matching() in mgcp_test.c to include leading zero tests.

Related: OS#3509
Change-Id: If55a64a2da47b6eff035711c08e4114d70dbec91
---
M src/libosmo-mgcp/mgcp_conn.c
M tests/mgcp/mgcp_test.c
M tests/mgcp/mgcp_test.ok
3 files changed, 21 insertions(+), 1 deletion(-)


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If55a64a2da47b6eff035711c08e4114d70dbec91
Gerrit-Change-Number: 10678
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-mgw[master]: mgcp_client_test: also verify received conn_id

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10748


Change subject: mgcp_client_test: also verify received conn_id
..

mgcp_client_test: also verify received conn_id

Include the parsed conn_id in the response cb printout to verify them in
mgcp_client_test.ok.

Change-Id: I6b9b18d4d0867febd75a4d29f8a2fcdf0553ae4c
---
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.ok
2 files changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/48/10748/1

diff --git a/tests/mgcp_client/mgcp_client_test.c 
b/tests/mgcp_client/mgcp_client_test.c
index 4e7e0a7..74ed53e 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -102,6 +102,7 @@
printf("response cb received:\n");
printf("  head.response_code = %d\n", response->head.response_code);
printf("  head.trans_id = %u\n", response->head.trans_id);
+   printf("  head.conn_id = %s\n", response->head.conn_id);
printf("  head.comment = %s\n", response->head.comment);
printf("  audio_port = %u\n", response->audio_port);
printf("  audio_ip = %s\n", response->audio_ip);
diff --git a/tests/mgcp_client/mgcp_client_test.ok 
b/tests/mgcp_client/mgcp_client_test.ok
index 4b1e78c..5e14219 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -27,6 +27,7 @@
 response cb received:
   head.response_code = 200
   head.trans_id = 1
+  head.conn_id = 1
   head.comment = OK
   audio_port = 16002
   audio_ip = 10.9.1.120

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b9b18d4d0867febd75a4d29f8a2fcdf0553ae4c
Gerrit-Change-Number: 10748
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: mgcp_common: rename to MGCP_CONN_ID_MAXLEN

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10751


Change subject: mgcp_common: rename to MGCP_CONN_ID_MAXLEN
..

mgcp_common: rename to MGCP_CONN_ID_MAXLEN

So far, MGCP_CONN_ID_LENGTH was often used as exactly the length of the
Connection Identifier. To indicate this length as a maximum, introduce the
MGCP_CONN_ID_MAXLEN and use it everywhere. Keep the old name as an alias.

Change-Id: I1117003c7614e98535d5c201d002e459c01bdc3f
---
M include/osmocom/mgcp/mgcp_common.h
M include/osmocom/mgcp/mgcp_internal.h
M include/osmocom/mgcp_client/mgcp_client.h
M src/libosmo-mgcp-client/mgcp_client_fsm.c
M src/libosmo-mgcp/mgcp_conn.c
M src/libosmo-mgcp/mgcp_msg.c
6 files changed, 11 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/51/10751/1

diff --git a/include/osmocom/mgcp/mgcp_common.h 
b/include/osmocom/mgcp/mgcp_common.h
index b2c7370..a658f1c 100644
--- a/include/osmocom/mgcp/mgcp_common.h
+++ b/include/osmocom/mgcp/mgcp_common.h
@@ -79,9 +79,12 @@
 /* Maximum length of the comment field */
 #define MGCP_COMMENT_MAXLEN 256

-/* String length of Connection Identifiers
- * (see also RFC3435 2.1.3.2 Names of Connections) */
-#define MGCP_CONN_ID_LENGTH 32+1
+/* Maximum allowed String length of Connection Identifiers as per spec
+ * (see also RFC3435 2.1.3.2 Names of Connections), plus one for '\0'. */
+#define MGCP_CONN_ID_MAXLEN 32+1
+
+/* Deprecated: old name of MGCP_CONN_ID_MAXLEN. */
+#define MGCP_CONN_ID_LENGTH MGCP_CONN_ID_MAXLEN

 /* String length of Endpoint Identifiers.
 /  (see also RFC3435 section 3.2.1.3) */
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 06883dd..f75ae8b 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -226,7 +226,7 @@
enum mgcp_connection_mode mode_orig;

/*! connection id to identify the connection */
-   char id[MGCP_CONN_ID_LENGTH];
+   char id[MGCP_CONN_ID_MAXLEN];

/*! human readable name (vty, logging) */
char name[256];
diff --git a/include/osmocom/mgcp_client/mgcp_client.h 
b/include/osmocom/mgcp_client/mgcp_client.h
index 6c478e8..79f2078 100644
--- a/include/osmocom/mgcp_client/mgcp_client.h
+++ b/include/osmocom/mgcp_client/mgcp_client.h
@@ -60,7 +60,7 @@
int response_code;
mgcp_trans_id_t trans_id;
char comment[MGCP_COMMENT_MAXLEN];
-   char conn_id[MGCP_CONN_ID_LENGTH];
+   char conn_id[MGCP_CONN_ID_MAXLEN];
char endpoint[MGCP_ENDPOINT_MAXLEN];
 };

diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c 
b/src/libosmo-mgcp-client/mgcp_client_fsm.c
index 5368ec3..da900c5 100644
--- a/src/libosmo-mgcp-client/mgcp_client_fsm.c
+++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c
@@ -41,7 +41,7 @@
bool mgw_trans_pending;

/* Connection ID which has been assigned by he MGW */
-   char conn_id[MGCP_CONN_ID_LENGTH];
+   char conn_id[MGCP_CONN_ID_MAXLEN];

/* Local RTP connection info, the MGW will send outgoing traffic to the
 * ip/port specified here. The Address does not have to be choosen right
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 3a5db0f..2a45b81 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -78,7 +78,7 @@
/* ensure that the generated conn_id is unique
 * for this endpoint */
if (!mgcp_conn_get_rtp(endp, id_hex)) {
-   osmo_strlcpy(id, id_hex, MGCP_CONN_ID_LENGTH);
+   osmo_strlcpy(id, id_hex, MGCP_CONN_ID_MAXLEN);
return 0;
}
}
diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index a7c8b47..49d0380 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -450,7 +450,7 @@
}

/* Check for over long connection identifiers */
-   if (strlen(conn_id) > MGCP_CONN_ID_LENGTH) {
+   if (strlen(conn_id) > MGCP_CONN_ID_MAXLEN) {
LOGP(DLMGCP, LOGL_ERROR,
 "endpoint:0x%x invalid ConnectionIdentifier (too long) 
0x%s\n",
 ENDPOINT_NUMBER(endp), conn_id);

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1117003c7614e98535d5c201d002e459c01bdc3f
Gerrit-Change-Number: 10751
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 


Change in osmo-mgw[master]: mgcp_client_test: test long conn_id

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has uploaded this change for review. ( 
https://gerrit.osmocom.org/10749


Change subject: mgcp_client_test: test long conn_id
..

mgcp_client_test: test long conn_id

Add a full length (32 characters according to spec) conn ID in a CRCX response,
as well as a too long one.

The too long one is currently silently truncated, a subsequent patch will
improve on that (If2a1aab1f13e771a6705c430e3c75bd42477a23b).

Change-Id: I5f2d52f086ea2d330fcce88a176488ace972bf79
---
M tests/mgcp_client/mgcp_client_test.c
M tests/mgcp_client/mgcp_client_test.ok
2 files changed, 140 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/49/10749/1

diff --git a/tests/mgcp_client/mgcp_client_test.c 
b/tests/mgcp_client/mgcp_client_test.c
index 74ed53e..e6982e4 100644
--- a/tests/mgcp_client/mgcp_client_test.c
+++ b/tests/mgcp_client/mgcp_client_test.c
@@ -162,6 +162,60 @@
"a=ptime:20\r\n");
 }

+void test_crcx_long_conn_id(void)
+{
+   struct msgb *msg;
+   mgcp_trans_id_t trans_id;
+
+   printf("\n= %s =\n", __func__);
+
+   if (mgcp)
+   talloc_free(mgcp);
+   mgcp = mgcp_client_init(ctx, &conf);
+
+   msg = mgcp_msg_crcx(mgcp, 23, 42, MGCP_CONN_LOOPBACK);
+   trans_id = dummy_mgcp_send(msg);
+
+   reply_to(trans_id, 200, "OK",
+   "I: 123456789abcdef0123456789ABCDEF0\r\n\r\n"
+   "v=0\r\n"
+   "o=- 1 23 IN IP4 10.9.1.120\r\n"
+   "s=-\r\n"
+   "c=IN IP4 10.9.1.120\r\n"
+   "t=0 0\r\n"
+   "m=audio 16002 RTP/AVP 110 96\r\n"
+   "a=rtpmap:110 AMR/8000\r\n"
+   "a=rtpmap:96 GSM-EFR/8000\r\n"
+   "a=ptime:20\r\n");
+}
+
+void test_crcx_too_long_conn_id(void)
+{
+   struct msgb *msg;
+   mgcp_trans_id_t trans_id;
+
+   printf("\n= %s =\n", __func__);
+
+   if (mgcp)
+   talloc_free(mgcp);
+   mgcp = mgcp_client_init(ctx, &conf);
+
+   msg = mgcp_msg_crcx(mgcp, 23, 42, MGCP_CONN_LOOPBACK);
+   trans_id = dummy_mgcp_send(msg);
+
+   reply_to(trans_id, 200, "OK",
+   "I: 123456789abcdef0123456789ABCDEF01001029\r\n\r\n"
+   "v=0\r\n"
+   "o=- 1 23 IN IP4 10.9.1.120\r\n"
+   "s=-\r\n"
+   "c=IN IP4 10.9.1.120\r\n"
+   "t=0 0\r\n"
+   "m=audio 16002 RTP/AVP 110 96\r\n"
+   "a=rtpmap:110 AMR/8000\r\n"
+   "a=rtpmap:96 GSM-EFR/8000\r\n"
+   "a=ptime:20\r\n");
+}
+
 void test_mgcp_msg(void)
 {
struct msgb *msg;
@@ -570,6 +624,8 @@
test_sdp_section_start();
test_map_codec_to_pt_and_map_pt_to_codec();
test_map_pt_to_codec();
+   test_crcx_long_conn_id();
+   test_crcx_too_long_conn_id();

printf("Done\n");
fprintf(stderr, "Done\n");
diff --git a/tests/mgcp_client/mgcp_client_test.ok 
b/tests/mgcp_client/mgcp_client_test.ok
index 5e14219..aedb247 100644
--- a/tests/mgcp_client/mgcp_client_test.ok
+++ b/tests/mgcp_client/mgcp_client_test.ok
@@ -196,4 +196,88 @@
  2 <= 2
  100 <= 100

+
+= test_crcx_long_conn_id =
+composed:
+-
+CRCX 1 17@mgw MGCP 1.0
+C: 2a
+L: p:20, a:AMR, nt:IN
+M: loopback
+
+-
+composed response:
+-
+200 1 OK
+I: 123456789abcdef0123456789ABCDEF0
+
+v=0
+o=- 1 23 IN IP4 10.9.1.120
+s=-
+c=IN IP4 10.9.1.120
+t=0 0
+m=audio 16002 RTP/AVP 110 96
+a=rtpmap:110 AMR/8000
+a=rtpmap:96 GSM-EFR/8000
+a=ptime:20
+
+-
+response cb received:
+  head.response_code = 200
+  head.trans_id = 1
+  head.conn_id = 123456789abcdef0123456789ABCDEF0
+  head.comment = OK
+  audio_port = 16002
+  audio_ip = 10.9.1.120
+  ptime = 20
+  codecs_len = 2
+  codecs[0] = 112
+  codecs[1] = 110
+  ptmap_len = 2
+  ptmap[0].codec = 112
+  ptmap[0].pt = 110
+  ptmap[1].codec = 110
+  ptmap[1].pt = 96
+
+= test_crcx_too_long_conn_id =
+composed:
+-
+CRCX 1 17@mgw MGCP 1.0
+C: 2a
+L: p:20, a:AMR, nt:IN
+M: loopback
+
+-
+composed response:
+-
+200 1 OK
+I: 123456789abcdef0123456789ABCDEF01001029
+
+v=0
+o=- 1 23 IN IP4 10.9.1.120
+s=-
+c=IN IP4 10.9.1.120
+t=0 0
+m=audio 16002 RTP/AVP 110 96
+a=rtpmap:110 AMR/8000
+a=rtpmap:96 GSM-EFR/8000
+a=ptime:20
+
+-
+response cb received:
+  head.response_code = 200
+  head.trans_id = 1
+  head.conn_id = 123456789abcdef0123456789ABCDEF0
+  head.comment = OK
+  audio_port = 16002
+  audio_ip = 10.9.1.120
+  ptime = 20
+  codecs_len = 2
+  codecs[0] = 112
+  codecs[1] = 110
+  ptmap_len = 2
+  ptmap[0].codec = 112
+  ptmap[0].pt = 110
+  ptmap[1].codec = 110
+  ptmap[1].pt = 96
 Done

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f2d52f086ea2d330fcce8

Change in simtrace2[master]: stdio: fix detection of malformated format strings

2018-09-03 Thread Kévin Redon
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/10671

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

Change subject: stdio: fix detection of malformated format strings
..

stdio: fix detection of malformated format strings

the error code returned by vsnprintf was ignored,
resulting in printing the string from a previous print.

Change-Id: I8506b05d56da55d1357a1234917adf341b46e1db
---
M firmware/libcommon/source/stdio.c
1 file changed, 18 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/71/10671/2
--
To view, visit https://gerrit.osmocom.org/10671
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8506b05d56da55d1357a1234917adf341b46e1db
Gerrit-Change-Number: 10671
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 
Gerrit-CC: Harald Welte 
Gerrit-CC: Neels Hofmeyr 


Change in simtrace2[master]: stdio: fix detection of malformated format strings

2018-09-03 Thread Kévin Redon
Kévin Redon has posted comments on this change. ( 
https://gerrit.osmocom.org/10671 )

Change subject: stdio: fix detection of malformated format strings
..


Patch Set 1:

you are right. I misunderstood how the va_ macros work.


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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8506b05d56da55d1357a1234917adf341b46e1db
Gerrit-Change-Number: 10671
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 
Gerrit-CC: Harald Welte 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 03 Sep 2018 19:13:38 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: cosmetic: lchan activ: no need to clear mr again

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10699 )

Change subject: cosmetic: lchan activ: no need to clear mr again
..


Patch Set 1:

actually, I don't understand why this tiny patch is any concern at all. Can we 
get over this plz?


--
To view, visit https://gerrit.osmocom.org/10699
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: I8b38f222f1c8c822e8e5e776850dbc60e30e8b8d
Gerrit-Change-Number: 10699
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 18:54:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: cosmetic: lchan activ: no need to clear mr again

2018-09-03 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10699 )

Change subject: cosmetic: lchan activ: no need to clear mr again
..


Patch Set 1:

what? :)

Ok, to put it differently, if you see code like this:

  x.foo = {};
  x.bar = 1;
  x.baz = 5;
  memset(&x.foo, 0, sizeof(x.foo));

and you remove the final memset because x.foo was already cleared before, that 
for me constitutes a cosmetic code change. We can agree at least that there is 
absolutely no functional difference!?


--
To view, visit https://gerrit.osmocom.org/10699
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: I8b38f222f1c8c822e8e5e776850dbc60e30e8b8d
Gerrit-Change-Number: 10699
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 18:53:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: osmo-trx: Add osmo_signal to stop whole transceiver chain correctly o...

2018-09-03 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10743 )

Change subject: osmo-trx: Add osmo_signal to stop whole transceiver chain 
correctly on error
..


Patch Set 2:

(2 comments)

https://gerrit.osmocom.org/#/c/10743/2/CommonLibs/osmo_signal.h
File CommonLibs/osmo_signal.h:

https://gerrit.osmocom.org/#/c/10743/2/CommonLibs/osmo_signal.h@21
PS2, Line 21: /* Generic signalling/notification infrastructure */
Makes sense to move this line to the top, just before the
copyright statement as we do in other files.


https://gerrit.osmocom.org/#/c/10743/2/CommonLibs/osmo_signal.h@28
PS2, Line 28:  * Signalling subsystems
cosmetic: this is a single line comment



--
To view, visit https://gerrit.osmocom.org/10743
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: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
Gerrit-Change-Number: 10743
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 17:15:33 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: configure.ac: Specify default language as C++

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10745


Change subject: configure.ac: Specify default language as C++
..

configure.ac: Specify default language as C++

This is useful if we add more AC_CHECK_HEADER or similar configure tests 
including
C++ header files or required C++ features, since otherwise gcc is used
by default and test fail.

Change-Id: Iee757c78b72290c5d2a4c31339800a4e72b6be23
---
M configure.ac
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/45/10745/1

diff --git a/configure.ac b/configure.ac
index e1cc121..daa8677 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,7 @@
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AC_PATH_PROG([RM_PROG], [rm])
+AC_LANG([C++])

 dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
 AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee757c78b72290c5d2a4c31339800a4e72b6be23
Gerrit-Change-Number: 10745
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-trx[master]: cosmetic: Fix trailing whitespace

2018-09-03 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/10740

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

Change subject: cosmetic: Fix trailing whitespace
..

cosmetic: Fix trailing whitespace

Change-Id: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
---
M Transceiver52M/radioInterface.cpp
M Transceiver52M/radioInterface.h
M Transceiver52M/radioInterfaceMulti.cpp
3 files changed, 4 insertions(+), 4 deletions(-)


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
Gerrit-Change-Number: 10740
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Harald Welte 


Change in osmo-trx[master]: osmo-trx: Add osmo_signal to stop whole transceiver chain correctly o...

2018-09-03 Thread Pau Espin Pedrol
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10743

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

Change subject: osmo-trx: Add osmo_signal to stop whole transceiver chain 
correctly on error
..

osmo-trx: Add osmo_signal to stop whole transceiver chain correctly on error

Transceiver::stop() can only be called from either CTRL iface thread or
from main thread (running osmocom loop). That's because stop attempts to
cancel and then join all the other threads, which would then lock if
attempting to stop from some of them.
As a result, the best option is to indicate to the user of the
transceiver option (osmo-trx.cpp) to stop it in a correct fashion by
destroying the object from the main thread.

Change-Id: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
---
M CommonLibs/Makefile.am
A CommonLibs/osmo_signal.h
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/osmo-trx.cpp
5 files changed, 81 insertions(+), 2 deletions(-)


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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
Gerrit-Change-Number: 10743
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-trx[master]: osmo-trx: Add osmo_signal to stop whole transceiver chain correctly o...

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10743 )

Change subject: osmo-trx: Add osmo_signal to stop whole transceiver chain 
correctly on error
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/10743/1/Transceiver52M/Transceiver.cpp
File Transceiver52M/Transceiver.cpp:

https://gerrit.osmocom.org/#/c/10743/1/Transceiver52M/Transceiver.cpp@228
PS1, Line 228:   if(this->sig_cbfn)
> where does this coding style come from? if is not a function ,and even 
> existing code in this file do […]
that's one of my usual coding style typos, I'll fix them.



--
To view, visit https://gerrit.osmocom.org/10743
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: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
Gerrit-Change-Number: 10743
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 16:00:00 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: radioInterface: Fix variable storing integer return value

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10744 )

Change subject: radioInterface: Fix variable storing integer return value
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10744
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: I0a0a06a6d16a228cfcb7bd746bab2d79f10ce244
Gerrit-Change-Number: 10744
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:56:57 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: osmo-trx: Add osmo_signal to stop whole transceiver chain correctly o...

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10743 )

Change subject: osmo-trx: Add osmo_signal to stop whole transceiver chain 
correctly on error
..


Patch Set 1: Code-Review+1

(1 comment)

fine except for cosmetics

https://gerrit.osmocom.org/#/c/10743/1/Transceiver52M/Transceiver.cpp
File Transceiver52M/Transceiver.cpp:

https://gerrit.osmocom.org/#/c/10743/1/Transceiver52M/Transceiver.cpp@228
PS1, Line 228:   if(this->sig_cbfn)
where does this coding style come from? if is not a function ,and even existing 
code in this file doesn't seem to use this style? SCNR.



--
To view, visit https://gerrit.osmocom.org/10743
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: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
Gerrit-Change-Number: 10743
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:56:41 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: cosmetic: Fix trailing whitespace

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10740 )

Change subject: cosmetic: Fix trailing whitespace
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/10740/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/10740/1//COMMIT_MSG@7
PS1, Line 7: cosmetic: Fix trailing whitespace
> you're also moving the order of log / pthread related statements, I'm sure 
> this is on purpose?  Is t […]
Good catch, I actually though it was part of the trailing whitspace stuff while 
looking at the changes since I didn't see any line content being changed.

Since commit https://gerrit.osmocom.org/#/c/osmo-trx/+/10739/ comes before, 
this change doesn't really matter.



--
To view, visit https://gerrit.osmocom.org/10740
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: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
Gerrit-Change-Number: 10740
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:54:01 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: lms: Return error on device read timeout

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10742 )

Change subject: lms: Return error on device read timeout
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10742
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: Ib1af8cdd6cdadf581b039882add4049eea45a0f7
Gerrit-Change-Number: 10742
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:53:32 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: radioInterface: forward errors from RadioDevice to Transceiver in rec...

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10741 )

Change subject: radioInterface: forward errors from RadioDevice to Transceiver 
in recv path
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10741
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: Id7b08b19d6575c79b4d57db656a17ff05bb61ee9
Gerrit-Change-Number: 10741
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:52:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: Vector: Copy arrays in a sane wayfor non-trivially copyable types

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10721 )

Change subject: Vector: Copy arrays in a sane wayfor non-trivially copyable 
types
..


Patch Set 1:

Tested with osmo-trx-lms and a LimeSDR-usb, I could register and place a call 
without issues, sound looks fine.


--
To view, visit https://gerrit.osmocom.org/10721
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: I9724454dfb7b87f74f39074e4004580ac3b5fe5c
Gerrit-Change-Number: 10721
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:50:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: Vector: Copy arrays in a sane wayfor non-trivially copyable types

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10721 )

Change subject: Vector: Copy arrays in a sane wayfor non-trivially copyable 
types
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/10721
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: I9724454dfb7b87f74f39074e4004580ac3b5fe5c
Gerrit-Change-Number: 10721
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:50:39 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: cosmetic: Fix trailing whitespace

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10740 )

Change subject: cosmetic: Fix trailing whitespace
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/10740/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/10740/1//COMMIT_MSG@7
PS1, Line 7: cosmetic: Fix trailing whitespace
you're also moving the order of log / pthread related statements, I'm sure this 
is on purpose?  Is that still cosmetic? doesn't it deserve to be mentioned here?



--
To view, visit https://gerrit.osmocom.org/10740
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: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
Gerrit-Change-Number: 10740
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:50:30 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: radioInterfaceMulti:pullBuffer: Sanely convert float array to complex...

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10720 )

Change subject: radioInterfaceMulti:pullBuffer: Sanely convert float array to 
complex array
..


Patch Set 1:

Tested with osmo-trx-lms and a LimeSDR-usb, I could register and place a call 
without issues, sound looks fine.


--
To view, visit https://gerrit.osmocom.org/10720
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: Ibb2380a0a335ce798fe87221519fbbebade53054
Gerrit-Change-Number: 10720
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:50:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: radioInterfaceMulti:pullBuffer: Sanely convert float array to complex...

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10720 )

Change subject: radioInterfaceMulti:pullBuffer: Sanely convert float array to 
complex array
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/10720
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: Ibb2380a0a335ce798fe87221519fbbebade53054
Gerrit-Change-Number: 10720
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:50:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: Logger: Disable pthread cancel point inside Logger destructor

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10739 )

Change subject: Logger: Disable pthread cancel point inside Logger destructor
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/10739
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: I71ca90f3fbc73df58b878a03361f7b7831d838b4
Gerrit-Change-Number: 10739
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 15:48:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: osmo-trx: Add osmo_signal to stop whole transceiver chain correctly o...

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10743


Change subject: osmo-trx: Add osmo_signal to stop whole transceiver chain 
correctly on error
..

osmo-trx: Add osmo_signal to stop whole transceiver chain correctly on error

Transceiver::stop() can only be called from either CTRL iface thread or
from main thread (running osmocom loop). That's because stop attempts to
cancel and then join all the other threads, which would then lock if
attempting to stop from some of them.
As a result, the best option is to indicate to the user of the
transceiver option (osmo-trx.cpp) to stop it in a correct fashion by
destroying the object from the main thread.

Change-Id: Iac1d2dbe2328e735db2d4b933cb67b1af1babca1
---
M CommonLibs/Makefile.am
A CommonLibs/osmo_signal.h
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/osmo-trx.cpp
5 files changed, 81 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/43/10743/1

diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am
index 2332acb..3173397 100644
--- a/CommonLibs/Makefile.am
+++ b/CommonLibs/Makefile.am
@@ -49,4 +49,5 @@
Logger.h \
trx_vty.h \
debug.h \
+   osmo_signal.h \
config_defs.h
diff --git a/CommonLibs/osmo_signal.h b/CommonLibs/osmo_signal.h
new file mode 100644
index 000..4d201d3
--- /dev/null
+++ b/CommonLibs/osmo_signal.h
@@ -0,0 +1,37 @@
+/* (C) 2018 by sysmocom s.f.m.c. GmbH 
+ *
+ * Author: Pau Espin Pedrol 
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+/* Generic signalling/notification infrastructure */
+
+#pragma once
+
+#include 
+
+/*
+ * Signalling subsystems
+ */
+enum signal_subsystems {
+   SS_TRANSC,
+};
+
+/* SS_TRANSC signals */
+enum SS_TRANSC {
+   S_TRANSC_STOP_REQUIRED, /* Transceiver fatal error, it should be 
stopped */
+};
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index a1ebb30..d827adb 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -27,6 +27,10 @@
 #include "Transceiver.h"
 #include 

+extern "C" {
+#include "osmo_signal.h"
+}
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -115,7 +119,7 @@
   : mBasePort(wBasePort), mLocalAddr(TRXAddress), mRemoteAddr(GSMcoreAddress),
 mClockSocket(TRXAddress, wBasePort, GSMcoreAddress, wBasePort + 100),
 mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface),
-rssiOffset(wRssiOffset),
+rssiOffset(wRssiOffset), sig_cbfn(NULL),
 mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mEdge(false), mOn(false), 
mForceClockInterface(false),
 mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), 
mMaxExpectedDelayNB(0),
 mWriteBurstToDiskMask(0)
@@ -219,6 +223,17 @@
   return true;
 }

+void Transceiver::setSignalHandler(osmo_signal_cbfn cbfn)
+{
+  if(this->sig_cbfn)
+osmo_signal_unregister_handler(SS_TRANSC, this->sig_cbfn, NULL);
+
+  if(cbfn) {
+this->sig_cbfn = cbfn;
+osmo_signal_register_handler(SS_TRANSC, this->sig_cbfn, NULL);
+  }
+}
+
 /*
  * Start the transceiver
  *
@@ -885,8 +900,12 @@

 void Transceiver::driveReceiveRadio()
 {
-  if (!mRadioInterface->driveReceiveRadio()) {
+  int rc = mRadioInterface->driveReceiveRadio();
+  if (rc == 0) {
 usleep(10);
+  } else if (rc < 0) {
+LOG(FATAL) << "radio Interface receive failed, requesting stop.";
+osmo_signal_dispatch(SS_TRANSC, S_TRANSC_STOP_REQUIRED, this);
   } else if (mForceClockInterface || mTransmitDeadlineClock > 
mLastClockUpdateTime + GSM::Time(216,0)) {
 mForceClockInterface = false;
 writeClockInterface();
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index f9b54f0..e250adc 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -31,6 +31,7 @@
 #include 

 extern "C" {
+#include 
 #include "config_defs.h"
 }

@@ -128,6 +129,8 @@
   /** accessor for number of channels */
   size_t numChans() const { return mChans; };

+  void setSignalHandler(osmo_signal_cbfn cbfn);
+
   /** Codes for channel combinations */
   typedef enum {
 FILL,   ///< Channel is transmitted, but unused
@@ -177,6 +180,8 @@
 
   double rssiOffset;

Change in osmo-trx[master]: Logger: Disable pthread cancel point inside Logger destructor

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10739


Change subject: Logger: Disable pthread cancel point inside Logger destructor
..

Logger: Disable pthread cancel point inside Logger destructor

pthread_cancel is implemented in c++ using exception handlers. In
destructor of Log object, the log function is called which will
eventually call fputs() to write to a file. Since that function is
considered a cancelation point, if pthread_cancel has been called the
exception handler will start unstacking frames and calling destructors
in the process. At some point this will cause a runtime exception in c++
which will call std::terminate() to abort the process.

The solution is thus to avoid starting the cancellation process inside the
destructor.

This behavior was spotted while calling the destructor of Transceiver
object in forthcoming patches.

See a more detailed example here:
https://skaark.wordpress.com/2010/08/26/pthread_cancel-considered-harmful/

Change-Id: I71ca90f3fbc73df58b878a03361f7b7831d838b4
---
M CommonLibs/Logger.cpp
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/39/10739/1

diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp
index 393d882..171c635 100644
--- a/CommonLibs/Logger.cpp
+++ b/CommonLibs/Logger.cpp
@@ -44,6 +44,8 @@

 Log::~Log()
 {
+   int old_state;
+   pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_state);
int mlen = mStream.str().size();
int neednl = (mlen==0 || mStream.str()[mlen-1] != '\n');
const char *fmt = neednl ? "%s\n" : "%s";
@@ -51,6 +53,7 @@
// The COUT() macro prevents messages from stomping each other but adds 
uninteresting thread numbers,
// so just use std::cout.
LOGPSRC(mCategory, mPriority, filename, line, fmt, 
mStream.str().c_str());
+   pthread_setcancelstate(old_state, NULL);
 }

 ostringstream& Log::get()

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71ca90f3fbc73df58b878a03361f7b7831d838b4
Gerrit-Change-Number: 10739
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-trx[master]: radioInterface: Fix variable storing integer return value

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10744


Change subject: radioInterface: Fix variable storing integer return value
..

radioInterface: Fix variable storing integer return value

Change-Id: I0a0a06a6d16a228cfcb7bd746bab2d79f10ce244
---
M Transceiver52M/radioInterface.cpp
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/44/10744/1

diff --git a/Transceiver52M/radioInterface.cpp 
b/Transceiver52M/radioInterface.cpp
index b9c6672..7d6a03b 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -304,7 +304,8 @@
 int RadioInterface::pullBuffer()
 {
   bool local_underrun;
-  size_t numRecv, segmentLen = recvBuffer[0]->getSegmentLen();
+  int numRecv;
+  size_t segmentLen = recvBuffer[0]->getSegmentLen();

   if (recvBuffer[0]->getFreeSegments() <= 0)
 return -1;
@@ -316,7 +317,7 @@
 readTimestamp,
 &local_underrun);

-  if (numRecv != segmentLen) {
+  if ((size_t) numRecv != segmentLen) {
   LOG(ALERT) << "Receive error " << numRecv;
   return -1;
   }

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0a0a06a6d16a228cfcb7bd746bab2d79f10ce244
Gerrit-Change-Number: 10744
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-trx[master]: cosmetic: Fix trailing whitespace

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10740


Change subject: cosmetic: Fix trailing whitespace
..

cosmetic: Fix trailing whitespace

Change-Id: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/radioInterface.cpp
M Transceiver52M/radioInterface.h
M Transceiver52M/radioInterfaceMulti.cpp
4 files changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/40/10740/1

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 881cfb7..15d5929 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -562,8 +562,8 @@
*underrun = false;

for (i = 0; isetPriority(prio); }

-  /** get transport window type of attached device */ 
+  /** get transport window type of attached device */
   enum RadioDevice::TxWindowType getWindowType() { return 
mRadio->getWindowType(); }

   /** Minimum latency that the device can achieve */
diff --git a/Transceiver52M/radioInterfaceMulti.cpp 
b/Transceiver52M/radioInterfaceMulti.cpp
index 650fd85..b3add21 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -1,7 +1,7 @@
 /*
  * Multi-carrier radio interface
  *
- * Copyright (C) 2016 Ettus Research LLC
+ * Copyright (C) 2016 Ettus Research LLC
  *
  * Author: Tom Tsou 
  *

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia647cfed0acb35adeb9b3b7824170d06c0369ef7
Gerrit-Change-Number: 10740
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-trx[master]: radioInterface: forward errors from RadioDevice to Transceiver in rec...

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10741


Change subject: radioInterface: forward errors from RadioDevice to Transceiver 
in recv path
..

radioInterface: forward errors from RadioDevice to Transceiver in recv path

Change-Id: Id7b08b19d6575c79b4d57db656a17ff05bb61ee9
---
M Transceiver52M/radioInterface.cpp
M Transceiver52M/radioInterface.h
M Transceiver52M/radioInterfaceMulti.cpp
M Transceiver52M/radioInterfaceResamp.cpp
4 files changed, 22 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/41/10741/1

diff --git a/Transceiver52M/radioInterface.cpp 
b/Transceiver52M/radioInterface.cpp
index f74897f..b9c6672 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -218,14 +218,15 @@
   while (pushBuffer());
 }

-bool RadioInterface::driveReceiveRadio()
+int RadioInterface::driveReceiveRadio()
 {
   radioVector *burst = NULL;

   if (!mOn)
-return false;
+return 0;

-  pullBuffer();
+  if (pullBuffer() < 0)
+return  -1;

   GSM::Time rcvClock = mClock.get();
   rcvClock.decTN(receiveOffset);
@@ -270,7 +271,7 @@
   burstSize = (symbolsPerSlot + (tN % 4 == 0)) * mSPSRx;
   }

-  return true;
+  return 1;
 }

 bool RadioInterface::isUnderrun()
@@ -300,13 +301,13 @@
 }

 /* Receive a timestamped chunk from the device */
-void RadioInterface::pullBuffer()
+int RadioInterface::pullBuffer()
 {
   bool local_underrun;
   size_t numRecv, segmentLen = recvBuffer[0]->getSegmentLen();

   if (recvBuffer[0]->getFreeSegments() <= 0)
-return;
+return -1;

   /* Outer buffer access size is fixed */
   numRecv = mRadio->readSamples(convertRecvBuffer,
@@ -317,7 +318,7 @@

   if (numRecv != segmentLen) {
   LOG(ALERT) << "Receive error " << numRecv;
-  return;
+  return -1;
   }

   for (size_t i = 0; i < mChans; i++) {
@@ -328,6 +329,7 @@

   underrun |= local_underrun;
   readTimestamp += numRecv;
+  return 0;
 }

 /* Send timestamped chunk to the device with arbitrary size */
diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h
index 54ffc31..f19a8dc 100644
--- a/Transceiver52M/radioInterface.h
+++ b/Transceiver52M/radioInterface.h
@@ -71,7 +71,7 @@
   virtual bool pushBuffer(void);

   /** pull GSM bursts from the receive buffer */
-  virtual void pullBuffer(void);
+  virtual int pullBuffer(void);

 public:

@@ -116,8 +116,8 @@
   void driveTransmitRadio(std::vector &bursts,
   std::vector &zeros);

-  /** drive reception of GSM bursts */
-  bool driveReceiveRadio();
+  /** drive reception of GSM bursts. -1: Error. 0: Radio off. 1: Received 
something. */
+  int driveReceiveRadio();

   int setPowerAttenuation(int atten, size_t chan = 0);

@@ -149,7 +149,7 @@
   signalVector *outerRecvBuffer;

   bool pushBuffer();
-  void pullBuffer();
+  int pullBuffer();

 public:
   RadioInterfaceResamp(RadioDevice* wRadio, size_t tx_sps, size_t rx_sps);
@@ -162,7 +162,7 @@
 class RadioInterfaceMulti : public RadioInterface {
 private:
   bool pushBuffer();
-  void pullBuffer();
+  int pullBuffer();

   signalVector *outerSendBuffer;
   signalVector *outerRecvBuffer;
diff --git a/Transceiver52M/radioInterfaceMulti.cpp 
b/Transceiver52M/radioInterfaceMulti.cpp
index b3add21..67ccb25 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -225,14 +225,14 @@
 }

 /* Receive a timestamped chunk from the device */
-void RadioInterfaceMulti::pullBuffer()
+int RadioInterfaceMulti::pullBuffer()
 {
bool local_underrun;
size_t num;
float *buf;

if (recvBuffer[0]->getFreeSegments() <= 0)
-   return;
+   return -1;

/* Outer buffer access size is fixed */
num = mRadio->readSamples(convertRecvBuffer,
@@ -242,7 +242,7 @@
  &local_underrun);
if (num != channelizer->inputLen()) {
LOG(ALERT) << "Receive error " << num << ", " << 
channelizer->inputLen();
-   return;
+   return -1;
}

convert_short_float((float *) outerRecvBuffer->begin(),
@@ -288,6 +288,7 @@
LOG(ALERT) << "Sample rate upsampling error";
}
}
+   return 0;
 }

 /* Send a timestamped chunk to the device */
diff --git a/Transceiver52M/radioInterfaceResamp.cpp 
b/Transceiver52M/radioInterfaceResamp.cpp
index b0f799e..8ae4aa1 100644
--- a/Transceiver52M/radioInterfaceResamp.cpp
+++ b/Transceiver52M/radioInterfaceResamp.cpp
@@ -160,13 +160,13 @@
 }

 /* Receive a timestamped chunk from the device */
-void RadioInterfaceResamp::pullBuffer()
+int RadioInterfaceResamp::pullBuffer()
 {
bool local_underrun;
int rc, num_recv;

if (recvBuffer[0]->getFreeSegments() <= 0)
-   return;
+   return -1;


Change in osmo-trx[master]: lms: Return error on device read timeout

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10742


Change subject: lms: Return error on device read timeout
..

lms: Return error on device read timeout

If LImeSDR device is unplugged or its fw crashes during operation,
reading from the device will fail and will first receive short reads and
finally 0 byte reads. Let's quickly notify these events to upper layers
instead of trying to process the buffer and checking timestamps for
something we know it's already not useful.

Related: OS#3340
Change-Id: Ib1af8cdd6cdadf581b039882add4049eea45a0f7
---
M Transceiver52M/device/lms/LMSDevice.cpp
1 file changed, 5 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/42/10742/1

diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 15d5929..9ba5ce3 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -511,11 +511,13 @@
for (i = 0; i m_last_rx_underruns[i])

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib1af8cdd6cdadf581b039882add4049eea45a0f7
Gerrit-Change-Number: 10742
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-hlr[master]: libosmo-gsup-client: License is GPLv2-or-later

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10738 )

Change subject: libosmo-gsup-client: License is GPLv2-or-later
..

libosmo-gsup-client: License is GPLv2-or-later

Fix the unintentional AGPLv3-or-later license header in gsup_client.c

Change-Id: I6378bd59fdbe8d95cd6132a1cbc40ae29b558c42
---
M src/gsupclient/gsup_client.c
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c
index a7fdc5f..d34a22d 100644
--- a/src/gsupclient/gsup_client.c
+++ b/src/gsupclient/gsup_client.c
@@ -7,16 +7,16 @@
  * Author: Neels Hofmeyr
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU Affero General Public License
+ * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see .
  *
  */

--
To view, visit https://gerrit.osmocom.org/10738
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: I6378bd59fdbe8d95cd6132a1cbc40ae29b558c42
Gerrit-Change-Number: 10738
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-hlr[master]: libosmo-gsup-client: License is GPLv2-or-later

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10738 )

Change subject: libosmo-gsup-client: License is GPLv2-or-later
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10738
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: I6378bd59fdbe8d95cd6132a1cbc40ae29b558c42
Gerrit-Change-Number: 10738
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-CC: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 13:22:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: libosmo-gsup-client: License is GPLv2-or-later

2018-09-03 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/10738


Change subject: libosmo-gsup-client: License is GPLv2-or-later
..

libosmo-gsup-client: License is GPLv2-or-later

Fix the unintentional AGPLv3-or-later license header in gsup_client.c

Change-Id: I6378bd59fdbe8d95cd6132a1cbc40ae29b558c42
---
M src/gsupclient/gsup_client.c
1 file changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/38/10738/1

diff --git a/src/gsupclient/gsup_client.c b/src/gsupclient/gsup_client.c
index a7fdc5f..d34a22d 100644
--- a/src/gsupclient/gsup_client.c
+++ b/src/gsupclient/gsup_client.c
@@ -7,16 +7,16 @@
  * Author: Neels Hofmeyr
  *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU Affero General Public License
+ * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see .
  *
  */

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6378bd59fdbe8d95cd6132a1cbc40ae29b558c42
Gerrit-Change-Number: 10738
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-mgw[master]: debian/rules: Don't overwrite .tarball-version

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10351 )

Change subject: debian/rules: Don't overwrite .tarball-version
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4bf7b6124c747a0cff5562187a099c33525e109e
Gerrit-Change-Number: 10351
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 13:08:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Add RSPRO support to IPA and logging definitions

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10737 )

Change subject: Add RSPRO support to IPA and logging definitions
..

Add RSPRO support to IPA and logging definitions

Change-Id: Iee79f5273f32cb9ce4bd7a984e7f0625542e776f
---
M include/osmocom/core/logging.h
M include/osmocom/gsm/protocol/ipaccess.h
2 files changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 8464043..c60143d 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -122,7 +122,8 @@
 #define DLM3UA -16 /*!< Osmocom M3UA */
 #define DLMGCP -17 /*!< Osmocom MGCP */
 #define DLJIBUF-18 /*!< Osmocom Jitter Buffer */
-#define OSMO_NUM_DLIB  18  /*!< Number of logging sub-systems in libraries 
*/
+#define DLRSPRO-19 /*!< Osmocom Remote SIM Protocol */
+#define OSMO_NUM_DLIB  19  /*!< Number of logging sub-systems in libraries 
*/

 /*! Configuration of single log category / sub-system */
 struct log_category {
diff --git a/include/osmocom/gsm/protocol/ipaccess.h 
b/include/osmocom/gsm/protocol/ipaccess.h
index 0f5d54f..80413d1 100644
--- a/include/osmocom/gsm/protocol/ipaccess.h
+++ b/include/osmocom/gsm/protocol/ipaccess.h
@@ -38,6 +38,7 @@
IPAC_PROTO_EXT_ORC  = 0x04, /* OML Router Control */
IPAC_PROTO_EXT_GSUP = 0x05, /* GSUP GPRS extension */
IPAC_PROTO_EXT_OAP  = 0x06, /* Osmocom Authn Protocol */
+   IPAC_PROTO_EXT_RSPRO= 0x07, /* Remote SIM protocol */
 };

 enum ipaccess_msgtype {

--
To view, visit https://gerrit.osmocom.org/10737
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: Iee79f5273f32cb9ce4bd7a984e7f0625542e776f
Gerrit-Change-Number: 10737
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-mgw[master]: debian/rules: Don't overwrite .tarball-version

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10351 )

Change subject: debian/rules: Don't overwrite .tarball-version
..

debian/rules: Don't overwrite .tarball-version

The .tarball-version file should contain the *source version* uniquely
identifying the git commit, and not the Debian package name.

With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct
.tarball-version file in the .tar.xz of the nightly source packages.

Change-Id: I4bf7b6124c747a0cff5562187a099c33525e109e
Related: OS#3449
---
M debian/rules
1 file changed, 0 insertions(+), 4 deletions(-)

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



diff --git a/debian/rules b/debian/rules
index ae85e13..d13e426 100755
--- a/debian/rules
+++ b/debian/rules
@@ -29,8 +29,4 @@
 override_dh_auto_test:
dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)

-override_dh_autoreconf:
-   echo $(VERSION) > .tarball-version
-   dh_autoreconf
-
 # See 
https://www.debian.org/doc/manuals/developers-reference/best-pkging-practices.html#bpp-dbg

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4bf7b6124c747a0cff5562187a099c33525e109e
Gerrit-Change-Number: 10351
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: Add RSPRO support to IPA and logging definitions

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10737 )

Change subject: Add RSPRO support to IPA and logging definitions
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10737
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: Iee79f5273f32cb9ce4bd7a984e7f0625542e776f
Gerrit-Change-Number: 10737
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 03 Sep 2018 13:08:07 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Add RSPRO support to IPA and logging definitions

2018-09-03 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/10737


Change subject: Add RSPRO support to IPA and logging definitions
..

Add RSPRO support to IPA and logging definitions

Change-Id: Iee79f5273f32cb9ce4bd7a984e7f0625542e776f
---
M include/osmocom/core/logging.h
M include/osmocom/gsm/protocol/ipaccess.h
2 files changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/10737/1

diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 8464043..c60143d 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -122,7 +122,8 @@
 #define DLM3UA -16 /*!< Osmocom M3UA */
 #define DLMGCP -17 /*!< Osmocom MGCP */
 #define DLJIBUF-18 /*!< Osmocom Jitter Buffer */
-#define OSMO_NUM_DLIB  18  /*!< Number of logging sub-systems in libraries 
*/
+#define DLRSPRO-19 /*!< Osmocom Remote SIM Protocol */
+#define OSMO_NUM_DLIB  19  /*!< Number of logging sub-systems in libraries 
*/

 /*! Configuration of single log category / sub-system */
 struct log_category {
diff --git a/include/osmocom/gsm/protocol/ipaccess.h 
b/include/osmocom/gsm/protocol/ipaccess.h
index 0f5d54f..80413d1 100644
--- a/include/osmocom/gsm/protocol/ipaccess.h
+++ b/include/osmocom/gsm/protocol/ipaccess.h
@@ -38,6 +38,7 @@
IPAC_PROTO_EXT_ORC  = 0x04, /* OML Router Control */
IPAC_PROTO_EXT_GSUP = 0x05, /* GSUP GPRS extension */
IPAC_PROTO_EXT_OAP  = 0x06, /* Osmocom Authn Protocol */
+   IPAC_PROTO_EXT_RSPRO= 0x07, /* Remote SIM protocol */
 };

 enum ipaccess_msgtype {

--
To view, visit https://gerrit.osmocom.org/10737
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: Iee79f5273f32cb9ce4bd7a984e7f0625542e776f
Gerrit-Change-Number: 10737
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in libosmocore[master]: Add CC_CAUSE value_string array

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10732 )

Change subject: Add CC_CAUSE value_string array
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10732
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: I296f208581ce2550805f9d96e20f7319e1199023
Gerrit-Change-Number: 10732
Gerrit-PatchSet: 2
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 
Gerrit-Comment-Date: Mon, 03 Sep 2018 12:12:25 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sip-connector[master]: jenkins.sh: Use --enable-werror option

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10736 )

Change subject: jenkins.sh: Use --enable-werror option
..

jenkins.sh: Use --enable-werror option

Change-Id: I8cfad742e6ce766b022ecdf4c78495accc9405d0
---
M contrib/jenkins.sh
1 file changed, 1 insertion(+), 1 deletion(-)

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/contrib/jenkins.sh b/contrib/jenkins.sh
index 0b11ef3..00cd5ff 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -27,7 +27,7 @@
 set -x

 autoreconf --install --force
-./configure --enable-vty-tests --enable-external-tests
+./configure --enable-werror --enable-vty-tests --enable-external-tests
 $MAKE $PARALLEL_MAKE
 $MAKE check \
   || cat-testlogs.sh

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8cfad742e6ce766b022ecdf4c78495accc9405d0
Gerrit-Change-Number: 10736
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: Add CC_CAUSE value_string array

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10732 )

Change subject: Add CC_CAUSE value_string array
..

Add CC_CAUSE value_string array

Adds a value_string array for GSM 04.08 Call Control
cause values

Change-Id: I296f208581ce2550805f9d96e20f7319e1199023
---
M include/osmocom/gsm/protocol/gsm_04_08.h
M src/gsm/gsm48.c
M src/gsm/libosmogsm.map
3 files changed, 59 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h 
b/include/osmocom/gsm/protocol/gsm_04_08.h
index 4635014..e218295 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -1495,6 +1495,10 @@
GSM48_CC_CAUSE_INTERWORKING = 127,
 };

+extern const struct value_string gsm48_cc_cause_names[];
+static inline const char *gsm48_cc_cause_name(enum gsm48_cc_cause val)
+{ return get_value_string(gsm48_cc_cause_names, val); }
+
 /* Annex G, GSM specific cause values for mobility management */
 enum gsm48_reject_value {
GSM48_REJECT_IMSI_UNKNOWN_IN_HLR= 2,
diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c
index 136b937..fc3b973 100644
--- a/src/gsm/gsm48.c
+++ b/src/gsm/gsm48.c
@@ -945,6 +945,60 @@
{ 0, NULL }
 };

+/*! TS 04.08 10.5..4.11 Call Control Cause Values */
+const struct value_string gsm48_cc_cause_names[] = {
+   { GSM48_CC_CAUSE_UNASSIGNED_NR, "UNASSIGNED_NR" },
+   { GSM48_CC_CAUSE_NO_ROUTE,  "NO_ROUTE" },
+   { GSM48_CC_CAUSE_CHAN_UNACCEPT, "CHAN_UNACCEPT" },
+   { GSM48_CC_CAUSE_OP_DET_BARRING,"OP_DET_BARRING" },
+   { GSM48_CC_CAUSE_NORM_CALL_CLEAR,   "NORM_CALL_CLEAR" },
+   { GSM48_CC_CAUSE_USER_BUSY, "USER_BUSY" },
+   { GSM48_CC_CAUSE_USER_NOTRESPOND,   "USER_NOTRESPOND" },
+   { GSM48_CC_CAUSE_USER_ALERTING_NA,  "USER_ALERTING_NA" },
+   { GSM48_CC_CAUSE_CALL_REJECTED, "CALL_REJECTED" },
+   { GSM48_CC_CAUSE_NUMBER_CHANGED,"NUMBER_CHANGED" },
+   { GSM48_CC_CAUSE_PRE_EMPTION,   "PRE_EMPTION" },
+   { GSM48_CC_CAUSE_NONSE_USER_CLR,"NONSE_USER_CLR" },
+   { GSM48_CC_CAUSE_DEST_OOO,  "DEST_OOO" },
+   { GSM48_CC_CAUSE_INV_NR_FORMAT, "INV_NR_FORMAT" },
+   { GSM48_CC_CAUSE_FACILITY_REJ,  "FACILITY_REJ" },
+   { GSM48_CC_CAUSE_RESP_STATUS_INQ,   "RESP_STATUS_INQ" },
+   { GSM48_CC_CAUSE_NORMAL_UNSPEC, "NORMAL_UNSPEC" },
+   { GSM48_CC_CAUSE_NO_CIRCUIT_CHAN,   "NO_CIRCUIT_CHAN" },
+   { GSM48_CC_CAUSE_NETWORK_OOO,   "NETWORK_OOO" },
+   { GSM48_CC_CAUSE_TEMP_FAILURE,  "TEMP_FAILURE" },
+   { GSM48_CC_CAUSE_SWITCH_CONG,   "SWITCH_CONG" },
+   { GSM48_CC_CAUSE_ACC_INF_DISCARD,   "ACC_INF_DISCARD" },
+   { GSM48_CC_CAUSE_REQ_CHAN_UNAVAIL,  "REQ_CHAN_UNAVAIL" },
+   { GSM48_CC_CAUSE_RESOURCE_UNAVAIL,  "RESOURCE_UNAVAIL" },
+   { GSM48_CC_CAUSE_QOS_UNAVAIL,   "QOS_UNAVAIL" },
+   { GSM48_CC_CAUSE_REQ_FAC_NOT_SUBSC, "REQ_FAC_NOT_SUBSC" },
+   { GSM48_CC_CAUSE_INC_BARRED_CUG,"INC_BARRED_CUG" },
+   { GSM48_CC_CAUSE_BEARER_CAP_UNAUTH, "BEARER_CAP_UNAUTH" },
+   { GSM48_CC_CAUSE_BEARER_CA_UNAVAIL, "BEARER_CA_UNAVAIL" },
+   { GSM48_CC_CAUSE_SERV_OPT_UNAVAIL,  "SERV_OPT_UNAVAIL" },
+   { GSM48_CC_CAUSE_BEARERSERV_UNIMPL, "BEARERSERV_UNIMPL" },
+   { GSM48_CC_CAUSE_ACM_GE_ACM_MAX,"ACM_GE_ACM_MAX" },
+   { GSM48_CC_CAUSE_REQ_FAC_NOTIMPL,   "REQ_FAC_NOTIMPL" },
+   { GSM48_CC_CAUSE_RESTR_BCAP_AVAIL,  "RESTR_BCAP_AVAIL" },
+   { GSM48_CC_CAUSE_SERV_OPT_UNIMPL,   "SERV_OPT_UNIMPL" },
+   { GSM48_CC_CAUSE_INVAL_TRANS_ID,"INVAL_TRANS_ID" },
+   { GSM48_CC_CAUSE_USER_NOT_IN_CUG,   "USER_NOT_IN_CUG" },
+   { GSM48_CC_CAUSE_INCOMPAT_DEST, "INCOMPAT_DEST" },
+   { GSM48_CC_CAUSE_INVAL_TRANS_NET,   "INVAL_TRANS_NET" },
+   { GSM48_CC_CAUSE_SEMANTIC_INCORR,   "SEMANTIC_INCORR" },
+   { GSM48_CC_CAUSE_INVAL_MAND_INF,"INVAL_MAND_INF" },
+   { GSM48_CC_CAUSE_MSGTYPE_NOTEXIST,  "MSGTYPE_NOTEXIST" },
+   { GSM48_CC_CAUSE_MSGTYPE_INCOMPAT,  "MSGTYPE_INCOMPAT" },
+   { GSM48_CC_CAUSE_IE_NOTEXIST,   "IE_NOTEXIST" },
+   { GSM48_CC_CAUSE_COND_IE_ERR,   "COND_IE_ERR" },
+   { GSM48_CC_CAUSE_MSG_INCOMP_STATE,  "MSG_INCOMP_STATE" },
+   { GSM48_CC_CAUSE_RECOVERY_TIMER,"RECOVERY_TIMER" },
+   { GSM48_CC_CAUSE_PROTO_ERR, "PROTO_ERR" },
+   { GSM48_CC_CAUSE_INTERWORKING,  "INTERWORKING" },
+   { 0 , NULL }
+};
+
 /*! TS 04.80, section 3.4 Messages for supplementary services control */
 const struct value_string gsm48_nc_ss_msgtype_names[] = {
OSMO_VALUE

Change in osmo-sip-connector[master]: configure.ac: Introduce --enable-werror option

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10735 )

Change subject: configure.ac: Introduce --enable-werror option
..

configure.ac: Introduce --enable-werror option

Change-Id: I1666df1721ba9acc950612558e07a1a2e7b2bb85
---
M configure.ac
1 file changed, 23 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/configure.ac b/configure.ac
index e84cb83..916cfc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,24 @@
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
 PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0)

+AC_ARG_ENABLE(werror,
+   [AS_HELP_STRING(
+   [--enable-werror],
+   [Turn all compiler warnings into errors, with exceptions:
+a) deprecation (allow upstream to mark deprecation without 
breaking builds);
+b) "#warning" pragmas (allow to remind ourselves of errors 
without breaking builds)
+   ]
+   )],
+   [werror=$enableval], [werror="no"])
+if test x"$werror" = x"yes"
+then
+   WERROR_FLAGS="-Werror"
+   WERROR_FLAGS+=" -Wno-error=deprecated 
-Wno-error=deprecated-declarations"
+   WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
+   CFLAGS="$CFLAGS $WERROR_FLAGS"
+   CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
+fi
+
 AC_ARG_ENABLE([vty_tests],
AC_HELP_STRING([--enable-vty-tests],
[Include the VTY/CTRL tests in make check 
(deprecated)
@@ -47,6 +65,11 @@
 AC_MSG_RESULT([$enable_ext_tests])
 AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")

+AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
+AC_MSG_RESULT([CFLAGS="$CFLAGS"])
+AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])
+AC_MSG_RESULT([LDFLAGS="$LDFLAGS"])
+
 AC_OUTPUT(
src/Makefile
tests/Makefile

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1666df1721ba9acc950612558e07a1a2e7b2bb85
Gerrit-Change-Number: 10735
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-sip-connector[master]: mncc: Fix missing conditional clause

2018-09-03 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10734 )

Change subject: mncc: Fix missing conditional clause
..

mncc: Fix missing conditional clause

Fixes following compilation warning:
osmo-sip-connector/src/mncc.c: In function ‘check_disc_ind’:
osmo-sip-connector/src/mncc.c:517:2: warning: this ‘if’ clause does not 
guard... [-Wmisleading-indentation]
  if (other_leg)
  ^~

Fixes: 008915ee41900c34ec0fd8df0c9f1d7c2cbdb3b2 ("Implement Cause Mapping")

Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
---
M src/mncc.c
1 file changed, 6 insertions(+), 3 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/src/mncc.c b/src/mncc.c
index f41bb51..ae60321 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -514,9 +514,10 @@
mncc_send(leg->conn, MNCC_REL_REQ, leg->callref);

other_leg = call_leg_other(&leg->base);
-   if (other_leg)
+   if (other_leg) {
other_leg->cause = data->cause.value;
other_leg->release_call(other_leg);
+   }
 }

 static void check_rel_ind(struct mncc_connection *conn, const char *buf, int 
rc)
@@ -533,9 +534,10 @@
else {
struct call_leg *other_leg;
other_leg = call_leg_other(&leg->base);
-   if (other_leg)
+   if (other_leg) {
other_leg->cause = data->cause.value;
other_leg->release_call(other_leg);
+   }
}
LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was released.\n", data->callref);
mncc_leg_release(leg);
@@ -581,9 +583,10 @@

leg->cause = data->cause.value;
other_leg = call_leg_other(&leg->base);
-   if (other_leg)
+   if (other_leg) {
other_leg->cause = data->cause.value;
other_leg->release_call(other_leg);
+   }
LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was rejected.\n", data->callref);
mncc_leg_release(leg);
 }

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Gerrit-Change-Number: 10734
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-sip-connector[master]: configure.ac: Introduce --enable-werror option

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10735 )

Change subject: configure.ac: Introduce --enable-werror option
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1666df1721ba9acc950612558e07a1a2e7b2bb85
Gerrit-Change-Number: 10735
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 12:12:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sip-connector[master]: mncc: Fix missing conditional clause

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10734 )

Change subject: mncc: Fix missing conditional clause
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Gerrit-Change-Number: 10734
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 12:11:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sip-connector[master]: jenkins.sh: Use --enable-werror option

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10736 )

Change subject: jenkins.sh: Use --enable-werror option
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8cfad742e6ce766b022ecdf4c78495accc9405d0
Gerrit-Change-Number: 10736
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 12:12:04 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: gsm48_parse_meas_rep(): set num_cell=0 if no neighbor cells are reported

2018-09-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/7149 )

Change subject: gsm48_parse_meas_rep(): set num_cell=0 if no neighbor cells are 
reported
..


Patch Set 1:

> Please, could you merge this fix to openbsc?

I would suggest that you simply take care of the back-porting and push it to 
gerrit for openbsc.git. Thanks!


--
To view, visit https://gerrit.osmocom.org/7149
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: Ie12210660a04f2d664ddc92e7ad7fc39ee474180
Gerrit-Change-Number: 7149
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Ivan Kluchnikov 
Gerrit-Comment-Date: Mon, 03 Sep 2018 12:11:03 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sip-connector[master]: jenkins.sh: Use --enable-werror option

2018-09-03 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10736 )

Change subject: jenkins.sh: Use --enable-werror option
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8cfad742e6ce766b022ecdf4c78495accc9405d0
Gerrit-Change-Number: 10736
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 11:54:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sip-connector[master]: configure.ac: Introduce --enable-werror option

2018-09-03 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10735 )

Change subject: configure.ac: Introduce --enable-werror option
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1666df1721ba9acc950612558e07a1a2e7b2bb85
Gerrit-Change-Number: 10735
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 11:54:35 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sip-connector[master]: jenkins.sh: Use --enable-werror option

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10736


Change subject: jenkins.sh: Use --enable-werror option
..

jenkins.sh: Use --enable-werror option

Change-Id: I8cfad742e6ce766b022ecdf4c78495accc9405d0
---
M contrib/jenkins.sh
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/36/10736/1

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index 0b11ef3..00cd5ff 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -27,7 +27,7 @@
 set -x

 autoreconf --install --force
-./configure --enable-vty-tests --enable-external-tests
+./configure --enable-werror --enable-vty-tests --enable-external-tests
 $MAKE $PARALLEL_MAKE
 $MAKE check \
   || cat-testlogs.sh

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cfad742e6ce766b022ecdf4c78495accc9405d0
Gerrit-Change-Number: 10736
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-sip-connector[master]: configure.ac: Introduce --enable-werror option

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10735


Change subject: configure.ac: Introduce --enable-werror option
..

configure.ac: Introduce --enable-werror option

Change-Id: I1666df1721ba9acc950612558e07a1a2e7b2bb85
---
M configure.ac
1 file changed, 23 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/35/10735/1

diff --git a/configure.ac b/configure.ac
index e84cb83..916cfc3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,24 @@
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
 PKG_CHECK_MODULES(SOFIASIP, sofia-sip-ua-glib >= 1.12.0)

+AC_ARG_ENABLE(werror,
+   [AS_HELP_STRING(
+   [--enable-werror],
+   [Turn all compiler warnings into errors, with exceptions:
+a) deprecation (allow upstream to mark deprecation without 
breaking builds);
+b) "#warning" pragmas (allow to remind ourselves of errors 
without breaking builds)
+   ]
+   )],
+   [werror=$enableval], [werror="no"])
+if test x"$werror" = x"yes"
+then
+   WERROR_FLAGS="-Werror"
+   WERROR_FLAGS+=" -Wno-error=deprecated 
-Wno-error=deprecated-declarations"
+   WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
+   CFLAGS="$CFLAGS $WERROR_FLAGS"
+   CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
+fi
+
 AC_ARG_ENABLE([vty_tests],
AC_HELP_STRING([--enable-vty-tests],
[Include the VTY/CTRL tests in make check 
(deprecated)
@@ -47,6 +65,11 @@
 AC_MSG_RESULT([$enable_ext_tests])
 AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")

+AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
+AC_MSG_RESULT([CFLAGS="$CFLAGS"])
+AC_MSG_RESULT([CXXFLAGS="$CXXFLAGS"])
+AC_MSG_RESULT([LDFLAGS="$LDFLAGS"])
+
 AC_OUTPUT(
src/Makefile
tests/Makefile

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1666df1721ba9acc950612558e07a1a2e7b2bb85
Gerrit-Change-Number: 10735
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 


Change in osmo-sip-connector[master]: mncc: Fix missing conditional clause

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10734 )

Change subject: mncc: Fix missing conditional clause
..


Patch Set 1:

Indeed, we are lacking --enable-werror in configure.ac and enabling it in 
jenkins script. I'll do that.


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Gerrit-Change-Number: 10734
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 11:13:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sip-connector[master]: mncc: Fix missing conditional clause

2018-09-03 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10734 )

Change subject: mncc: Fix missing conditional clause
..


Patch Set 1:

This also shows that there is no testing coverage of the recently introduced 
features :/
Probably, even no manual testing, otherwise this should have been noticed.


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Gerrit-Change-Number: 10734
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 10:48:43 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sip-connector[master]: mncc: Fix missing conditional clause

2018-09-03 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/10734 )

Change subject: mncc: Fix missing conditional clause
..


Patch Set 1: Code-Review+1

Yep, C is not Python :)


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Gerrit-Change-Number: 10734
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 03 Sep 2018 10:46:05 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: gsm48_parse_meas_rep(): set num_cell=0 if no neighbor cells are reported

2018-09-03 Thread Ivan Kluchnikov
Ivan Kluchnikov has posted comments on this change. ( 
https://gerrit.osmocom.org/7149 )

Change subject: gsm48_parse_meas_rep(): set num_cell=0 if no neighbor cells are 
reported
..


Patch Set 1:

Hi Neels,

We have faced with the same issue in openbsc project, I figured out that it was 
fixed in osmo-bsc project, but it was not merged to openbsc.
This patch is relevant to osmo-bsc and openbsc projects and it fixes critical 
handover issue.
Please, could you merge this fix to openbsc?


--
To view, visit https://gerrit.osmocom.org/7149
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: Ie12210660a04f2d664ddc92e7ad7fc39ee474180
Gerrit-Change-Number: 7149
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Ivan Kluchnikov 
Gerrit-Comment-Date: Mon, 03 Sep 2018 10:36:49 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sip-connector[master]: Implement Cause Mapping

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/10728 )

Change subject: Implement Cause Mapping
..


Patch Set 3:

Have a look at https://gerrit.osmocom.org/#/c/osmo-sip-connector/+/10734, I 
submitted it to fix a bug in this commit.


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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1b80dff7e583cd6fff2b662bc6cc4bad3f81cd4
Gerrit-Change-Number: 10728
Gerrit-PatchSet: 3
Gerrit-Owner: Keith Whyte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Keith Whyte 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Sep 2018 09:34:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sip-connector[master]: mncc: Fix missing conditional clause

2018-09-03 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/10734


Change subject: mncc: Fix missing conditional clause
..

mncc: Fix missing conditional clause

Fixes following compilation warning:
osmo-sip-connector/src/mncc.c: In function ‘check_disc_ind’:
osmo-sip-connector/src/mncc.c:517:2: warning: this ‘if’ clause does not 
guard... [-Wmisleading-indentation]
  if (other_leg)
  ^~

Fixes: 008915ee41900c34ec0fd8df0c9f1d7c2cbdb3b2 ("Implement Cause Mapping")

Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
---
M src/mncc.c
1 file changed, 6 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/34/10734/1

diff --git a/src/mncc.c b/src/mncc.c
index f41bb51..ae60321 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -514,9 +514,10 @@
mncc_send(leg->conn, MNCC_REL_REQ, leg->callref);

other_leg = call_leg_other(&leg->base);
-   if (other_leg)
+   if (other_leg) {
other_leg->cause = data->cause.value;
other_leg->release_call(other_leg);
+   }
 }

 static void check_rel_ind(struct mncc_connection *conn, const char *buf, int 
rc)
@@ -533,9 +534,10 @@
else {
struct call_leg *other_leg;
other_leg = call_leg_other(&leg->base);
-   if (other_leg)
+   if (other_leg) {
other_leg->cause = data->cause.value;
other_leg->release_call(other_leg);
+   }
}
LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was released.\n", data->callref);
mncc_leg_release(leg);
@@ -581,9 +583,10 @@

leg->cause = data->cause.value;
other_leg = call_leg_other(&leg->base);
-   if (other_leg)
+   if (other_leg) {
other_leg->cause = data->cause.value;
other_leg->release_call(other_leg);
+   }
LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was rejected.\n", data->callref);
mncc_leg_release(leg);
 }

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

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bdbc29a3f82bdc92b156c1f7df68c9503f85f8f
Gerrit-Change-Number: 10734
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol