Change in osmo-ccid-firmware[master]: add debug command to communicate with card

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13943 )

Change subject: add debug command to communicate with card
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icbcde783143694afce23af6e3f26bcd7a9a13b85
Gerrit-Change-Number: 13943
Gerrit-PatchSet: 3
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 07:07:55 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: README.md: remove OS#1865 from 'Known limitations'

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13741 )

Change subject: README.md: remove OS#1865 from 'Known limitations'
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da
Gerrit-Change-Number: 13741
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 07:09:06 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: README.md: remove OS#1865 from 'Known limitations'

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13741 )

Change subject: README.md: remove OS#1865 from 'Known limitations'
..

README.md: remove OS#1865 from 'Known limitations'

Neither the bug has been reproduced, nor the bug reporter
did respond to request for configuration files.

Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da
---
M README.md
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/README.md b/README.md
index 01ec0ff..b1d7961 100644
--- a/README.md
+++ b/README.md
@@ -121,5 +121,4 @@
 osmo-bts-trx
 

- * TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865)
  * No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da
Gerrit-Change-Number: 13741
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmo-sccp[master]: osmo-stp: register VTY commands for talloc context introspection

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13954 )

Change subject: osmo-stp: register VTY commands for talloc context introspection
..

osmo-stp: register VTY commands for talloc context introspection

Change-Id: Id0789c4946929b783c54220de439958001f94992
---
M stp/stp_main.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/stp/stp_main.c b/stp/stp_main.c
index e7f4f38..aa77e61 100644
--- a/stp/stp_main.c
+++ b/stp/stp_main.c
@@ -180,6 +180,7 @@
osmo_ss7_vty_init_sg(tall_stp_ctx);
osmo_sccp_vty_init();
osmo_fsm_vty_add_cmds();
+   osmo_talloc_vty_add_cmds();

rc = vty_read_config_file(cmdline_config.config_file, NULL);
if (rc < 0) {

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id0789c4946929b783c54220de439958001f94992
Gerrit-Change-Number: 13954
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available.

2019-05-10 Thread Mykola Shchetinin
Hello lynxis lazus, Pau Espin Pedrol, Jenkins Builder,

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

https://gerrit.osmocom.org/13744

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

Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available.
..

gprs_gmm: send Service Reject when no PDP ctxs are available.

Look at PDP Context Status IE: if there are any PDP contexts which are
ACTIVE on MS side and there are no PDP contexts which are ACTIVE on the
network side, then send Service Reject with the cause "NO PDP
ACTIVATED". This forces MS to reactivate the PDP contexts.

3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted
by the network. Cause # 40.

Fixes: OS#3937
Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
---
M src/gprs/gprs_gmm.c
M tests/sgsn/sgsn_test.c
M tests/sgsn/sgsn_test.ok
3 files changed, 42 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/8
--
To view, visit https://gerrit.osmocom.org/13744
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Gerrit-Change-Number: 13744
Gerrit-PatchSet: 8
Gerrit-Owner: Mykola Shchetinin 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Mykola Shchetinin 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 


Change in libosmocore[master]: Add MO-FALLBACK-VALUE SGsAP IE

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13952 )

Change subject: Add MO-FALLBACK-VALUE SGsAP IE
..

Add MO-FALLBACK-VALUE SGsAP IE

In testing against a particular EPC, the SGsAP-SERVICE-REQUEST
can contain a MO fallback value TLV with T 0xF1

Change-Id: Ia2460af9673818d375e28c67f1631b5f7eacdaeb
---
M include/osmocom/gsm/protocol/gsm_29_118.h
M src/gsm/gsm29118.c
2 files changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/gsm/protocol/gsm_29_118.h 
b/include/osmocom/gsm/protocol/gsm_29_118.h
index cfe772a..9adb90f 100644
--- a/include/osmocom/gsm/protocol/gsm_29_118.h
+++ b/include/osmocom/gsm/protocol/gsm_29_118.h
@@ -73,6 +73,7 @@
SGSAP_IE_UE_EMM_MODE= 0x25,
SGSAP_IE_ADDL_PAGING_INDICATORS = 0x26,
SGSAP_IE_TMSI_BASED_NRI_CONT= 0x27,
+   SGSAP_IE_MO_FALLBACK_VALUE  = 0xf1,
 };
 extern const struct value_string sgsap_iei_names[];
 static inline const char *sgsap_iei_name(enum sgsap_iei iei) {
diff --git a/src/gsm/gsm29118.c b/src/gsm/gsm29118.c
index 56e7473..2c02b2f 100644
--- a/src/gsm/gsm29118.c
+++ b/src/gsm/gsm29118.c
@@ -89,6 +89,7 @@
{ SGSAP_IE_UE_EMM_MODE, "UE-EMM-MODE" },
{ SGSAP_IE_ADDL_PAGING_INDICATORS,  "ADDL-PAGING-INDICATORS" },
{ SGSAP_IE_TMSI_BASED_NRI_CONT, "TMSI-BASED-NRI-CONT" },
+   { SGSAP_IE_MO_FALLBACK_VALUE,   "MO-FALLBACK-VALUE" },
{ 0, NULL }
 };

@@ -179,6 +180,7 @@
[SGSAP_IE_UE_EMM_MODE]  = { TLV_TYPE_TLV },
[SGSAP_IE_ADDL_PAGING_INDICATORS]={ TLV_TYPE_TLV },
[SGSAP_IE_TMSI_BASED_NRI_CONT]  = { TLV_TYPE_TLV },
+   [SGSAP_IE_MO_FALLBACK_VALUE]= { TLV_TYPE_TLV },
},
 };


--
To view, visit https://gerrit.osmocom.org/13952
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: Ia2460af9673818d375e28c67f1631b5f7eacdaeb
Gerrit-Change-Number: 13952
Gerrit-PatchSet: 3
Gerrit-Owner: Omar Ramadan 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-ccid-firmware[master]: add function to transfer TPDU

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13949 )

Change subject: add function to transfer TPDU
..

add function to transfer TPDU

this function takes care of reading and writing the complete TPDU
to the card.

note: the sim-iccid command uses this function, but still only to
select MF.

Change-Id: I50c90f3697580a4c93220a3e09cc33ec85889814
---
M sysmoOCTSIM/main.c
1 file changed, 184 insertions(+), 83 deletions(-)

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



diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 11849c7..327ac6d 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -226,7 +226,183 @@

// set baud rate
uint32_t baudrate = (freq * d) / f; // calculate actual baud rate
-   return slot_set_baudrate(slotnr, baudrate); // // set baud rate
+   return slot_set_baudrate(slotnr, baudrate); // set baud rate
+}
+
+/** write data to card
+ *  @param[in] slotnr slot number on which to send data
+ *  @param[in] data data to be transmitted
+ *  @param[in] length length of data to be transmitted
+ *  @return error code
+ */
+static int slot_card_write(uint8_t slotnr, const uint8_t* data, uint16_t 
length)
+{
+   // input checks
+   ASSERT(slotnr < ARRAY_SIZE(SIM_peripheral_descriptors));
+   if (0 == length || NULL == data) {
+   return ERR_INVALID_ARG;
+   }
+
+   struct usart_async_descriptor* sim = SIM_peripheral_descriptors[slotnr];
+   ((Sercom *)sim->device.hw)->USART.CTRLB.bit.RXEN = 0; // disable 
receive (to avoid the echo back)
+   SIM_tx_count[slotnr] = false; // reset TX complete
+   for (uint16_t i = 0; i < length; i++) { // transmit data
+   while(!usart_async_is_tx_empty(sim)); // wait for previous byte 
to be transmitted (WARNING blocking)
+   if (1 != io_write(&sim->io, &data[i], 1)) { // put but in 
transmit buffer
+   return ERR_IO;
+   }
+   }
+   while (!SIM_tx_count[slotnr]); // wait until transmission is complete 
(WARNING blocking)
+   ((Sercom *)sim->device.hw)->USART.CTRLB.bit.RXEN = 1; // enable receive 
again
+
+   return ERR_NONE;
+}
+
+/** read data from card
+ *  @param[in] slotnr slot number on which to send data
+ *  @param[out] data buffer for read data to be stored
+ *  @param[in] length length of data to be read
+ *  @param[in] wt Waiting Time in ETU
+ *  @return error code
+ *  TODO fix WT/ETU duration
+ */
+static int slot_card_read(uint8_t slotnr, uint8_t* data, uint16_t length, 
uint32_t wt)
+{
+   // input checks
+   ASSERT(slotnr < ARRAY_SIZE(SIM_peripheral_descriptors));
+   if (0 == length || NULL == data) {
+   return ERR_INVALID_ARG;
+   }
+
+   struct usart_async_descriptor* sim = SIM_peripheral_descriptors[slotnr];
+
+   ((Sercom *)sim->device.hw)->USART.CTRLB.bit.RXEN = 1; // ensure RX is 
enabled
+   uint32_t timeout = wt; // reset waiting time
+   for (uint16_t i = 0; i < length; i++) { // read all data
+   while (timeout && !usart_async_is_rx_not_empty(sim)) { // 
verify if data is present
+   delay_us(149); // wait for 1 ETU (372 / 1 / 2.5 MHz = 
148.8 us)
+   timeout--;
+   }
+   if (0 == timeout) { // timeout reached
+   return ERR_TIMEOUT;
+   }
+   timeout = wt; // reset waiting time
+   if (1 != io_read(&sim->io, &data[i], 1)) { // read one byte
+   return ERR_IO;
+   }
+   }
+
+   return ERR_NONE;
+}
+
+/** transfer TPDU
+ *  @param[in] slotnr slot number on which to transfer the TPDU
+ *  @param[in] header TPDU header to send
+ *  @param[io] data TPDU data to transfer
+ *  @param[in] data_length length of TPDU data to transfer
+ *  @param[in] write if the data should be written (true) or read (false)
+ * TODO fix WT
+ * TODO the data length can be deduce from the header
+ */
+static int slot_tpdu_xfer(uint8_t slotnr, const uint8_t* header, uint8_t* 
data, uint16_t data_length, bool write)
+{
+   // input checks
+   ASSERT(slotnr < ARRAY_SIZE(SIM_peripheral_descriptors));
+   if (NULL == header || (data_length > 0 && NULL == data)) {
+   return ERR_INVALID_ARG;
+   }
+
+   int rc;
+   struct usart_async_descriptor* sim = 
SIM_peripheral_descriptors[slotnr]; // get USART peripheral
+   usart_async_flush_rx_buffer(sim); // flush RX buffer to start from 
scratch
+
+   // send command header
+   printf("(%d) TPDU: ", slotnr);
+   for (uint8_t i = 0; i < 5; i++) {
+   printf("%02x ", header[i]);
+   }
+   rc = slot_card_write(slotnr, header, 5); // transmit header
+   if (ERR_NONE != rc) {
+   printf("error in command header transmit (errno = %d)\r\n", rc

Change in osmo-msc[master]: add DUSSD logging category

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13942 )

Change subject: add DUSSD logging category
..


Patch Set 1: Code-Review-1

agree with vadim. It's also "DSS" in the HLR, IIRC


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id7e04c9f5088334cd5ec6cfdb6a9b3a2a7e7fda0
Gerrit-Change-Number: 13942
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 07:05:39 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13945 )

Change subject: call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6b2fc1225c960fa2f7c46adf241520217a07821c
Gerrit-Change-Number: 13945
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 07:04:30 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: LOG_TRANS: store subsys in trans, unify USSD logging back to DMM

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13941 )

Change subject: LOG_TRANS: store subsys in trans, unify USSD logging back to DMM
..

LOG_TRANS: store subsys in trans, unify USSD logging back to DMM

Instead of calling trans_log_subsys() for each LOG_TRANS() log line, rather
store in trans->log_subsys once on trans_alloc() and use that.

Do not fall back to the RAN's own subsystem (DBSSAP / DIUCS), it makes little
sense and may cause logging to switch subsystems depending on the RAN state.

In trans_log_subsys(), add missing switch cases:

- Log silent call transactions also on CC.
- Log USSD on DMM.

About USSD: we currently have no dedicated USSD logging category. As a result,
after LOG_TRANS() was introduced [1], USSD logged on DBSSAP/DIUCS or DMSC,
depending on whether a RAN was associated with the trans or not. Before that
change, USSD always logged on DMM, so, until we have a separate logging
category for USSD, consistenly use DMM again.

[1] in I2e60964d7a3c06d051debd1c707051a0eb3101ba / 
ff7074a0c7b62025473d8f1a950905ac2cb2f31c

Related: coverity CID 198453
Change-Id: I6dfe5b98fb9e884c2dde61d603832dafceb12123
---
M include/osmocom/msc/transaction.h
M src/libmsc/transaction.c
M tests/msc_vlr/msc_vlr_test_ss.err
3 files changed, 18 insertions(+), 11 deletions(-)

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



diff --git a/include/osmocom/msc/transaction.h 
b/include/osmocom/msc/transaction.h
index 99aca55..6b82390 100644
--- a/include/osmocom/msc/transaction.h
+++ b/include/osmocom/msc/transaction.h
@@ -27,7 +27,7 @@
 ##args)

 #define LOG_TRANS(trans, level, fmt, args...) \
-LOG_TRANS_CAT(trans, trans_log_subsys(trans), level, fmt, ##args)
+LOG_TRANS_CAT(trans, (trans)->log_subsys, level, fmt, ##args)

 enum bridge_state {
BRIDGE_STATE_NONE,
@@ -60,6 +60,8 @@

/* What kind of transaction */
enum trans_type type;
+   /* Which category to log on, for LOG_TRANS(). */
+   int log_subsys;

/* The current transaction ID */
uint8_t transaction_id;
@@ -161,13 +163,17 @@
return DMSC;
switch (trans->type) {
case TRANS_CC:
+   case TRANS_SILENT_CALL:
return DCC;
case TRANS_SMS:
return DLSMS;
+   case TRANS_USSD:
+   /* FIXME: traditionally (before LOG_TRANS() was added in 
I2e60964d7a3c06d051debd1c707051a0eb3101ba /
+* ff7074a0c7b62025473d8f1a950905ac2cb2f31c), all USSD logging 
happened on DMM. Instead, it probably
+* deserves its own logging subsystem. */
+   return DMM;
default:
break;
}
-   if (trans->msc_a)
-   return trans->msc_a->c.ran->log_subsys;
return DMSC;
 }
diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c
index b909cd8..d6f8c3b 100644
--- a/src/libmsc/transaction.c
+++ b/src/libmsc/transaction.c
@@ -146,6 +146,7 @@
.callref = callref,
.net = net,
};
+   trans->log_subsys = trans_log_subsys(trans);
vlr_subscr_get(vsub, trans_vsub_use(type));
llist_add_tail(&trans->entry, &net->trans_list);

diff --git a/tests/msc_vlr/msc_vlr_test_ss.err 
b/tests/msc_vlr/msc_vlr_test_ss.err
index 5592488..2030715 100644
--- a/tests/msc_vlr/msc_vlr_test_ss.err
+++ b/tests/msc_vlr/msc_vlr_test_ss.err
@@ -173,12 +173,12 @@
 DBSSAP 
msc_a(IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ){MSC_A_ST_AUTHENTICATED}:
 RAN decode: DTAP
 DRLL 
msc_a(IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ){MSC_A_ST_AUTHENTICATED}:
 Dispatching 04.08 message: NCSS GSM0480_MTYPE_REGISTER
 DREF VLR subscr IMSI-90170004620:MSISDN-46071 + NCSS: now used by 3 
(attached,active-conn,NCSS)
-DMSC trans(NCSS IMSI-90170004620:MSISDN-46071 callref-0x2001 tid-8) 
New transaction
+DMM trans(NCSS IMSI-90170004620:MSISDN-46071 callref-0x2001 tid-8) New 
transaction
 DREF 
msc_a(IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ){MSC_A_ST_AUTHENTICATED}:
 + nc_ss: now used by 3 (cm_service_ss,rx_from_ms,nc_ss)
 DMSC 
msc_a(IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ){MSC_A_ST_AUTHENTICATED}:
 Received Event MSC_A_EV_TRANSACTION_ACCEPTED
 DMSC 
msc_a(IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ){MSC_A_ST_AUTHENTICATED}:
 state_chg to MSC_A_ST_COMMUNICATING
 DREF 
msc_a(IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ){MSC_A_ST_COMMUNICATING}:
 - cm_service_ss: now used by 2 (rx_from_ms,nc_ss)
-DBSSAP trans(NCSS IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ 
callref-0x2001 tid-8) Received SS/USSD msg GSM0480_MTYPE_REGISTER
+DMM trans(NCSS IMSI-90170004620:MSISDN-46071:GERAN-A:CM_SERVICE_REQ 
callref-0x2001 tid-8) R

Change in libosmo-sccp[master]: osmo-stp: register VTY commands for talloc context introspection

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13954 )

Change subject: osmo-stp: register VTY commands for talloc context introspection
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id0789c4946929b783c54220de439958001f94992
Gerrit-Change-Number: 13954
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 07:06:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations'

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/5833 )

Change subject: Remove 11-bit RACH support from 'Known Limitations'
..


Set Ready For Review


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
Gerrit-Change-Number: 5833
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Huemer 
Gerrit-Assignee: fixeria 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Alexander Chemeris 
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Fri, 10 May 2019 07:08:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: Add MO-FALLBACK-VALUE SGsAP IE

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13952 )

Change subject: Add MO-FALLBACK-VALUE SGsAP IE
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13952
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: Ia2460af9673818d375e28c67f1631b5f7eacdaeb
Gerrit-Change-Number: 13952
Gerrit-PatchSet: 2
Gerrit-Owner: Omar Ramadan 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 07:07:33 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ccid-firmware[master]: finish implementing sim-iccid

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13950 )

Change subject: finish implementing sim-iccid
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I71b5832703a60c0c967fa2c6bc0eec56883962c5
Gerrit-Change-Number: 13950
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 07:08:06 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: make msc_a_vsub() and others NULL-safe

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13939 )

Change subject: make msc_a_vsub() and others NULL-safe
..

make msc_a_vsub() and others NULL-safe

Fixes: coverity CID 198451
Change-Id: Icd146ae512236a09cad080ed3eb85944e8f5cee4
---
M src/libmsc/msc_a.c
M src/libmsc/msc_i.c
M src/libmsc/msc_t.c
3 files changed, 10 insertions(+), 0 deletions(-)

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



diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 675f932..5baed54 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -73,16 +73,22 @@

 struct vlr_subscr *msc_a_vsub(const struct msc_a *msc_a)
 {
+   if (!msc_a)
+   return NULL;
return msub_vsub(msc_a->c.msub);
 }

 struct msc_i *msc_a_msc_i(const struct msc_a *msc_a)
 {
+   if (!msc_a)
+   return NULL;
return msub_msc_i(msc_a->c.msub);
 }

 struct msc_t *msc_a_msc_t(const struct msc_a *msc_a)
 {
+   if (!msc_a)
+   return NULL;
return msub_msc_t(msc_a->c.msub);
 }

diff --git a/src/libmsc/msc_i.c b/src/libmsc/msc_i.c
index 6badba6..05df9cb 100644
--- a/src/libmsc/msc_i.c
+++ b/src/libmsc/msc_i.c
@@ -332,6 +332,8 @@

 struct vlr_subscr *msc_i_vsub(const struct msc_i *msc_i)
 {
+   if (!msc_i)
+   return NULL;
return msub_vsub(msc_i->c.msub);
 }

diff --git a/src/libmsc/msc_t.c b/src/libmsc/msc_t.c
index ec5531f..c6bba47 100644
--- a/src/libmsc/msc_t.c
+++ b/src/libmsc/msc_t.c
@@ -902,6 +902,8 @@

 struct vlr_subscr *msc_t_vsub(const struct msc_t *msc_t)
 {
+   if (!msc_t)
+   return NULL;
return msub_vsub(msc_t->c.msub);
 }


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icd146ae512236a09cad080ed3eb85944e8f5cee4
Gerrit-Change-Number: 13939
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-ccid-firmware[master]: add function to transfer TPDU

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13949 )

Change subject: add function to transfer TPDU
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I50c90f3697580a4c93220a3e09cc33ec85889814
Gerrit-Change-Number: 13949
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 07:08:03 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Fix osmo_quote_str_c() for strings larger than 32 bytes

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13901 )

Change subject: Fix osmo_quote_str_c() for strings larger than 32 bytes
..

Fix osmo_quote_str_c() for strings larger than 32 bytes

As Neels pointed out, we shouldn't pass a constant value of 32
to osmo_quote_str_buf2().

Change-Id: Id9bde14166d6674ce4dda36fa9f4ae9217ce5cc2
---
M src/utils.c
1 file changed, 13 insertions(+), 2 deletions(-)

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



diff --git a/src/utils.c b/src/utils.c
index b66721e..59dc816 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -813,10 +813,21 @@
  */
 char *osmo_quote_str_c(const void *ctx, const char *str, int in_len)
 {
-   char *buf = talloc_size(ctx, OSMO_MAX(in_len+2, 32));
+   size_t len = in_len == -1 ? strlen(str) : in_len;
+   char *buf;
+
+   /* account for two quote characters + terminating NUL */
+   len += 3;
+
+   /* some minimum length for things like "NULL" or "(error)" */
+   if (len < 32)
+   len = 32;
+
+   buf = talloc_size(ctx, len);
if (!buf)
return NULL;
-   return osmo_quote_str_buf2(buf, 32, str, in_len);
+
+   return osmo_quote_str_buf2(buf, len, str, in_len);
 }

 /*! perform an integer square root operation on unsigned 32bit integer.

--
To view, visit https://gerrit.osmocom.org/13901
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: Id9bde14166d6674ce4dda36fa9f4ae9217ce5cc2
Gerrit-Change-Number: 13901
Gerrit-PatchSet: 6
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Mykola Shchetinin 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-msc[master]: no HO call forwarding if no RTP stream

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13940 )

Change subject: no HO call forwarding if no RTP stream
..

no HO call forwarding if no RTP stream

Fixes: coverity CID 198447
Related: OS#3992 (does not fix, just related)
Change-Id: Ia223c2e20e625879ab71fc5c8afd0305fd224c58
---
M src/libmsc/msc_ho.c
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/src/libmsc/msc_ho.c b/src/libmsc/msc_ho.c
index 9d130c5..3a4258c 100644
--- a/src/libmsc/msc_ho.c
+++ b/src/libmsc/msc_ho.c
@@ -552,6 +552,11 @@
return -EINVAL;
}

+   if (!rtp_to_ran) {
+   msc_ho_failed(msc_a, GSM0808_CAUSE_EQUIPMENT_FAILURE, 
"Unexpected: no RTP stream is set up\n");
+   return -EINVAL;
+   }
+
/* Backup old cell's RTP IP:port and codec data */
msc_a->ho.old_cell.ran_remote_rtp = rtp_to_ran->remote;
msc_a->ho.old_cell.codec = rtp_to_ran->codec;

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia223c2e20e625879ab71fc5c8afd0305fd224c58
Gerrit-Change-Number: 13940
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available.

2019-05-10 Thread Mykola Shchetinin
Mykola Shchetinin has posted comments on this change. ( 
https://gerrit.osmocom.org/13744 )

Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available.
..


Patch Set 8:

(3 comments)

https://gerrit.osmocom.org/#/c/13744/7/src/gprs/gprs_gmm.c
File src/gprs/gprs_gmm.c:

https://gerrit.osmocom.org/#/c/13744/7/src/gprs/gprs_gmm.c@1618
PS7, Line 1618:
  : /* 3GPP TS 24.008 Section 4.7.13.4 Service request procedure 
not accepted by the
  :  * network. Returns true if MS has active PDP contexts in 
pdp_status */
  : bool pdp_status_has_active_nsapis(const uint8_t *pdp_status, 
const size_t pdp_status_len)
  : {
  : size_t i;
  : for (i = 0; i < pdp_status_len; i++)
  : if (pdp_status[i] != 0)
  : return true;
  :
> Can you rename it to pdp_status_has_active_nsapis? […]
Done


https://gerrit.osmocom.org/#/c/13744/7/src/gprs/gprs_gmm.c@1629
PS7, Line 1629: }
  :
  : /* Chapter 9.4.14: Routing area update request */
  : static int gsm48_rx_gmm_ra_upd_req(struct sgsn_mm_ctx *mmctx, 
struct msgb *msg,
  :struct gprs_llc_llme *llme)
  : {
  : #ifndef PTMSI_ALLOC
  : struct sgsn_signal_data sig_data;
  : #endif
  : struct gsm48_hdr *gh = (struct gsm48_hdr *) 
msgb_gmmh(msg);
  : uint8_t *cur = gh->data;
  :
> Can you remove this function. […]
Done


https://gerrit.osmocom.org/#/c/13744/7/src/gprs/gprs_gmm.c@1935
PS7, Line 1935: (DMM, LOGL_INFO, "\n");
> do a llist_empty(.. […]
Done



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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Gerrit-Change-Number: 13744
Gerrit-PatchSet: 8
Gerrit-Owner: Mykola Shchetinin 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Mykola Shchetinin 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Comment-Date: Fri, 10 May 2019 07:10:04 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ccid-firmware[master]: add debug command to communicate with card

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13943 )

Change subject: add debug command to communicate with card
..

add debug command to communicate with card

currently the sim-iccid command only selects MF.
this is a proof of concept for card communication.
the transmission/reception must be generalized to avoid copying
the code multiple times.

IMPORTANT: the sim-iccid commands only works after the sim-atr
command, which sets up the cards correctly

Change-Id: Icbcde783143694afce23af6e3f26bcd7a9a13b85
---
M sysmoOCTSIM/main.c
1 file changed, 145 insertions(+), 7 deletions(-)

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



diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index a895c14..11849c7 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -38,10 +38,28 @@
 // TODO for now SIM7 is not present because used for debug
 static struct usart_async_descriptor* SIM_peripheral_descriptors[] = {&SIM0, 
&SIM1, &SIM2, &SIM3, &SIM4, &SIM5, &SIM6, NULL};

+/** number of bytes transmitted on the SIM peripheral */
+static volatile bool SIM_tx_count[8];
+
 static void SIM_rx_cb(const struct usart_async_descriptor *const io_descr)
 {
 }

+/** called when the transmission is complete
+ *  e.g. this is when the byte has been sent and there is no data to transmit 
anymore
+ */
+static void SIM_tx_cb(const struct usart_async_descriptor *const io_descr)
+{
+   // find slotnr for corresponding USART
+   uint8_t slotnr;
+   for (slotnr = 0; slotnr < ARRAY_SIZE(SIM_peripheral_descriptors) && 
SIM_peripheral_descriptors[slotnr] != io_descr; slotnr++);
+
+   // set flag
+   if (slotnr < ARRAY_SIZE(SIM_peripheral_descriptors)) {
+   SIM_tx_count[slotnr] = true;
+   }
+}
+
 /** possible clock sources for the SERCOM peripheral
  *  warning: the definition must match the GCLK configuration
  */
@@ -80,6 +98,7 @@
continue;
}
usart_async_register_callback(SIM_peripheral_descriptors[i], 
USART_ASYNC_RXC_CB, SIM_rx_cb); // required for RX to work, even if the 
callback does nothing
+   usart_async_register_callback(SIM_peripheral_descriptors[i], 
USART_ASYNC_TXC_CB, SIM_tx_cb); // to count the number of bytes transmitted 
since we are using it asynchronously
usart_async_enable(SIM_peripheral_descriptors[i]);
}
 }
@@ -360,7 +379,7 @@
// check if card is present (and read current settings)
ncn8025_get(slotnr, &settings);
if (!settings.simpres) {
-   printf("no card present in slot %d, aborting\r\n", slotnr);
+   printf("(%d) error: no card present\r\n", slotnr);
return;
}

@@ -406,19 +425,19 @@
}
// verify if one byte has been received
if (!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) {
-   printf("card in slot %d is not responding, aborting\r\n", 
slotnr);
+   printf("(%d) error: card not responsive\r\n", slotnr);
return;
}

// read ATR (just do it until there is no traffic anymore)
-   // TODO the ATR should be parsed to read the right number of bytes
+   // TODO the ATR should be parsed to read the right number of bytes, 
instead we just wait until to end of WT
printf("(%d) ATR: ", slotnr);
uint8_t atr_byte;
while (usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) 
{
if (1 == io_read(&SIM_peripheral_descriptors[slotnr]->io, 
&atr_byte, 1)) {
printf("%02x ", atr_byte);
}
-   uint16_t wt = 9600; // waiting time in ETU
+   uint16_t wt = ISO7816_3_DEFAULT_WT; // waiting time in ETU
while (wt && 
!usart_async_is_rx_not_empty(SIM_peripheral_descriptors[slotnr])) {
delay_us(149); // wait for 1 ETU (372 / 1 / 2.5 MHz = 
148.8 us)
wt--;
@@ -426,9 +445,127 @@
}
printf("\r\n");

-   /* disable VCC and LED, re-enable RST */
-   settings.cmdvcc = false;
-   settings.rstin = true;
+   /* disable LED */
+   settings.led = false;
+   ncn8025_set(slotnr, &settings);
+}
+
+DEFUN(sim_iccid, cmd_sim_iccid, "sim-iccid", "Read ICCID from SIM card")
+{
+   struct ncn8025_settings settings;
+   int slotnr = validate_slotnr(argc, argv, 1);
+
+   if (slotnr < 0 || slotnr >= ARRAY_SIZE(SIM_peripheral_descriptors) || 
NULL == SIM_peripheral_descriptors[slotnr]) {
+   return;
+   }
+
+   // read current settings and check if card is present and powered
+   ncn8025_get(slotnr, &settings);
+   if (!settings.simpres) {
+   printf("(%d) error: no card present\r\n", slotnr);
+   return;
+   }
+   if (!settings.cmdvcc

Change in osmo-msc[master]: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13655 )

Change subject: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length
..

libmsc/gsm_04_11.c: properly handle TP-User-Data-Length

As per 3GPP TS 03.40, section 9.2.3.16 "TP-User-Data-Length (TP-UDL)",
if the TP-User-Data is coded using the GSM 7-bit default alphabet,
the TP-User-Data-Length field indicates the *number of septets*
within the TP-User-Data field to follow. Otherwise, i.e. in case
of 8-bit or UCS-2 encoded data, the *number of octets* is indicated.

Since we store the original TP-UDL value (as received), we might
need to convert septets to octets before passing it to memcpy().
Otherwise this would lead to a buffer overrun.

Also, as we receive TPDU from untrusted source (i.e. subscriber),
the TP-UDL value needs to be checked against the corresponding
maximum (160 septets or 140 octets) and truncated if needed.

Please note that buffer overrun is still possible, e.g. when an
indicated TP-UDL value is grather than the remaining TPDU length.
Preventing this would require adding an additional check.

Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688
Depends-on: (core) I54f88d2908ac47228813fb8c049f4264e5145241
---
M src/libmsc/gsm_04_11.c
1 file changed, 29 insertions(+), 12 deletions(-)

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



diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index ff5576f..22e55dd 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -545,19 +546,35 @@
rc = GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
goto out;
}
-   gsms->user_data_len = *smsp++;
-   if (gsms->user_data_len) {
-   memcpy(gsms->user_data, smsp, gsms->user_data_len);

-   switch (sms_alphabet) {
-   case DCS_7BIT_DEFAULT:
-   gsm_7bit_decode_n(gsms->text, sizeof(gsms->text), smsp,
- gsms->user_data_len);
-   break;
-   case DCS_8BIT_DATA:
-   case DCS_UCS2:
-   case DCS_NONE:
-   break;
+   /* As per 3GPP TS 03.40, section 9.2.3.16, TP-User-Data-Length (TP-UDL)
+* may indicate either the number of septets, or the number of octets,
+* depending on Data Coding Scheme. We store TP-UDL value as-is,
+* so this should be kept in mind to avoid buffer overruns. */
+   gsms->user_data_len = *smsp++;
+   if (gsms->user_data_len > 0) {
+   if (sms_alphabet == DCS_7BIT_DEFAULT) {
+   /* TP-UDL is indicated in septets (up to 160) */
+   if (gsms->user_data_len > GSM340_UDL_SPT_MAX) {
+   LOG_TRANS(trans, LOGL_NOTICE,
+ "TP-User-Data-Length %u (septets) "
+ "is too big, truncating to %u\n",
+ gsms->user_data_len, 
GSM340_UDL_SPT_MAX);
+   gsms->user_data_len = GSM340_UDL_SPT_MAX;
+   }
+   memcpy(gsms->user_data, smsp, 
gsm_get_octet_len(gsms->user_data_len));
+   gsm_7bit_decode_n(gsms->text, sizeof(gsms->text),
+ smsp, gsms->user_data_len);
+   } else {
+   /* TP-UDL is indicated in octets (up to 140) */
+   if (gsms->user_data_len > GSM340_UDL_OCT_MAX) {
+   LOG_TRANS(trans, LOGL_NOTICE,
+ "TP-User-Data-Length %u (octets) "
+ "is too big, truncating to %u\n",
+ gsms->user_data_len, 
GSM340_UDL_OCT_MAX);
+   gsms->user_data_len = GSM340_UDL_OCT_MAX;
+   }
+   memcpy(gsms->user_data, smsp, gsms->user_data_len);
}
}


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688
Gerrit-Change-Number: 13655
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Max 


Change in osmo-ccid-firmware[master]: finish implementing sim-iccid

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13950 )

Change subject: finish implementing sim-iccid
..

finish implementing sim-iccid

Change-Id: I71b5832703a60c0c967fa2c6bc0eec56883962c5
---
M sysmoOCTSIM/main.c
1 file changed, 38 insertions(+), 4 deletions(-)

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



diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index 327ac6d..6ab8bc8 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -658,13 +658,47 @@

// select MF
printf("(%d) SELECT MF\r\n", slotnr);
-   // write SELECT MF APDU
-   const uint8_t select_mf_header[] = {0xa0, 0xa4, 0x00, 0x00, 0x02};
-   const uint8_t select_mf_data[] = {0x3f, 0x00};
-   int rc = slot_tpdu_xfer(slotnr, select_mf_header, 
(uint8_t*)select_mf_data, ARRAY_SIZE(select_mf_data), true); // transfer TPDU
+   const uint8_t select_header[] = {0xa0, 0xa4, 0x00, 0x00, 0x02}; // see 
TS 102.221 sec. 11.1.1
+   const uint8_t select_data_mf[] = {0x3f, 0x00}; // see TS 102.221 sec. 
13.1
+   int rc = slot_tpdu_xfer(slotnr, select_header, 
(uint8_t*)select_data_mf, ARRAY_SIZE(select_data_mf), true); // transfer TPDU
if (ERR_NONE != rc) {
printf("error while SELECT MF (errno = %d)\r\n", rc);
}
+   // ignore response data
+
+   // select EF_ICCID
+   printf("(%d) SELECT EF_ICCID\r\n", slotnr);
+   const uint8_t select_data_ef_iccid[] = {0x2f, 0xe2}; // see TS 102.221 
sec. 13.2
+   rc = slot_tpdu_xfer(slotnr, select_header, 
(uint8_t*)select_data_ef_iccid, ARRAY_SIZE(select_data_ef_iccid), true); // 
transfer TPDU
+   if (ERR_NONE != rc) {
+   printf("error while SELECT EF_ICCID (errno = %d)\r\n", rc);
+   }
+   // ignore response data
+
+   // read EF_ICCID
+   printf("(%d) READ EF_ICCID\r\n", slotnr);
+   uint8_t iccid[10];
+   uint8_t read_binary[] = {0xa0, 0xb0, 0x00, 0x00, ARRAY_SIZE(iccid)}; // 
see TS 102.221 sec. 11.1.3
+   rc = slot_tpdu_xfer(slotnr, read_binary, iccid, ARRAY_SIZE(iccid), 
false); // transfer TPDU
+   if (ERR_NONE != rc) {
+   printf("error while READ ICCID (errno = %d)\r\n", rc);
+   }
+   // ignore response data
+
+   printf("(%d) ICCID: ", slotnr);
+   for (uint8_t i = 0; i < ARRAY_SIZE(iccid); i++) {
+   uint8_t nibble = iccid[i] & 0xf;
+   if (0xf == nibble) {
+   break;
+   }
+   printf("%x", nibble);
+   nibble = iccid[i] >> 4;
+   if (0xf == nibble) {
+   break;
+   }
+   printf("%x", nibble);
+   }
+   printf("\r\n");

// disable LED
settings.led = false;

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I71b5832703a60c0c967fa2c6bc0eec56883962c5
Gerrit-Change-Number: 13950
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: gsm0808_utils: Introduce gsm0808_msgb_put_cell_id_u()

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13887 )

Change subject: gsm0808_utils: Introduce gsm0808_msgb_put_cell_id_u()
..

gsm0808_utils: Introduce gsm0808_msgb_put_cell_id_u()

This function is doing the bulk work of encoding a given Cell
ID List item.  gsm0808_enc_cell_id_list2() is modified to be a
wrapper / loop around the new function.

The purpose of this is to expose Cell ID List Entry encoding
so that the upcoming CBSP protocol encoder can re-use this code.

Related: OS#3537
Change-Id: I6cc567798e20365e6587e6b2988e834306d8c80c
---
M include/osmocom/gsm/gsm0808_utils.h
M src/gsm/gsm0808_utils.c
M src/gsm/libosmogsm.map
3 files changed, 44 insertions(+), 41 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/gsm0808_utils.h 
b/include/osmocom/gsm/gsm0808_utils.h
index 47c4e95..3a7beb7 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -93,6 +93,7 @@
 void gsm0808_cell_id_from_cgi(struct gsm0808_cell_id *cid, enum CELL_IDENT 
id_discr,
  const struct osmo_cell_global_id *cgi);
 int gsm0808_cell_id_to_cgi(struct osmo_cell_global_id *cgi, const struct 
gsm0808_cell_id *cid);
+void gsm0808_msgb_put_cell_id_u(struct msgb *msg, enum CELL_IDENT id_discr, 
const union gsm0808_cell_id_u *u);

 uint8_t gsm0808_enc_cause(struct msgb *msg, uint16_t cause);
 uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg,
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 99cf188..e825930 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -737,6 +737,46 @@
return (int)(elem - old_elem);
 }

+void gsm0808_msgb_put_cell_id_u(struct msgb *msg, enum CELL_IDENT id_discr, 
const union gsm0808_cell_id_u *u)
+{
+   switch (id_discr) {
+   case CELL_IDENT_WHOLE_GLOBAL: {
+   const struct osmo_cell_global_id *id = &u->global;
+   struct gsm48_loc_area_id lai;
+   gsm48_generate_lai2(&lai, &id->lai);
+   memcpy(msgb_put(msg, sizeof(lai)), &lai, sizeof(lai));
+   msgb_put_u16(msg, id->cell_identity);
+   break;
+   }
+   case CELL_IDENT_LAC_AND_CI: {
+   const struct osmo_lac_and_ci_id *id = &u->lac_and_ci;
+   msgb_put_u16(msg, id->lac);
+   msgb_put_u16(msg, id->ci);
+   break;
+   }
+   case CELL_IDENT_CI:
+   msgb_put_u16(msg, u->ci);
+   break;
+   case CELL_IDENT_LAI_AND_LAC: {
+   const struct osmo_location_area_id *id = &u->lai_and_lac;
+   struct gsm48_loc_area_id lai;
+   gsm48_generate_lai2(&lai, id);
+   memcpy(msgb_put(msg, sizeof(lai)), &lai, sizeof(lai));
+   break;
+   }
+   case CELL_IDENT_LAC:
+   msgb_put_u16(msg, u->lac);
+   break;
+   case CELL_IDENT_BSS:
+   case CELL_IDENT_NO_CELL:
+   /* Does not have any list items */
+   break;
+   default:
+   /* Support for other identifier list types is not implemented. 
*/
+   OSMO_ASSERT(false);
+   }
+}
+
 /*! Encode TS 08.08 Cell Identifier List IE
  *  \param[out] msg Message Buffer to which IE is to be appended
  *  \param[in] cil Cell ID List to be encoded
@@ -758,47 +798,8 @@
msgb_put_u8(msg, cil->id_discr & 0x0f);

OSMO_ASSERT(cil->id_list_len <= GSM0808_CELL_ID_LIST2_MAXLEN)
-   switch (cil->id_discr) {
-   case CELL_IDENT_WHOLE_GLOBAL:
-   for (i = 0; i < cil->id_list_len; i++) {
-   const struct osmo_cell_global_id *id = 
&cil->id_list[i].global;
-   struct gsm48_loc_area_id lai;
-   gsm48_generate_lai2(&lai, &id->lai);
-   memcpy(msgb_put(msg, sizeof(lai)), &lai, sizeof(lai));
-   msgb_put_u16(msg, id->cell_identity);
-   }
-   break;
-   case CELL_IDENT_LAC_AND_CI:
-   for (i = 0; i < cil->id_list_len; i++) {
-   const struct osmo_lac_and_ci_id *id = 
&cil->id_list[i].lac_and_ci;
-   msgb_put_u16(msg, id->lac);
-   msgb_put_u16(msg, id->ci);
-   }
-   break;
-   case CELL_IDENT_CI:
-   for (i = 0; i < cil->id_list_len; i++)
-   msgb_put_u16(msg, cil->id_list[i].ci);
-   break;
-   case CELL_IDENT_LAI_AND_LAC:
-   for (i = 0; i < cil->id_list_len; i++) {
-   const struct osmo_location_area_id *id = 
&cil->id_list[i].lai_and_lac;
-   struct gsm48_loc_area_id lai;
-   gsm48_generate_lai2(&lai, id);
-   memcpy(msgb_put(msg, sizeof(lai)

Change in osmo-msc[master]: ran_a_make_handover_request(): allow no encryption

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13938 )

Change subject: ran_a_make_handover_request(): allow no encryption
..

ran_a_make_handover_request(): allow no encryption

Fixes: coverity CID 198454
Change-Id: Ifb83ab2a8b6148b457224687ffada2dff4c3204f
---
M src/libmsc/ran_msg_a.c
1 file changed, 2 insertions(+), 1 deletion(-)

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



diff --git a/src/libmsc/ran_msg_a.c b/src/libmsc/ran_msg_a.c
index 2e498a2..ba0990d 100644
--- a/src/libmsc/ran_msg_a.c
+++ b/src/libmsc/ran_msg_a.c
@@ -1068,7 +1068,8 @@

.speech_version_used = n->speech_version_used,

-   .chosen_encryption_algorithm_serving = 
n->geran.chosen_encryption->alg_id,
+   .chosen_encryption_algorithm_serving =
+   n->geran.chosen_encryption ? 
n->geran.chosen_encryption->alg_id : 0,

.old_bss_to_new_bss_info_raw = n->old_bss_to_new_bss_info_raw,
.old_bss_to_new_bss_info_raw_len = 
n->old_bss_to_new_bss_info_raw_len,

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifb83ab2a8b6148b457224687ffada2dff4c3204f
Gerrit-Change-Number: 13938
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: Print error message if application fails to call rate_ctr_init()

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13919 )

Change subject: Print error message if application fails to call rate_ctr_init()
..

Print error message if application fails to call rate_ctr_init()

Change-Id: Ie8093b66b7e27cf863d2558fe21b2c6e0f3fcdfd
Closes: OS#3580
---
M src/rate_ctr.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 026670b..99ec523 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -69,7 +69,7 @@
 #include 

 static LLIST_HEAD(rate_ctr_groups);
-
+static struct osmo_timer_list rate_ctr_timer;
 static void *tall_rate_ctr_ctx;


@@ -217,6 +217,10 @@
unsigned int size;
struct rate_ctr_group *group;

+   if (!osmo_timer_pending(&rate_ctr_timer))
+   LOGP(DLGLOBAL, LOGL_ERROR, "your program appears to use 
libosmocore rate_ctr "
+   "without calling rate_ctr_init() at start-up. Rate 
counters won't work!\n");
+
if (rate_ctr_get_group_by_name_idx(desc->group_name_prefix, idx)) {
unsigned int new_idx = 
rate_ctr_get_unused_name_idx(desc->group_name_prefix);
LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' already exists 
for index %u,"
@@ -294,7 +298,6 @@
ctr->intv[intv+1].rate += ctr->intv[intv].rate;
 }

-static struct osmo_timer_list rate_ctr_timer;
 static uint64_t timer_ticks;

 /* The one-second interval has expired */

--
To view, visit https://gerrit.osmocom.org/13919
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: Ie8093b66b7e27cf863d2558fe21b2c6e0f3fcdfd
Gerrit-Change-Number: 13919
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-msc[master]: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13655 )

Change subject: libmsc/gsm_04_11.c: properly handle TP-User-Data-Length
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4b08db7665e854a045129e7695e2bdf296df1688
Gerrit-Change-Number: 13655
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 10 May 2019 07:03:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations'

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/5833 )

Change subject: Remove 11-bit RACH support from 'Known Limitations'
..

Remove 11-bit RACH support from 'Known Limitations'

Support for extended (11-bit) RACH has been implemented:

  - in libosmocoding: I85a34a82d5cd39a594ee89d91a2338226066ab5d,
  - and OsmoBTS: Ia28741603636406744e5e221fb7a9689955a.

We also have a TTCN-3 test case called TC_pcu_ext_rach_content,
see I8fe156aeac9de3dc1e71a4950821d4942ba9a253.

Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
---
M README.md
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/README.md b/README.md
index 38b4bd9..01ec0ff 100644
--- a/README.md
+++ b/README.md
@@ -123,4 +123,3 @@

  * TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865)
  * No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855)
- * No 11bit RACH support (https://osmocom.org/issues/1854)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
Gerrit-Change-Number: 5833
Gerrit-PatchSet: 3
Gerrit-Owner: Alexander Huemer 
Gerrit-Assignee: fixeria 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Alexander Chemeris 
Gerrit-CC: fixeria 


Change in osmo-msc[master]: SMPP: Don't accept password or system-id exceeding spec length

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13930 )

Change subject: SMPP: Don't accept password or system-id exceeding spec length
..

SMPP: Don't accept password or system-id exceeding spec length

The SMPP 3.4 specification defines the password field as a
"Variable-length octet string with maximum length of 9", and according
to table 3-1 this means including the terminating NUL-byte.

However, OsmoMSC allows to configure longer passwords in the ESME
configuration. Those passwords will then never match, as libsmpp34
performs length validation and generates a parser error for anyone
trying to send a longer password via SMPP.

The same applies for system-id, where we have to permit only 15
characters with zero termination, but not 16 characters.

Change-Id: I81ef593e84bf1e15f6746386fc145495fae29354
Closes: OS#3166
---
M src/libmsc/smpp_smsc.h
1 file changed, 2 insertions(+), 2 deletions(-)

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

Objections:
  Pau Espin Pedrol: I would prefer this is not merged as is



diff --git a/src/libmsc/smpp_smsc.h b/src/libmsc/smpp_smsc.h
index 1c9eae6..b26d011 100644
--- a/src/libmsc/smpp_smsc.h
+++ b/src/libmsc/smpp_smsc.h
@@ -13,8 +13,8 @@
 #include 
 #include 

-#define SMPP_SYS_ID_LEN16
-#define SMPP_PASSWD_LEN16
+#define SMPP_SYS_ID_LEN15
+#define SMPP_PASSWD_LEN8

 #define MODE_7BIT  7
 #define MODE_8BIT  8

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I81ef593e84bf1e15f6746386fc145495fae29354
Gerrit-Change-Number: 13930
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations'

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/5833 )

Change subject: Remove 11-bit RACH support from 'Known Limitations'
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
Gerrit-Change-Number: 5833
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Huemer 
Gerrit-Assignee: fixeria 
Gerrit-Reviewer: Alexander Huemer 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Alexander Chemeris 
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Fri, 10 May 2019 07:09:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-gsm-tester[master]: virtual: Make it possible to add tests to the ms driver

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13826 )

Change subject: virtual: Make it possible to add tests to the ms driver
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia65ee53987e92b24e6b8c40e1376bc74dc260180
Gerrit-Change-Number: 13826
Gerrit-PatchSet: 3
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 07:11:37 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13945 )

Change subject: call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED
..

call_leg: remove unused event MSC_EV_CALL_LEG_RTP_RELEASED

The event is actually never dispatched and useless, because when an RTP stream
releases, the call_leg terminates directly anyway (which wasn't apparent when
starting to design the call_leg FSM yet).

Change-Id: I6b2fc1225c960fa2f7c46adf241520217a07821c
---
M include/osmocom/msc/call_leg.h
M include/osmocom/msc/msc_roles.h
M src/libmsc/call_leg.c
M src/libmsc/msc_a.c
M src/libmsc/msc_i.c
M src/libmsc/msc_t.c
6 files changed, 8 insertions(+), 45 deletions(-)

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



diff --git a/include/osmocom/msc/call_leg.h b/include/osmocom/msc/call_leg.h
index b8126e8..61107ee 100644
--- a/include/osmocom/msc/call_leg.h
+++ b/include/osmocom/msc/call_leg.h
@@ -36,7 +36,6 @@

uint32_t parent_event_rtp_addr_available;
uint32_t parent_event_rtp_complete;
-   uint32_t parent_event_rtp_released;

/* For internal MNCC, if RTP addresses for endpoints become assigned by 
the MGW, implicitly notify the other
 * call leg's RTP_TO_CN side rtp_stream with 
rtp_stream_remote_addr_available(). */
@@ -58,15 +57,13 @@
 struct call_leg *call_leg_alloc(struct osmo_fsm_inst *parent_fi,
uint32_t parent_event_term,
uint32_t parent_event_rtp_addr_available,
-   uint32_t parent_event_rtp_complete,
-   uint32_t parent_event_rtp_released);
+   uint32_t parent_event_rtp_complete);

 void call_leg_reparent(struct call_leg *cl,
   struct osmo_fsm_inst *parent_fi,
   uint32_t parent_event_term,
   uint32_t parent_event_rtp_addr_available,
-  uint32_t parent_event_rtp_complete,
-  uint32_t parent_event_rtp_released);
+  uint32_t parent_event_rtp_complete);

 int call_leg_local_bridge(struct call_leg *cl1, uint32_t call_id1, struct 
gsm_trans *trans1,
  struct call_leg *cl2, uint32_t call_id2, struct 
gsm_trans *trans2);
diff --git a/include/osmocom/msc/msc_roles.h b/include/osmocom/msc/msc_roles.h
index a1fab2f..b22bc7b 100644
--- a/include/osmocom/msc/msc_roles.h
+++ b/include/osmocom/msc/msc_roles.h
@@ -148,7 +148,6 @@

MSC_EV_CALL_LEG_RTP_LOCAL_ADDR_AVAILABLE,
MSC_EV_CALL_LEG_RTP_COMPLETE,
-   MSC_EV_CALL_LEG_RTP_RELEASED,
MSC_EV_CALL_LEG_TERM,

/* MNCC has told us to RTP_CREATE, but local RTP port has not yet been 
set up.
diff --git a/src/libmsc/call_leg.c b/src/libmsc/call_leg.c
index cb7e6ea..1b7db2b 100644
--- a/src/libmsc/call_leg.c
+++ b/src/libmsc/call_leg.c
@@ -67,8 +67,7 @@
 struct call_leg *call_leg_alloc(struct osmo_fsm_inst *parent_fi,
uint32_t parent_event_term,
uint32_t parent_event_rtp_addr_available,
-   uint32_t parent_event_rtp_complete,
-   uint32_t parent_event_rtp_released)
+   uint32_t parent_event_rtp_complete)
 {
struct call_leg *cl;
struct osmo_fsm_inst *fi = osmo_fsm_inst_alloc_child(&call_leg_fsm, 
parent_fi, parent_event_term);
@@ -82,7 +81,6 @@
.fi = fi,
.parent_event_rtp_addr_available = 
parent_event_rtp_addr_available,
.parent_event_rtp_complete = parent_event_rtp_complete,
-   .parent_event_rtp_released = parent_event_rtp_released,
};

return cl;
@@ -92,8 +90,7 @@
   struct osmo_fsm_inst *new_parent_fi,
   uint32_t parent_event_term,
   uint32_t parent_event_rtp_addr_available,
-  uint32_t parent_event_rtp_complete,
-  uint32_t parent_event_rtp_released)
+  uint32_t parent_event_rtp_complete)
 {
LOG_CALL_LEG(cl, LOGL_DEBUG, "Reparenting from parent %s to parent 
%s\n",
 cl->fi->proc.parent->name, new_parent_fi->name);
@@ -101,7 +98,6 @@
talloc_steal(new_parent_fi, cl->fi);
cl->parent_event_rtp_addr_available = parent_event_rtp_addr_available;
cl->parent_event_rtp_complete = parent_event_rtp_complete;
-   cl->parent_event_rtp_released = parent_event_rtp_released;
 }

 static int call_leg_fsm_timer_cb(struct osmo_fsm_inst *fi)
diff --git a/src/libmsc/msc_a.c b/src/libmsc/msc_a.c
index 5baed54..77dd43d 100644
--- a/src/libmsc/msc_a.c
+++ b/src/libmsc/msc_a.c
@@ -546,28 +546,15 @@

 static void msc_a_cleanup_rtp_

Build failed in Jenkins: master-osmo-gmr » a1=default,a2=default,a3=default,a4=default,osmocom-master-debian9 #1851

2019-05-10 Thread jenkins
See 


--
[...truncated 53.96 KB...]
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
--
make[3]: Leaving directory 
'
make[2]: Leaving directory 
'
Making install in src/gb
make[2]: Entering directory 
'
  CC   gprs_ns.lo
  CC   gprs_ns_frgre.lo
  CC   gprs_ns_vty.lo
  CC   gprs_ns_sns.lo
  CC   gprs_bssgp.lo
  CC   gprs_bssgp_util.lo
  CC   gprs_bssgp_vty.lo
  CC   gprs_bssgp_bss.lo
  CC   common_vty.lo
  CCLD libosmogb.la
make[3]: Entering directory 
'
make[3]: Nothing to be done for 'install-data-am'.
 /bin/mkdir -p 
'
 /bin/bash ../../libtool   --mode=install /usr/bin/install -c   libosmogb.la 
'
libtool: warning: relinking 'libosmogb.la'
libtool: install: (cd 

 /bin/bash 
"
  --silent --tag CC --mode=relink gcc -Wall -fno-strict-aliasing -g -O2 
-DBUILDING_LIBOSMOCORE -Wall -Wl,--version-script=./libosmogb.map -version-info 
9:0:0 -o libosmogb.la -rpath 

 gprs_ns.lo gprs_ns_frgre.lo gprs_ns_vty.lo gprs_ns_sns.lo gprs_bssgp.lo 
gprs_bssgp_util.lo gprs_bssgp_vty.lo gprs_bssgp_bss.lo common_vty.lo -ltalloc 
../../src/libosmocore.la ../../src/vty/libosmovty.la 
../../src/gsm/libosmogsm.la )
libtool: install: /usr/bin/install -c .libs/libosmogb.so.9.0.0T 

libtool: install: (cd 

 && { ln -s -f libosmogb.so.9.0.0 libosmogb.so.9 || { rm -f libosmogb.so.9 && 
ln -s libosmogb.so.9.0.0 libosmogb.so.9; }; })
libtool: install: (cd 

 && { ln -s -f libosmogb.so.9.0.0 libosmogb.so || { rm -f libosmogb.so && ln -s 
libosmogb.so.9.0.0 libosmogb.so; }; })
libtool: install: /usr/bin/install -c .libs/libosmogb.lai 

libtool: finish: 
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games:/home/osmocom-build/bin:/sbin" 
ldconfig -n 

--
Libraries have been installed in:
   


If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
 during execution
   - add LIBDIR to the 'LD_RUN_PATH' en

Change in osmo-sgsn[master]: gprs_gmm: send Service Reject when no PDP ctxs are available.

2019-05-10 Thread Mykola Shchetinin
Hello lynxis lazus, Pau Espin Pedrol, Jenkins Builder,

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

https://gerrit.osmocom.org/13744

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

Change subject: gprs_gmm: send Service Reject when no PDP ctxs are available.
..

gprs_gmm: send Service Reject when no PDP ctxs are available.

Look at PDP Context Status IE: if there are any PDP contexts which are
ACTIVE on MS side and there are no PDP contexts which are ACTIVE on the
network side, then send Service Reject with the cause "NO PDP
ACTIVATED". This forces MS to reactivate the PDP contexts.

3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted
by the network. Cause # 40.

Fixes: OS#3937
Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
---
M src/gprs/gprs_gmm.c
M tests/sgsn/sgsn_test.c
M tests/sgsn/sgsn_test.ok
3 files changed, 43 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/13744/9
--
To view, visit https://gerrit.osmocom.org/13744
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
Gerrit-Change-Number: 13744
Gerrit-PatchSet: 9
Gerrit-Owner: Mykola Shchetinin 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Mykola Shchetinin 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 


Change in libosmocore[master]: osmo_sock_get_name_*: Ensure string is returned in error case

2019-05-10 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13960


Change subject: osmo_sock_get_name_*: Ensure string is returned in error case
..

osmo_sock_get_name_*: Ensure string is returned in error case

osmo_sock_get_name_buf():
In case the getsockname() call is failing for some weird reason,
we shouldn't return an uninitialized, non-zero-terminated string
buffer to the caller, as most callers will be too lazy to test the
return value.

This holds even more true for users of the internal
osmo_sock_get_name2() and osmo_sock_get_name2_c() functions which indeed
very much ignore the return value of osmo_sock_get_name_buf().

Change-Id: I2d56327e96b7a6783cca38b828c5ee74aed776ae
---
M src/socket.c
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/13960/1

diff --git a/src/socket.c b/src/socket.c
index 7c412b6..78c0a58 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -805,12 +805,16 @@
int rc;

/* get local */
-   if ((rc = osmo_sock_get_ip_and_port(fd, hostbuf_l, sizeof(hostbuf_l), 
portbuf_l, sizeof(portbuf_l), true)))
+   if ((rc = osmo_sock_get_ip_and_port(fd, hostbuf_l, sizeof(hostbuf_l), 
portbuf_l, sizeof(portbuf_l), true))) {
+   osmo_strlcpy(str, "", str_len);
return rc;
+   }

/* get remote */
-   if (osmo_sock_get_ip_and_port(fd, hostbuf_r, sizeof(hostbuf_r), 
portbuf_r, sizeof(portbuf_r), false) != 0)
+   if (osmo_sock_get_ip_and_port(fd, hostbuf_r, sizeof(hostbuf_r), 
portbuf_r, sizeof(portbuf_r), false) != 0) {
+   osmo_strlcpy(str, "", str_len);
return snprintf(str, str_len, "r=NULL<->l=%s:%s", hostbuf_l, 
portbuf_l);
+   }

return snprintf(str, str_len, "r=%s:%s<->l=%s:%s", hostbuf_r, 
portbuf_r, hostbuf_l, portbuf_l);
 }

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


Change in libosmocore[master]: Add basic test for llist counter and empty check

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/11875 )

Change subject: Add basic test for llist counter and empty check
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ie1c15c330213849f089032ca742e709e4349b26e
Gerrit-Change-Number: 11875
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 


Change in libosmocore[master]: Add basic test for llist counter and empty check

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11875 )

Change subject: Add basic test for llist counter and empty check
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11875
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: Ie1c15c330213849f089032ca742e709e4349b26e
Gerrit-Change-Number: 11875
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 07:38:16 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: IPA: move duplicated error handling into function

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/11911 )

Change subject: IPA: move duplicated error handling into function
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ic0147bffaf04b0baf97e5cca22948bd0e116668f
Gerrit-Change-Number: 11911
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-pcu[master]: Remove ASAN preprocessor warning

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/6001 )

Change subject: Remove ASAN preprocessor warning
..


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Idaabb4203a282be6779d7ab29de3f827b0ca6462
Gerrit-Change-Number: 6001
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 


Change in osmo-ttcn3-hacks[master]: MGCP: fix pattern warning

2019-05-10 Thread Harald Welte
Harald Welte has removed a vote on this change.

Change subject: MGCP: fix pattern warning
..


Removed Code-Review-1 by Harald Welte 
--
To view, visit https://gerrit.osmocom.org/12237
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I99948e4b82b5b4bd5b8f7c1a4c60a97fcab3c0eb
Gerrit-Change-Number: 12237
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in osmo-msc[master]: MNCC: internalize bridge error handling

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12331 )

Change subject: MNCC: internalize bridge error handling
..


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I66f6fac254d78dcf64bcb6aa4a443b899fb378a7
Gerrit-Change-Number: 12331
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


Change in libosmocore[master]: utils: drop redundant _SOURCES entries

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12392 )

Change subject: utils: drop redundant _SOURCES entries
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia0374e2d38e6bdc416eec182030af94b89d65ab7
Gerrit-Change-Number: 12392
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Harald Welte 


Change in libosmocore[master]: LCLS: drop boolean status_present from HO structs

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12369 )

Change subject: LCLS: drop boolean status_present from HO structs
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ib2958a8613627c4e54c004ffa3578c300ed0360b
Gerrit-Change-Number: 12369
Gerrit-PatchSet: 8
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in libosmocore[master]: NS: log address:port on error

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11636 )

Change subject: NS: log address:port on error
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11636
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: If2dc533a6dc150254f5d44b672f04bb728e7e927
Gerrit-Change-Number: 11636
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 08:01:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: NS: log address:port on error

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11636 )

Change subject: NS: log address:port on error
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11636
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: If2dc533a6dc150254f5d44b672f04bb728e7e927
Gerrit-Change-Number: 11636
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 08:02:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: MGCP: fix pattern warning

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12237 )

Change subject: MGCP: fix pattern warning
..


Set Ready For Review


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I99948e4b82b5b4bd5b8f7c1a4c60a97fcab3c0eb
Gerrit-Change-Number: 12237
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Fri, 10 May 2019 08:03:08 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-sgsn[master]: Fix IMSI padding in imsi-acl

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11838 )

Change subject: Fix IMSI padding in imsi-acl
..


Set Ready For Review


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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I26e4aa44f159d1b5b91dda4a586fd4e809711245
Gerrit-Change-Number: 11838
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 08:03:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in pysim[master]: Don't try to parse result if select_file() failed

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12462 )

Change subject: Don't try to parse result if select_file() failed
..


Set Ready For Review


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I25b859374e33654e58d07061926bf8529eab87f3
Gerrit-Change-Number: 12462
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Kévin Redon 
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Fri, 10 May 2019 08:03:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: osmo_sock_get_name_*: Ensure string is returned in error case

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13960 )

Change subject: osmo_sock_get_name_*: Ensure string is returned in error case
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13960
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: I2d56327e96b7a6783cca38b828c5ee74aed776ae
Gerrit-Change-Number: 13960
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 08:02:15 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-sgsn[master]: Fix IMSI padding in imsi-acl

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11838 )

Change subject: Fix IMSI padding in imsi-acl
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I26e4aa44f159d1b5b91dda4a586fd4e809711245
Gerrit-Change-Number: 11838
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 08:04:19 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: clear GPRS indicator in SI3 while PCU is disconnected

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10170 )

Change subject: clear GPRS indicator in SI3 while PCU is disconnected
..


Set Ready For Review


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Gerrit-Change-Number: 10170
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 10 May 2019 08:03:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: add a test for LU with invalid LAI

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12380 )

Change subject: add a test for LU with invalid LAI
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/12380/2/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/12380/2/msc/MSC_Tests.ttcn@2839
PS2, Line 2839: 
l3_lu.msgs.mm.locationUpdateRequest.locationAreaIdentification.mcc_mnc
I think this is outright wrong.  In GMM (layer3) which originates from within 
the phone, the LAI of the *previous* cell will be reported.  So let's say you 
cross the border from DE to FR, then in the first LU in FR, your MS will report 
the LAI from DE.

What you probably want to test here is that the Cell Identifier IE on the 
BSSMAP level in the complete layer3 info (generated by BSC) matches the MCC/MNC 
that's expected.   so basically you would verify if the BSC MCC/MNC is 
configured correctly.



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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I676894358259b9cc0f973769ce552ba58a2a58a1
Gerrit-Change-Number: 12380
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 09:19:48 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: add a test for LU with invalid LAI

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12380 )

Change subject: add a test for LU with invalid LAI
..


Patch Set 2: Code-Review-2


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I676894358259b9cc0f973769ce552ba58a2a58a1
Gerrit-Change-Number: 12380
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 09:19:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: gsm_23_003: add GSM23003_MSISDN_{MIN, MAX}_DIGITS

2019-05-10 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13961


Change subject: gsm_23_003: add GSM23003_MSISDN_{MIN,MAX}_DIGITS
..

gsm_23_003: add GSM23003_MSISDN_{MIN,MAX}_DIGITS

Add the constant, so it can be used in create-subscriber-on-demand
related patches. ITU-T Rec. E.164 6.1 states that maximum international
number length should be 15. I did not find a source for a minimum
length, but I've added the constant and set it to 1 for consistency
(based on the existing osmo_msisdn_str_valid() function).

Related: OS#2542
Change-Id: Idc74f4d94ad44b9fc1b6d43178f5f33d551ebfb1
---
M include/osmocom/gsm/protocol/gsm_23_003.h
M src/gsm/gsm23003.c
2 files changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/13961/1

diff --git a/include/osmocom/gsm/protocol/gsm_23_003.h 
b/include/osmocom/gsm/protocol/gsm_23_003.h
index be1b157..3e5c3e5 100644
--- a/include/osmocom/gsm/protocol/gsm_23_003.h
+++ b/include/osmocom/gsm/protocol/gsm_23_003.h
@@ -20,6 +20,9 @@
 #define GSM23003_MME_CODE_NUM_BYTES1
 #define GSM23003_MME_GROUP_NUM_BYTES   2
 #define GSM23003_MTMSI_NUM_BYTES   4
+/* Chapter 3.2 */
+#define GSM23003_MSISDN_MAX_DIGITS 15 /* ITU-T Rec. E.164 6.1 */
+#define GSM23003_MSISDN_MIN_DIGITS 1
 /* Chapter 6.2.1 */
 #define GSM23003_IMEI_TAC_NUM_DIGITS   8
 #define GSM23003_IMEI_SNR_NUM_DIGITS   6
diff --git a/src/gsm/gsm23003.c b/src/gsm/gsm23003.c
index 2252f70..a97ed07 100644
--- a/src/gsm/gsm23003.c
+++ b/src/gsm/gsm23003.c
@@ -69,7 +69,7 @@
  */
 bool osmo_msisdn_str_valid(const char *msisdn)
 {
-   return is_n_digits(msisdn, 1, 15);
+   return is_n_digits(msisdn, GSM23003_MSISDN_MIN_DIGITS, 
GSM23003_MSISDN_MAX_DIGITS);
 }

 /*! Determine whether the given IMEI is valid according to 3GPP TS 23.003,

--
To view, visit https://gerrit.osmocom.org/13961
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: Idc74f4d94ad44b9fc1b6d43178f5f33d551ebfb1
Gerrit-Change-Number: 13961
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in libosmocore[master]: Revert "Print error message if application fails to call rate_ctr_ini...

2019-05-10 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13962


Change subject: Revert "Print error message if application fails to call 
rate_ctr_init()"
..

Revert "Print error message if application fails to call rate_ctr_init()"

This reverts commit 9685a48c7bc83b1f5ee9b51e29419164b387ade2 which has
caused massive fall-out among (particularly) unit tests in osmo-{msc,bts,pcu}.

Change-Id: Iede72e86451d94cf678045992cb71f6b1bf16896
---
M src/rate_ctr.c
1 file changed, 2 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/13962/1

diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 99ec523..026670b 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -69,7 +69,7 @@
 #include 

 static LLIST_HEAD(rate_ctr_groups);
-static struct osmo_timer_list rate_ctr_timer;
+
 static void *tall_rate_ctr_ctx;


@@ -217,10 +217,6 @@
unsigned int size;
struct rate_ctr_group *group;

-   if (!osmo_timer_pending(&rate_ctr_timer))
-   LOGP(DLGLOBAL, LOGL_ERROR, "your program appears to use 
libosmocore rate_ctr "
-   "without calling rate_ctr_init() at start-up. Rate 
counters won't work!\n");
-
if (rate_ctr_get_group_by_name_idx(desc->group_name_prefix, idx)) {
unsigned int new_idx = 
rate_ctr_get_unused_name_idx(desc->group_name_prefix);
LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' already exists 
for index %u,"
@@ -298,6 +294,7 @@
ctr->intv[intv+1].rate += ctr->intv[intv].rate;
 }

+static struct osmo_timer_list rate_ctr_timer;
 static uint64_t timer_ticks;

 /* The one-second interval has expired */

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


Change in osmo-ttcn3-hacks[master]: msc: Add a test for LU with invalid MCC/MNC in BSSAP/RANAP

2019-05-10 Thread Harald Welte
Harald Welte has uploaded a new patch set (#3) to the change originally created 
by Stefan Sperling. ( https://gerrit.osmocom.org/12380 )

Change subject: msc: Add a test for LU with invalid MCC/MNC in BSSAP/RANAP
..

msc: Add a test for LU with invalid MCC/MNC in BSSAP/RANAP

Verify that the MSC rejects a location update from a Cell/BSC that
contains a PLMN which does not match the core network's PLMN.

Related: OS#3162
Change-Id: I676894358259b9cc0f973769ce552ba58a2a58a1
---
M msc/MSC_Tests.ttcn
M msc/MSC_Tests_Iu.ttcn
2 files changed, 43 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I676894358259b9cc0f973769ce552ba58a2a58a1
Gerrit-Change-Number: 12380
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Vadim Yanitskiy 


Change in osmo-msc[master]: libmsc: Make sure to not dereference a NULL trans

2019-05-10 Thread tnt
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/13963


Change subject: libmsc: Make sure to not dereference a NULL trans
..

libmsc: Make sure to not dereference a NULL trans

All those were identified by gcc. At this point in the code, trans is
NULL and so you can't call LOG_TRANS because it will try to access the
log_subsys field.

Instead call LOG_TRANS_CAT with manually specified category where
applicable (or other logging primitive depending on what the surrounding
code does)

Change-Id: Ia14bd28e1db570c487ad8e90e29a69208e2226f2
Signed-off-by: Sylvain Munaut 
---
M src/libmsc/gsm_04_08_cc.c
M src/libmsc/gsm_04_11.c
M src/libmsc/gsm_09_11.c
M src/libmsc/transaction.c
4 files changed, 12 insertions(+), 12 deletions(-)



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

diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 2869bba..7d09e0e 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1888,7 +1888,7 @@
trans = trans_alloc(net, vsub, TRANS_CC,
TRANS_ID_UNASSIGNED, data->callref);
if (!trans) {
-   LOG_TRANS(trans, LOGL_ERROR, "No memory for trans.\n");
+   LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "No memory for 
trans.\n");
vlr_subscr_put(vsub, __func__);
/* Ressource unavailable */
mncc_release_ind(net, NULL, data->callref,
@@ -2102,12 +2102,12 @@
int i, rc = 0;

if (msg_type & 0x80) {
-   LOG_TRANS(trans, LOGL_DEBUG, "MSG 0x%2x not defined for PD 
error\n", msg_type);
+   LOG_TRANS_CAT(trans, DCC, LOGL_DEBUG, "MSG 0x%2x not defined 
for PD error\n", msg_type);
return -EINVAL;
}

if (!vsub) {
-   LOG_TRANS(trans, LOGL_ERROR, "Invalid conn: no subscriber\n");
+   LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "Invalid conn: no 
subscriber\n");
return -EINVAL;
}

@@ -2121,7 +2121,7 @@
TRANS_CC,
transaction_id, 
msc_cc_next_outgoing_callref());
if (!trans) {
-   LOG_TRANS(trans, LOGL_ERROR, "No memory for trans.\n");
+   LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "No memory for 
trans.\n");
rc = gsm48_tx_simple(msc_a,
 GSM48_PDISC_CC | (transaction_id 
<< 4),
 GSM48_MT_CC_RELEASE_COMPL);
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 22e55dd..d5c2516 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -1008,7 +1008,7 @@
/* Allocate a new transaction */
struct gsm_trans *trans = trans_alloc(net, vsub, TRANS_SMS, tid, 
new_callref++);
if (!trans) {
-   LOG_TRANS(trans, LOGL_ERROR, "No memory for transaction\n");
+   LOG_TRANS_CAT(trans, DLSMS, LOGL_ERROR, "No memory for 
transaction\n");
return NULL;
}

@@ -1072,7 +1072,7 @@
/* Generate a new transaction ID */
tid = trans_assign_trans_id(net, vsub, TRANS_SMS);
if (tid == -1) {
-   LOG_TRANS(trans, LOGL_ERROR, "No available transaction IDs\n");
+   LOG_TRANS_CAT(trans, DLSMS, LOGL_ERROR, "No available 
transaction IDs\n");
return NULL;
}

@@ -1227,7 +1227,7 @@
 * A transaction we created but don't know about?
 */
if (!trans && (transaction_id & 0x8) == 0) {
-   LOG_TRANS(trans, LOGL_ERROR, "trans_id=%x allocated by us but 
known "
+   LOG_TRANS_CAT(trans, DLSMS, LOGL_ERROR, "trans_id=%x allocated 
by us but known "
"to us anymore. We are ignoring it, maybe a CP-ERROR "
"from a MS?\n",
transaction_id);
diff --git a/src/libmsc/gsm_09_11.c b/src/libmsc/gsm_09_11.c
index 984cc53..500da3a 100644
--- a/src/libmsc/gsm_09_11.c
+++ b/src/libmsc/gsm_09_11.c
@@ -135,8 +135,8 @@
 * a supplementary service.
 */
if (msg_type != GSM0480_MTYPE_REGISTER) {
-   LOG_TRANS(trans, LOGL_ERROR, "Rx wrong SS/USSD message 
type for new transaction: %s\n",
- gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, 
msg_type));
+   LOG_MSC_A(msc_a, LOGL_ERROR, "Rx wrong SS/USSD message 
type for new transaction: %s\n",
+ gsm48_pdisc_msgtype_name(GSM48_PDISC_NC_SS, 
msg_type));
gsm48_tx_simple(msc_a,
GSM48_PDISC_NC_SS | (tid << 4),
GSM0480_MTYPE_RELEASE_COMPLETE);
@@ -145,7 +145,7 @@

  

Change in libosmocore[master]: Log: add stdout target

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12093 )

Change subject: Log: add stdout target
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ia786361f5f687e43b27d87a45b4630bca58bcfe8
Gerrit-Change-Number: 12093
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 


Change in osmo-msc[master]: Log: don't print CallRef prefix

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12570 )

Change subject: Log: don't print CallRef prefix
..


Abandoned

osmo-msc has changed too much
--
To view, visit https://gerrit.osmocom.org/12570
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Icae21a44c7d4010145bcb570187ce9b58092e5a9
Gerrit-Change-Number: 12570
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: Change GSM48_PDISC_* to enum type

2019-05-10 Thread Harald Welte
Harald Welte has uploaded a new patch set (#3) to the change originally created 
by Max. ( https://gerrit.osmocom.org/12572 )

Change subject: Change GSM48_PDISC_* to enum type
..

Change GSM48_PDISC_* to enum type

An enum is more clear than an int and #defines for passing around,
also in case you have a switch () statement, the compiler will issue
warnings for unhandled cases.

Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 20 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/12572/3
--
To view, visit https://gerrit.osmocom.org/12572
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
Gerrit-Change-Number: 12572
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Vadim Yanitskiy 


Change in libosmocore[master]: Revert "Print error message if application fails to call rate_ctr_ini...

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13962 )

Change subject: Revert "Print error message if application fails to call 
rate_ctr_init()"
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13962
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: Iede72e86451d94cf678045992cb71f6b1bf16896
Gerrit-Change-Number: 13962
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 10:02:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: Add tests for transaction routines

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12556 )

Change subject: Add tests for transaction routines
..


Patch Set 11:

I presume the MSC has changed too far to still make use of this? In that case, 
please aandon.


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I78dfb7cd35073a305cf668beda7d9d58d5a5a713
Gerrit-Change-Number: 12556
Gerrit-PatchSet: 11
Gerrit-Owner: Max 
Gerrit-Assignee: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:03:11 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: Revert "Print error message if application fails to call rate_ctr_ini...

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13962 )

Change subject: Revert "Print error message if application fails to call 
rate_ctr_init()"
..

Revert "Print error message if application fails to call rate_ctr_init()"

This reverts commit 9685a48c7bc83b1f5ee9b51e29419164b387ade2 which has
caused massive fall-out among (particularly) unit tests in osmo-{msc,bts,pcu}.

Change-Id: Iede72e86451d94cf678045992cb71f6b1bf16896
---
M src/rate_ctr.c
1 file changed, 2 insertions(+), 5 deletions(-)

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



diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 99ec523..026670b 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -69,7 +69,7 @@
 #include 

 static LLIST_HEAD(rate_ctr_groups);
-static struct osmo_timer_list rate_ctr_timer;
+
 static void *tall_rate_ctr_ctx;


@@ -217,10 +217,6 @@
unsigned int size;
struct rate_ctr_group *group;

-   if (!osmo_timer_pending(&rate_ctr_timer))
-   LOGP(DLGLOBAL, LOGL_ERROR, "your program appears to use 
libosmocore rate_ctr "
-   "without calling rate_ctr_init() at start-up. Rate 
counters won't work!\n");
-
if (rate_ctr_get_group_by_name_idx(desc->group_name_prefix, idx)) {
unsigned int new_idx = 
rate_ctr_get_unused_name_idx(desc->group_name_prefix);
LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' already exists 
for index %u,"
@@ -298,6 +294,7 @@
ctr->intv[intv+1].rate += ctr->intv[intv].rate;
 }

+static struct osmo_timer_list rate_ctr_timer;
 static uint64_t timer_ticks;

 /* The one-second interval has expired */

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


Change in libosmocore[master]: LCLS: don't encode incorrect values

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12375 )

Change subject: LCLS: don't encode incorrect values
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I9ac4bae75f5796e6e11346b8cb34d3897ae70b59
Gerrit-Change-Number: 12375
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 


Change in libosmocore[master]: osmo_sock_get_name_*: Ensure string is returned in error case

2019-05-10 Thread Mykola Shchetinin
Mykola Shchetinin has posted comments on this change. ( 
https://gerrit.osmocom.org/13960 )

Change subject: osmo_sock_get_name_*: Ensure string is returned in error case
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/13960/1/src/socket.c
File src/socket.c:

https://gerrit.osmocom.org/#/c/13960/1/src/socket.c@815
PS1, Line 815:  osmo_strlcpy(str, "", str_len);
Isn't str rewritten in the following line (call to snprintf)?



--
To view, visit https://gerrit.osmocom.org/13960
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: I2d56327e96b7a6783cca38b828c5ee74aed776ae
Gerrit-Change-Number: 13960
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Mykola Shchetinin 
Gerrit-Comment-Date: Fri, 10 May 2019 10:04:30 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: Add function to estimate elapsed time

2019-05-10 Thread Harald Welte
Harald Welte has removed a vote on this change.

Change subject: Add function to estimate elapsed time
..


Removed Code-Review+2 by Harald Welte 
--
To view, visit https://gerrit.osmocom.org/5103
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I83d865ff633a7ebda2c943477205fd31aceda277
Gerrit-Change-Number: 5103
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-hlr[master]: Create subscribers on demand

2019-05-10 Thread osmith
osmith has uploaded a new patch set (#3) to the change originally created by 
Vadim Yanitskiy. ( https://gerrit.osmocom.org/13713 )

Change subject: Create subscribers on demand
..

Create subscribers on demand

Add a new vty option and allow to optionally generate a random msisdn,
as well as setting the default NAM:

subscriber-create-on-demand (no-extension|<3-15>) (none|cs|ps|both)

Thanks to Vadim for the random MSISDN patch [1], which was squashed into
this one.

[1] Change-Id: I475c71f9902950fa7498855a616e1ec231fad6ac

Related: OS#2542
Depends on: Idc74f4d94ad44b9fc1b6d43178f5f33d551ebfb1 (libosmocore)
Change-Id: I0c9fe93f5c24b5e9fefb513c4d049fb7ebd47ecd
---
M src/hlr.c
M src/hlr.h
M src/hlr_vty.c
M tests/test_nodes.vty
A tests/test_subscr_create_on_demand.vty
5 files changed, 169 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0c9fe93f5c24b5e9fefb513c4d049fb7ebd47ecd
Gerrit-Change-Number: 13713
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-hlr[master]: Document subscribers create on demand feature

2019-05-10 Thread osmith
osmith has uploaded a new patch set (#4) to the change originally created by 
Vadim Yanitskiy. ( https://gerrit.osmocom.org/13715 )

Change subject: Document subscribers create on demand feature
..

Document subscribers create on demand feature

Add a new section in the subscribers chapter, with detailed explanation
of the use cases and related OsmoHLR and OsmoMSC configuration.

Related: OS#2542
Change-Id: I2dd4a56f7b8be8b5d0e6fc32e04459e5e278d0a9
---
M doc/manuals/chapters/subscribers.adoc
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13715/4
--
To view, visit https://gerrit.osmocom.org/13715
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2dd4a56f7b8be8b5d0e6fc32e04459e5e278d0a9
Gerrit-Change-Number: 13715
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmocom-bb[master]: bsic decoding of neighbour cells in dedicated mode and partially succ...

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/5490 )

Change subject: bsic decoding of neighbour cells in dedicated mode and 
partially success in synchronized handover
..


Abandoned

unfortunately the original submitter went away without adressing any of the 
review comments.  Very sad to see :(
--
To view, visit https://gerrit.osmocom.org/5490
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Ib01460b796d2107c4599d327e184eb42340999d2
Gerrit-Change-Number: 5490
Gerrit-PatchSet: 1
Gerrit-Owner: Muhammad Awais Aslam 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 


Change in osmo-ttcn3-hacks[master]: add three tests for CIPHER MODE COMPLETE without algo

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12347 )

Change subject: add three tests for CIPHER MODE COMPLETE without algo
..


Set Ready For Review


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1a2a126795c544613a7a87e238e1fc8c4e943885
Gerrit-Change-Number: 12347
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 10:09:38 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-hlr[master]: db_hlr.c: db_subscr_create(): add flags argument

2019-05-10 Thread osmith
osmith has uploaded a new patch set (#3) to the change originally created by 
Vadim Yanitskiy. ( https://gerrit.osmocom.org/13711 )

Change subject: db_hlr.c: db_subscr_create(): add flags argument
..

db_hlr.c: db_subscr_create(): add flags argument

Allow creating new subscribers without giving them access to CS or PS.
This will be used by the create-subscriber-on-demand feature.

Related: OS#2542
Change-Id: I1a6dd85387723dab5487c53b33d2d9ec6d05d006
---
M src/db.c
M src/db.h
M src/db_hlr.c
M src/hlr_db_tool.c
M src/hlr_vty_subscr.c
M tests/db/db_test.c
M tests/db/db_test.err
7 files changed, 100 insertions(+), 37 deletions(-)


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1a6dd85387723dab5487c53b33d2d9ec6d05d006
Gerrit-Change-Number: 13711
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in libosmocore[master]: Add osmo_init_logging_std*()

2019-05-10 Thread Harald Welte
Harald Welte has abandoned this change. ( https://gerrit.osmocom.org/12094 )

Change subject: Add osmo_init_logging_std*()
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I0fe8dc4a41aba4e4509540266e229700e8ec083c
Gerrit-Change-Number: 12094
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Pau Espin Pedrol 


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

2019-05-10 Thread jenkins
See 




Change in osmo-hlr[master]: db_hlr.c: db_subscr_create(): add flags argument

2019-05-10 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13711 )

Change subject: db_hlr.c: db_subscr_create(): add flags argument
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/13711/2/src/db.h
File src/db.h:

https://gerrit.osmocom.org/#/c/13711/2/src/db.h@121
PS2, Line 121:
> a bitmask makes a lot of sense. […]
Done, using a bitmask now.



--
To view, visit https://gerrit.osmocom.org/13711
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: I1a6dd85387723dab5487c53b33d2d9ec6d05d006
Gerrit-Change-Number: 13711
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Fri, 10 May 2019 10:11:07 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: Create subscribers on demand

2019-05-10 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13713 )

Change subject: Create subscribers on demand
..


Patch Set 3:

(5 comments)

jenkins will fail to build this, due to the libosmocore dependency.

https://gerrit.osmocom.org/#/c/13713/2/src/hlr.h
File src/hlr.h:

https://gerrit.osmocom.org/#/c/13713/2/src/hlr.h@63
PS2, Line 63: uin
> unsigned
Done


https://gerrit.osmocom.org/#/c/13713/2/src/hlr.c
File src/hlr.c:

https://gerrit.osmocom.org/#/c/13713/2/src/hlr.c@154
PS2, Line 154:
> AFAIR, I just used a random number, because in the original patch the MSISDN 
> length was hard-coded. […]
I've added the constant here, and use that in the next patch:
https://gerrit.osmocom.org/#/c/libosmocore/+/13961


https://gerrit.osmocom.org/#/c/13713/2/src/hlr.c@178
PS2, Line 178: if (!rc)
> I just realized that we may end up with an infinity loop here, if 
> osmo_get_rand_id() constantly fail […]
Done


https://gerrit.osmocom.org/#/c/13713/2/src/hlr_vty.c
File src/hlr_vty.c:

https://gerrit.osmocom.org/#/c/13713/2/src/hlr_vty.c@362
PS2, Line 362: efau
> it's a bit tricky.  I think 3GPP calls it "combined".  You can e.g. […]
Changed to "cs+ps"


https://gerrit.osmocom.org/#/c/13713/2/src/hlr_vty.c@365
PS2, Line 365: ircuit and packet switched NAM
> I thought it's "Network Access Mode" :D
lol, wikipedia tricked me there ;D



--
To view, visit https://gerrit.osmocom.org/13713
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: I0c9fe93f5c24b5e9fefb513c4d049fb7ebd47ecd
Gerrit-Change-Number: 13713
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Fri, 10 May 2019 10:11:30 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: add three tests for CIPHER MODE COMPLETE without algo

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12347 )

Change subject: add three tests for CIPHER MODE COMPLETE without algo
..


Patch Set 1:

(1 comment)

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

https://gerrit.osmocom.org/#/c/12347/1//COMMIT_MSG@14
PS1, Line 14: but they should somehow verify the
: cipher the MSC ends up using
The MSC is not using any cipher.  The BTS and the MS are implementing 
ciphering, under instruction from the MSC.



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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1a2a126795c544613a7a87e238e1fc8c4e943885
Gerrit-Change-Number: 12347
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Fri, 10 May 2019 10:12:19 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: add three tests for CIPHER MODE COMPLETE without algo

2019-05-10 Thread Harald Welte
Harald Welte has uploaded a new patch set (#2) to the change originally created 
by Stefan Sperling. ( https://gerrit.osmocom.org/12347 )

Change subject: add three tests for CIPHER MODE COMPLETE without algo
..

add three tests for CIPHER MODE COMPLETE without algo

Add three tests which exercise MSC behaviour when a CIPHER MODE
COMPLETE command lacks the optional chosenEncryptionAlgorithm IE.
Check for behaviour with A5/1, A5/3, and A5/1 + A5/3 configured
in the network, and expect the location update to succeed.

These tests pass on master, but they should somehow verify the
cipher the MSC ends up using. I am not quite sure how to do that.
Would inspecting the MSC's VTY be a reasonable approach? How
could his be done by code which runs on BSC_ConnectionHandler?

Change-Id: I1a2a126795c544613a7a87e238e1fc8c4e943885
Related: OS#2872
---
M library/BSSMAP_Templates.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.cfg
M msc/MSC_Tests.ttcn
4 files changed, 120 insertions(+), 0 deletions(-)


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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1a2a126795c544613a7a87e238e1fc8c4e943885
Gerrit-Change-Number: 12347
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-msc[master]: add BSC/MSC neighbor VTY commands for inter-MSC HO

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12446 )

Change subject: add BSC/MSC neighbor VTY commands for inter-MSC HO
..


Patch Set 2:

assigning to neels. I suppose this is obsolete now and can be abandoned?


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia0dd08b087bfd4aa22e234917669d003150a4cd4
Gerrit-Change-Number: 12446
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Assignee: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 10 May 2019 10:26:36 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmocom-bb[master]: firmware: implement reading of factory RF calibration values

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12887 )

Change subject: firmware: implement reading of factory RF calibration values
..


Set Ready For Review


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icf2693b751d86ec1d2563412d606c13d4c91a806
Gerrit-Change-Number: 12887
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Fri, 10 May 2019 10:27:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmocom-bb[master]: firmware: implement reading of factory RF calibration values

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12887 )

Change subject: firmware: implement reading of factory RF calibration values
..


Patch Set 5:

@fixeria, what does it take to get this merged?


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icf2693b751d86ec1d2563412d606c13d4c91a806
Gerrit-Change-Number: 12887
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Fri, 10 May 2019 10:28:11 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: build osmo-msc: add "missing" LIBASN1C_LIBS

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/7306 )

Change subject: build osmo-msc: add "missing" LIBASN1C_LIBS
..


Set Ready For Review


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I39ae5e3f0f7661ca9ee5c17a500be28c461d7ec7
Gerrit-Change-Number: 7306
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Fri, 10 May 2019 10:31:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-trx[master]: transceiver: RSSI was calculated reverse.

2019-05-10 Thread tnt
tnt has posted comments on this change. ( https://gerrit.osmocom.org/9598 )

Change subject: transceiver: RSSI was calculated reverse.
..


Patch Set 2:

The 'RSSI' definitely seems to be 'opposite' logic ... not sure why.
But the field in the 'TX' path is also the same, see line 360 during the  
scaling. Other parts seem to be as well. (see the noise math a bit below). It 
seems all pretty confusing and I don't really see why.

My only guess would be that someone wanted a uint8_t on the wire with '0' begin 
the 'max' and rising value meaning smaller signals received / transmitted. But 
then at someother point variables are named dBm (which it's definitely not).

I'm not sure if there is a document that specifies exactly what we want on the 
trx interface ?


--
To view, visit https://gerrit.osmocom.org/9598
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: Iaa4eda4660dbe155ac1c782b77316ef504ef00c5
Gerrit-Change-Number: 9598
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Assignee: tnt 
Gerrit-Reviewer: Alexander Chemeris 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Pau Espin Pedrol 
Gerrit-CC: tnt 
Gerrit-Comment-Date: Fri, 10 May 2019 10:32:00 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: gsm_23_003: add GSM23003_MSISDN_{MIN, MAX}_DIGITS

2019-05-10 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13961 )

Change subject: gsm_23_003: add GSM23003_MSISDN_{MIN,MAX}_DIGITS
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/13961/1/include/osmocom/gsm/protocol/gsm_23_003.h
File include/osmocom/gsm/protocol/gsm_23_003.h:

https://gerrit.osmocom.org/#/c/13961/1/include/osmocom/gsm/protocol/gsm_23_003.h@24
PS1, Line 24: GSM23003_MSISDN_MAX_DIGITS
Regarding random MSISDN generation, we're really lucky :) OSMO_MAX_RAND_ID_LEN 
is 16, so we can safely use osmo_get_rand_id() for that.



--
To view, visit https://gerrit.osmocom.org/13961
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: Idc74f4d94ad44b9fc1b6d43178f5f33d551ebfb1
Gerrit-Change-Number: 13961
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:36:31 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Change GSM48_PDISC_* to enum type

2019-05-10 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/12572 )

Change subject: Change GSM48_PDISC_* to enum type
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12572
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: Icbbe8786a776081d7643193f154e6270224399e6
Gerrit-Change-Number: 12572
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:38:31 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: coverity: add OsmocomBB (without firmware)

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13388 )

Change subject: coverity: add OsmocomBB (without firmware)
..

coverity: add OsmocomBB (without firmware)

Change-Id: I2a4bcca411361484e872361dfd16d46189f52f35
---
M coverity/build_Osmocom.sh
M coverity/prepare_source_Osmcocom.sh
2 files changed, 10 insertions(+), 0 deletions(-)

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



diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh
index 650fa0e..ef45b7a 100755
--- a/coverity/build_Osmocom.sh
+++ b/coverity/build_Osmocom.sh
@@ -61,6 +61,12 @@
popd
 }

+build_osmocombb() {
+   pushd osmocom-bb/src/
+   make nofirmware
+   popd
+}
+
 cd "$src_dir"

 rm -rf "$prefix"
@@ -92,3 +98,6 @@
 build_default osmo-sip-connector

 build_default osmo-trx
+
+# OsmocomBB (without firmware)
+build_osmocombb
diff --git a/coverity/prepare_source_Osmcocom.sh 
b/coverity/prepare_source_Osmcocom.sh
index 6f32474..065630f 100755
--- a/coverity/prepare_source_Osmcocom.sh
+++ b/coverity/prepare_source_Osmcocom.sh
@@ -26,6 +26,7 @@
   osmo-sip-connector \
   osmo-trx \
   osmo-hlr \
+  osmocom-bb \
   ; do

if [ -d $proj ]; then

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2a4bcca411361484e872361dfd16d46189f52f35
Gerrit-Change-Number: 13388
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-ci[master]: coverity: add OsmocomBB (without firmware)

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13388 )

Change subject: coverity: add OsmocomBB (without firmware)
..


Set Ready For Review


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2a4bcca411361484e872361dfd16d46189f52f35
Gerrit-Change-Number: 13388
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:42:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: ggsn: Verify that there are no duplicate PCO protocolIDs

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13563 )

Change subject: ggsn: Verify that there are no duplicate PCO protocolIDs
..


Patch Set 3: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/13563/3/ggsn_tests/GGSN_Tests.ttcn
File ggsn_tests/GGSN_Tests.ttcn:

https://gerrit.osmocom.org/#/c/13563/3/ggsn_tests/GGSN_Tests.ttcn@773
PS3, Line 773:  f_PCO_ensure_no_duplicates(ctx.pco_neg);
> What about adding this kind of check inside f_pdp_ctx_act so we don't need to 
> put it in every test? […]
I don't have time to work on this now, and I'd rather improve our test coverage 
with this test case than keep this out of master for another month :/



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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405
Gerrit-Change-Number: 13563
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 10 May 2019 10:46:03 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: ggsn: Verify that there are no duplicate PCO protocolIDs

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13563 )

Change subject: ggsn: Verify that there are no duplicate PCO protocolIDs
..

ggsn: Verify that there are no duplicate PCO protocolIDs

Introduce a function to verify there's no duplicate ProtocolIDs
in the PCO returned from the GGSN.

Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405
Related: OS#3914
---
M ggsn_tests/GGSN_Tests.ttcn
1 file changed, 37 insertions(+), 0 deletions(-)

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



diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index 398aed3..d793d27 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -726,6 +726,33 @@
T_default.stop;
}

+   /* list of protocols where we don't accept duplicates */
+   const OCT2List protocol_ids_nodupes := { 'C021'O, 'C023'O, 'C223'O, 
'8021'O };
+   private function f_PCO_permits_duplicates(OCT2 id) return boolean {
+   var integer i;
+   for (i := 0; i < lengthof(protocol_ids_nodupes); i := i+1) {
+   if (id == protocol_ids_nodupes[i]) {
+   return false;
+   }
+   }
+   return true;
+   }
+
+   /* ensure that every given protocol Identifier exist only exactly once 
in the PCO */
+   function f_PCO_ensure_no_duplicates(ProtConfigOptions pco) {
+   var OCT2List protocol_ids := {};
+   var integer i, j;
+   for (i := 0; i < lengthof(pco.protocols); i := i+1) {
+   var OCT2 id := pco.protocols[i].protocolID;
+   for (j := 0; j < lengthof(protocol_ids); j := j+1) {
+   if (not f_PCO_permits_duplicates(id) and id == 
protocol_ids[j]) {
+   setverdict(fail,  "Duplicate ProtocolID 
", id, " already present in ", pco.protocols);
+   }
+   }
+   protocol_ids := protocol_ids & { id };
+   }
+   }
+
/* Test IPv6 context activation for dynamic IPv6 EUA without request of 
IPv6 DNS */
testcase TC_pdp6_act_deact() runs on GT_CT {
f_init();
@@ -743,6 +770,7 @@
ctx.pco_req := valueof(ts_PCO_IPv6_DNS);
f_pdp_ctx_act(ctx);

+   f_PCO_ensure_no_duplicates(ctx.pco_neg);
/* verify PCO contains both primary and secondary DNS */
var OCT4 ggsn_ip6_dns1 := f_inet6_addr(m_ggsn_ip6_dns1);
if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 1), 
ggsn_ip6_dns1)) {
@@ -765,6 +793,7 @@
ctx.pco_req := valueof(ts_PCO_IPv6_DNS);
f_pdp_ctx_act(ctx);

+   f_PCO_ensure_no_duplicates(ctx.pco_neg);
//f_send_gtpu(ctx, c_router_solicit);
//f_send_gtpu(ctx, c_neigh_solicit);

@@ -865,6 +894,7 @@
var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), 
'1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn)));
ctx.pco_req := valueof(ts_PCO_IPv4_DNS_IPCP);
f_pdp_ctx_act(ctx);
+   f_PCO_ensure_no_duplicates(ctx.pco_neg);
/* verify IPCP is at all contained */
if (not match(ctx.pco_neg, tr_PCO_Contains('8021'O))) {
setverdict(fail, "IPCP not found in PCO");
@@ -888,6 +918,7 @@
ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT);
f_pdp_ctx_act(ctx);

+   f_PCO_ensure_no_duplicates(ctx.pco_neg);
/* verify PCO contains both primary and secondary DNS */
var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1);
if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 1), 
ggsn_ip4_dns1)) {
@@ -910,6 +941,7 @@
ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT);
f_pdp_ctx_act(ctx);

+   f_PCO_ensure_no_duplicates(ctx.pco_neg);
var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O);

/* Check if we can use valid global src addr, should work */
@@ -986,6 +1018,7 @@
/* PCO with primary DNS only */
ctx.pco_req := valueof(ts_PCO_IPv4_PRI_DNS_IPCP);
f_pdp_ctx_act(ctx);
+   f_PCO_ensure_no_duplicates(ctx.pco_neg);
pco_neg_dns := f_PCO_extract_proto(ctx.pco_neg, '8021'O, 1);
pco_neg_dns_expected := '020A8106'O & ggsn_ip4_dns1
/* Note: The prepended hex bytes encode the following 
information:
@@ -1063,10 +1096,12 @@
var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), 
'1234'O, c_ApnIn

Change in osmo-ttcn3-hacks[master]: library: Add PAP_Types for PPP Authentication Protocol (RFC 1334)

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13607 )

Change subject: library: Add PAP_Types for PPP Authentication Protocol (RFC 
1334)
..

library: Add PAP_Types for PPP Authentication Protocol (RFC 1334)

Change-Id: I31cb766bb701b8107df5de978d2b0b085977045a
---
A library/PAP_Types.ttcn
1 file changed, 90 insertions(+), 0 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/PAP_Types.ttcn b/library/PAP_Types.ttcn
new file mode 100644
index 000..4e3f14f
--- /dev/null
+++ b/library/PAP_Types.ttcn
@@ -0,0 +1,90 @@
+module PAP_Types {
+
+/* (C) 2019 by Harald Welte 
+ * All rights reserved.
+ *
+ * Released under the terms of GNU General Public License, Version 2 or
+ * (at your option) any later version.
+ */
+
+import from Osmocom_Types all;
+
+/* RFC1334 */
+type enumerated PapCode {
+   PAP_AuthenticateReq ('01'O),
+   PAP_AuthenticateAck ('02'O),
+   PAP_AuthenticateNak ('03'O)
+} with { variant "FIELDLENGTH(8)" };
+
+type record PapPacket {
+   PapCode code,
+   uint8_t identifier,
+   uint16_tlen,
+   PapPayloadUnion payload
+} with {
+   variant (len) "LENGTHTO(code,identifier,len,payload)"
+   variant (payload) "CROSSTAG( req, code = PAP_AuthenticateReq;
+ack, code = PAP_AuthenticateAck;
+nak, code = PAP_AuthenticateNak)"
+};
+
+type union PapPayloadUnion {
+   PapAuthReq  req,
+   PapAuthResp ack,
+   PapAuthResp nak
+};
+
+type record PapAuthReq {
+   uint8_t peer_id_len,
+   octetstring peer_id,
+   uint8_t passwd_len,
+   octetstring passwd
+} with {
+   variant (peer_id_len) "LENGTHTO(peer_id)"
+   variant (passwd_len) "LENGTHTO(passwd)"
+};
+
+type record PapAuthResp {
+   uint8_t msg_len,
+   charstring  msg
+} with { variant (msg_len) "LENGTHTO(msg)" };
+
+external function enc_PapPacket(in PapPacket inp) return octetstring
+with { extension "prototype(convert)" extension "encode(RAW)" };
+
+external function dec_PapPacket(in octetstring inp) return PapPacket
+with { extension "prototype(convert)" extension "decode(RAW)" };
+
+
+template (value) PapPacket ts_PAP(template (value) PapCode code, template 
(value) uint8_t identifier,
+ template (value) PapPayloadUnion payload) := {
+   code := code,
+   identifier := identifier,
+   len := 0, /* overwritten */
+   payload := payload
+}
+template PapPacket tr_PAP(template PapCode code, template uint8_t identifier, 
template PapPayloadUnion payload) := {
+   code := code,
+   identifier := identifier,
+   len := ?,
+   payload := payload
+}
+
+template (value) PapPacket ts_PAP_AuthReq(uint8_t identifier := 0, octetstring 
peer_id, octetstring passwd) :=
+   ts_PAP(PAP_AuthenticateReq, identifier,
+   { req := { peer_id_len := 0, peer_id := peer_id,
+  passwd_len := 0, passwd := passwd } });
+template PapPacket tr_PAP_AuthReq(template uint8_t identifier := ?, 
octetstring peer_id, octetstring passwd) :=
+   tr_PAP(PAP_AuthenticateReq, identifier,
+   { req := { peer_id_len := ?, peer_id := peer_id,
+  passwd_len := ?, passwd := passwd } });
+template (value) PapPacket ts_PAP_AuthAck(uint8_t identifier := 0, charstring 
msg) :=
+   ts_PAP(PAP_AuthenticateAck, identifier, { ack := { msg_len := 0, msg := 
msg } });
+template PapPacket tr_PAP_AuthAck(template uint8_t identifier := ?) :=
+   tr_PAP(PAP_AuthenticateAck, identifier, { ack := ? });
+template (value) PapPacket ts_PAP_AuthNak(uint8_t identifier := 0, charstring 
msg) :=
+   ts_PAP(PAP_AuthenticateNak, identifier, { nak := { msg_len := 0, msg := 
msg } });
+template PapPacket tr_PAP_AuthNak(template uint8_t identifier := ?) :=
+   tr_PAP(PAP_AuthenticateNak, identifier, { nak := ? });
+
+} with { encode "RAW" ; variant "FIELDORDER(msb)" }

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I31cb766bb701b8107df5de978d2b0b085977045a
Gerrit-Change-Number: 13607
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmo-netif[master]: Bump version: 0.4.0.1-738f → 0.5.0

2019-05-10 Thread Harald Welte
Harald Welte has uploaded this change for review. ( 
https://gerrit.osmocom.org/13964


Change subject: Bump version: 0.4.0.1-738f → 0.5.0
..

Bump version: 0.4.0.1-738f → 0.5.0

Change-Id: Iea2da939e259d0a9e7c5dad14d7a961434c276ef
---
M debian/changelog
M src/Makefile.am
2 files changed, 38 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/64/13964/1

diff --git a/debian/changelog b/debian/changelog
index 6c56148..e3b19c9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,40 @@
+libosmo-netif (0.5.0) unstable; urgency=medium
+
+  [ Max ]
+  * Stream examples: filter internal logging
+  * Stream examples: log sent/received bytes
+  * Stream examples: fix server's endless loop
+  * Add missing include
+  * Cosmetic: use #pragma once as include guard
+  * Stream client: fix doxygen typo
+  * Stream examples: print accepted client address
+  * Stream client: update logging
+  * Add socket name functions to stream client/server
+  * Stream client: fix disconnection logic
+  * Stream examples: fix typos in error message
+  * Ignore test binaries
+  * Stream client: report reconnection event as INFO
+  * Add stream client/server test
+  * Stream client: add disconnect callback
+  * Deprecate osmo_stream_cli_open2()
+
+  [ Philipp Maier ]
+  * AMR: add spec reference for AMR frame types
+  * AMR: add define constants for AMR payload length
+  * AMR: add functions to convert between bw-efficient and octet-aligned
+  * amr: cosmetic: correct sourcecode formatting
+  * amr: be sure result of osmo_amr_bwe_to_oa() fits into int buf
+  * amr: use sizeof(struct amr_hdr) when working with amr header length
+
+  [ Harald Welte ]
+  * debian: Add BuildDepends on libpcap0.8-dev
+
+  [ Oliver Smith ]
+  * gitignore: add amr_test
+  * tests: AM_LDFLAGS = -noinstall for all tests
+
+ -- Harald Welte   Fri, 10 May 2019 12:40:03 +0200
+
 libosmo-netif (0.4.0) unstable; urgency=medium

   [ Neels Hofmeyr ]
diff --git a/src/Makefile.am b/src/Makefile.am
index d92d0f6..4d8b900 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
 # This is _NOT_ the library release version, it's an API version.
 # Please read Chapter 6 "Library interface versions" of the libtool 
documentation before making any modification
-LIBVERSION=6:1:0
+LIBVERSION=7:0:1

 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)
 AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) 
$(LIBOSMOABIS_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS)

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

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea2da939e259d0a9e7c5dad14d7a961434c276ef
Gerrit-Change-Number: 13964
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte 


Change in osmo-ci[master]: coverity: add OsmocomBB (without firmware)

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13388 )

Change subject: coverity: add OsmocomBB (without firmware)
..


Patch Set 1: Code-Review+2

I'd say we give it a try


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2a4bcca411361484e872361dfd16d46189f52f35
Gerrit-Change-Number: 13388
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:42:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: coverity: add OsmocomBB (without firmware)

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13388 )

Change subject: coverity: add OsmocomBB (without firmware)
..


Patch Set 2: Verified+1


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2a4bcca411361484e872361dfd16d46189f52f35
Gerrit-Change-Number: 13388
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:43:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Change GSM48_PDISC_* to osmo_gsm48_pdisc enum type

2019-05-10 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded a new patch set (#4) to the change originally 
created by Max. ( https://gerrit.osmocom.org/12572 )

Change subject: Change GSM48_PDISC_* to osmo_gsm48_pdisc enum type
..

Change GSM48_PDISC_* to osmo_gsm48_pdisc enum type

An enum is more clear than an int and #defines for passing around,
also in case you have a switch () statement, the compiler will issue
warnings for unhandled cases.

Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
---
M include/osmocom/gsm/protocol/gsm_04_08.h
1 file changed, 20 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/12572/4
--
To view, visit https://gerrit.osmocom.org/12572
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Icbbe8786a776081d7643193f154e6270224399e6
Gerrit-Change-Number: 12572
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: NS: log address:port on error

2019-05-10 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11636 )

Change subject: NS: log address:port on error
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/11636
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: If2dc533a6dc150254f5d44b672f04bb728e7e927
Gerrit-Change-Number: 11636
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:46:50 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13551 )

Change subject: jenkins docker: Install lcov and lcov-cobertura
..


Patch Set 1: Verified+1


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed
Gerrit-Change-Number: 13551
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-CC: Max 
Gerrit-Comment-Date: Fri, 10 May 2019 10:47:26 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13551 )

Change subject: jenkins docker: Install lcov and lcov-cobertura
..

jenkins docker: Install lcov and lcov-cobertura

They are used for generating code coverage reports

Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed
---
M docker/Dockerfile_osmocom_jenkins.amd64
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 
b/docker/Dockerfile_osmocom_jenkins.amd64
index f87d80d..3f499ad 100644
--- a/docker/Dockerfile_osmocom_jenkins.amd64
+++ b/docker/Dockerfile_osmocom_jenkins.amd64
@@ -66,3 +66,7 @@
 dpkg-reconfigure --frontend=noninteractive locales && \
 update-locale LANG=en_US.UTF-8
 ENV LANG en_US.UTF-8
+
+# Code coverage tools
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y lcov
+RUN pip3 install git+https://github.com/eriwen/lcov-to-cobertura-xml/

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed
Gerrit-Change-Number: 13551
Gerrit-PatchSet: 2
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-CC: Max 


Change in osmo-trx[master]: smpl_buf: Remove dbg log line with duplicated info

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13870 )

Change subject: smpl_buf: Remove dbg log line with duplicated info
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13870
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: Ia2423707210a364fa6827b92cca087ced99b088b
Gerrit-Change-Number: 13870
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:50:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: Introduce LOGCHAN macro to standarize logging channel info

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13871 )

Change subject: Introduce LOGCHAN macro to standarize logging channel info
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13871
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: I67d869499aa16af58c863ca7b74c356bcd979936
Gerrit-Change-Number: 13871
Gerrit-PatchSet: 3
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:50:45 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: smpl_buf: Move it to device/common and create libdevice_common.la

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13873 )

Change subject: smpl_buf: Move it to device/common and create 
libdevice_common.la
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/13873/2/Transceiver52M/device/common/Makefile.am
File Transceiver52M/device/common/Makefile.am:

https://gerrit.osmocom.org/#/c/13873/2/Transceiver52M/device/common/Makefile.am@12
PS2, Line 12:
> Cosmetic: tabs vs spaces? We use tabs in general.
Hi Vadim, I tihnk you should tune down a bit on your cosmetic review comments.  
I happen to see quite many of them here in gerrit, and if it's only a line in a 
makefile, or only some "not perfect" alignment in a multi-line statement in C, 
I think we shouldn't spend too much time on it.



--
To view, visit https://gerrit.osmocom.org/13873
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: I465ad0f6d5569bb3006d711c8fd0df14391fcf35
Gerrit-Change-Number: 13873
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 10 May 2019 10:52:14 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-trx[master]: smpl_buf: Move it to device/common and create libdevice_common.la

2019-05-10 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13873 )

Change subject: smpl_buf: Move it to device/common and create 
libdevice_common.la
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/13873
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: I465ad0f6d5569bb3006d711c8fd0df14391fcf35
Gerrit-Change-Number: 13873
Gerrit-PatchSet: 3
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Fri, 10 May 2019 10:52:18 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-trx[master]: lms: Use smpl_buf to recover from timestamp jumps

2019-05-10 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13872 )

Change subject: lms: Use smpl_buf to recover from timestamp jumps
..

lms: Use smpl_buf to recover from timestamp jumps

Also take the chance to make sure we handle properly short reads (keep
reading again).

Both scenarios can be tested by running osmo-trx-lms and then using
on a terminal:
sudo kill -STOP `pidof osmo-trx-lms`; sleep 0.5; sudo kill -CONT `pidof 
osmo-trx-lms`

Fixes: OS#3339
Change-Id: Idfc4e69acc30afb11440b6b9cbdcfa09ff920265
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/lms/Makefile.am
3 files changed, 70 insertions(+), 16 deletions(-)

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



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp 
b/Transceiver52M/device/lms/LMSDevice.cpp
index 75efa1e..c320540 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -40,6 +40,7 @@
 #define GSM_CARRIER_BW 27.0 /* 270kHz */
 #define LMS_MIN_BW_SUPPORTED 2.5e6 /* 2.5mHz, minimum supported by LMS */
 #define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)
+#define SAMPLE_BUF_SZ(1 << 20) /* Size of Rx timestamp based Ring buffer, 
in bytes */

 LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t 
chans, double lo_offset,
 const std::vector& tx_paths,
@@ -56,6 +57,8 @@
m_last_rx_overruns.resize(chans, 0);
m_last_rx_dropped.resize(chans, 0);
m_last_tx_underruns.resize(chans, 0);
+
+   rx_buffers.resize(chans);
 }

 LMSDevice::~LMSDevice()
@@ -71,6 +74,9 @@
LMS_Close(m_lms_dev);
m_lms_dev = NULL;
}
+
+   for (size_t i = 0; i < rx_buffers.size(); i++)
+   delete rx_buffers[i];
 }

 static void lms_log_callback(int lvl, const char *msg)
@@ -238,6 +244,10 @@
goto out_close;
}

+   /* Set up per-channel Rx timestamp based Ring buffers */
+   for (size_t i = 0; i < rx_buffers.size(); i++)
+   rx_buffers[i] = new smpl_buf(SAMPLE_BUF_SZ / sizeof(uint32_t));
+
started = false;

return NORMAL;
@@ -600,7 +610,9 @@
 int LMSDevice::readSamples(std::vector < short *>&bufs, int len, bool * 
overrun,
   TIMESTAMP timestamp, bool * underrun, unsigned *RSSI)
 {
-   int rc = 0;
+   int rc, num_smpls, expect_smpls;
+   ssize_t avail_smpls;
+   TIMESTAMP expect_timestamp;
unsigned int i;
lms_stream_meta_t rx_metadata = {};
rx_metadata.flushPartialPacket = false;
@@ -614,24 +626,62 @@

*overrun = false;
*underrun = false;
-   for (i = 0; i
 #include 
@@ -53,6 +54,8 @@
std::vector m_last_rx_dropped;
std::vector m_last_tx_underruns;

+   std::vector rx_buffers;
+
double actualSampleRate;///< the actual USRP sampling rate

bool started;   ///< flag indicates LMS has started
diff --git a/Transceiver52M/device/lms/Makefile.am 
b/Transceiver52M/device/lms/Makefile.am
index 682cf26..77fd0e9 100644
--- a/Transceiver52M/device/lms/Makefile.am
+++ b/Transceiver52M/device/lms/Makefile.am
@@ -8,3 +8,4 @@
 noinst_LTLIBRARIES = libdevice.la

 libdevice_la_SOURCES = LMSDevice.cpp
+libdevice_la_LIBADD = 
$(top_builddir)/Transceiver52M/device/common/libdevice_common.la

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idfc4e69acc30afb11440b6b9cbdcfa09ff920265
Gerrit-Change-Number: 13872
Gerrit-PatchSet: 4
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: tnt 


  1   2   3   >