[PATCH] osmocom-bb[master]: layer23/cell_log: set default logfile to /dev/null

2018-02-01 Thread Vadim Yanitskiy

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

layer23/cell_log: set default logfile to /dev/null

When '/var/log/osmocom.log' does not exist the cell_log
app cannot start normally, because it has no permissions
to create a new file. Furthermore, logfile is optional now.

Change-Id: I2a9982f221871c78c5c9a73b7b7a1787ff07a86c
---
M src/host/layer23/src/misc/app_cell_log.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/52/6252/1

diff --git a/src/host/layer23/src/misc/app_cell_log.c 
b/src/host/layer23/src/misc/app_cell_log.c
index a7f42c3..5b7f7b4 100644
--- a/src/host/layer23/src/misc/app_cell_log.c
+++ b/src/host/layer23/src/misc/app_cell_log.c
@@ -43,7 +43,7 @@
 extern uint16_t basic_band_range[][2];
 extern uint16_t (*band_range)[][2];
 
-char *logname = "/var/log/osmocom.log";
+char *logname = "/dev/null";
 int RACH_MAX = 2;
 
 int _scan_work(struct osmocom_ms *ms)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a9982f221871c78c5c9a73b7b7a1787ff07a86c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 


osmocom-bb[master]: l1ctl_proto.h: define burst indication messages

2018-02-01 Thread Max

Patch Set 3: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Gerrit-PatchSet: 3
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: No


[PATCH] osmocom-bb[master]: l1ctl_proto.h: define burst indication messages

2018-02-01 Thread Vadim Yanitskiy
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6237

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

l1ctl_proto.h: define burst indication messages

One burst indication message carries a single raw burst, forwarded
to the higher layers from DSP. The burst bits are hard-bits (0 or 1)
coming from demodulator, packed to 14.5 bytes. This is why we call
them 'raw' - no bit correction nor deciphering is performed.

Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Related: OS#1672
---
M include/l1ctl_proto.h
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/6237/3

diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h
index 37d3d87..1706534 100644
--- a/include/l1ctl_proto.h
+++ b/include/l1ctl_proto.h
@@ -56,6 +56,7 @@
L1CTL_TRAFFIC_REQ,
L1CTL_TRAFFIC_CONF,
L1CTL_TRAFFIC_IND,
+   L1CTL_BURST_IND,
 
/* configure TBF for uplink/downlink */
L1CTL_TBF_CFG_REQ,
@@ -295,6 +296,19 @@
};
 } __attribute__((packed));
 
+#define BI_FLG_DUMMY (1 << 4)
+#define BI_FLG_SACCH (1 << 5)
+
+struct l1ctl_burst_ind {
+   uint32_t frame_nr;
+   uint16_t band_arfcn;/* ARFCN + band + ul indicator   */
+   uint8_t chan_nr;/* GSM 08.58 channel number (9.3.1)  */
+   uint8_t flags;  /* BI_FLG_xxx + burst_id = 2LSBs */
+   uint8_t rx_level;   /* 0 .. 63 in typical GSM notation (dBm+110) */
+   uint8_t snr;/* Reported SNR >> 8 (0-255) */
+   uint8_t bits[15];   /* 114 bits + 2 steal bits. Filled MSB first */
+} __attribute__((packed));
+
 /* a single L1CTL_PM response */
 struct l1ctl_pm_conf {
uint16_t band_arfcn;

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Gerrit-PatchSet: 3
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 


osmocom-bb[master]: l1ctl_proto.h: define burst indication messages

2018-02-01 Thread tnt

Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/6237/2//COMMIT_MSG
Commit Message:

Line 10: to the higher layers from DSP. The burst bits are soft-bits (127..
They are hard-bits ... 116 bits = 14.5 bytes.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Gerrit-PatchSet: 2
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: Yes


[PATCH] osmocom-bb[master]: firmware/l23_api.c: increase the L3_MSG_SIZE

2018-02-01 Thread Vadim Yanitskiy

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

firmware/l23_api.c: increase the L3_MSG_SIZE

This one defines the fixed amount of memory we will allocate for
each new l23 message in the firmware. Since the BURST INDICATION
message was defined, data_ind is no longer the biggest message.

Change-Id: I237c6898cb7bbccb891e23ebab08498768a01574
---
M src/target/firmware/layer1/l23_api.c
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/51/6251/1

diff --git a/src/target/firmware/layer1/l23_api.c 
b/src/target/firmware/layer1/l23_api.c
index 311ca6a..dcb4da0 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -52,7 +52,12 @@
 /* the size we will allocate struct msgb* for HDLC */
 #define L3_MSG_HEAD 4
 #define L3_MSG_DATA 200
-#define L3_MSG_SIZE (L3_MSG_HEAD + sizeof(struct l1ctl_hdr) + L3_MSG_DATA)
+#define L3_MSG_SIZE ( \
+   L3_MSG_HEAD \
+   + sizeof(struct l1ctl_hdr) \
+   + sizeof(struct l1ctl_info_dl) \
+   + sizeof(struct l1ctl_burst_ind) \
+   + L3_MSG_DATA)
 
 void (*l1a_l23_tx_cb)(struct msgb *msg) = NULL;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I237c6898cb7bbccb891e23ebab08498768a01574
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: tnt 


[PATCH] osmocom-bb[master]: l1ctl_proto.h: define burst indication messages

2018-02-01 Thread Vadim Yanitskiy
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6237

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

l1ctl_proto.h: define burst indication messages

One burst indication message carries a single raw burst, forwarded
to the higher layers from DSP. The burst bits are soft-bits (127..
-127) from demodulator, packed to 15 bytes. This is why we call
them 'raw' - no bit correction nor deciphering is performed.

Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Related: OS#1672
---
M include/l1ctl_proto.h
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/6237/2

diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h
index 37d3d87..1706534 100644
--- a/include/l1ctl_proto.h
+++ b/include/l1ctl_proto.h
@@ -56,6 +56,7 @@
L1CTL_TRAFFIC_REQ,
L1CTL_TRAFFIC_CONF,
L1CTL_TRAFFIC_IND,
+   L1CTL_BURST_IND,
 
/* configure TBF for uplink/downlink */
L1CTL_TBF_CFG_REQ,
@@ -295,6 +296,19 @@
};
 } __attribute__((packed));
 
+#define BI_FLG_DUMMY (1 << 4)
+#define BI_FLG_SACCH (1 << 5)
+
+struct l1ctl_burst_ind {
+   uint32_t frame_nr;
+   uint16_t band_arfcn;/* ARFCN + band + ul indicator   */
+   uint8_t chan_nr;/* GSM 08.58 channel number (9.3.1)  */
+   uint8_t flags;  /* BI_FLG_xxx + burst_id = 2LSBs */
+   uint8_t rx_level;   /* 0 .. 63 in typical GSM notation (dBm+110) */
+   uint8_t snr;/* Reported SNR >> 8 (0-255) */
+   uint8_t bits[15];   /* 114 bits + 2 steal bits. Filled MSB first */
+} __attribute__((packed));
+
 /* a single L1CTL_PM response */
 struct l1ctl_pm_conf {
uint16_t band_arfcn;

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Gerrit-PatchSet: 2
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 


osmo-trx[master]: Add support to set Rx/TxAntenna

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1:

Regarding to the ws fixes, they are definitely great.
But unrelated to the commit at all. I would prefer
to see them in a separate change...

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1735e6ab05a05b0312d6d679b16ebd4a2260fa23
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: l1sap.c: l1sap_tch_rts_ind: Remove unused variables

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1: Code-Review-1

I think, it would be better to ask the commit author - @Max.

Probably, the mentioned commit was incomplete, and may be
finished / improved. Max?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie7cd648a4b8a5ae59efc8953d6424a91a0f025ef
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bts[master]: gsm_pchan2chan_nr: move warning to pragma message and track ...

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I21298fcd0d1c1aafdd3dc1e8c8dae37b271b1d3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


libosmocore[master]: tests: utils_test: Fix test failure when compiling with -O0

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I736c1e4d625f647d3bb794fa717256e9dbf36e87
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


libosmocore[master]: tests: coding_test: Fix compilation with -O0

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I18018adec05ce1c2ddbca38653311d74c7454ce8
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[PATCH] osmo-bts[master]: l1sap.c: l1sap_tch_rts_ind: Remove unused variables

2018-02-01 Thread Pau Espin Pedrol

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

l1sap.c: l1sap_tch_rts_ind: Remove unused variables

Commit a1fa955212e18ddca286a2c7d30333116406f56b added them without
really making use of them.

Change-Id: Ie7cd648a4b8a5ae59efc8953d6424a91a0f025ef
---
M src/common/l1sap.c
1 file changed, 1 insertion(+), 6 deletions(-)


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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index a36ad88..d3f3111 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -827,8 +827,7 @@
struct gsm_time g_time;
struct gsm_lchan *lchan;
uint8_t chan_nr, marker = 0;
-   uint16_t seq;
-   uint32_t fn, timestamp;
+   uint32_t fn;
int rc;
 
chan_nr = rts_ind->chan_nr;
@@ -863,10 +862,6 @@
} else {
/* Obtain RTP header Marker bit from control buffer */
marker = rtpmsg_marker_bit(resp_msg);
-   /* Obtain RTP header Sequence Number from control buffer */
-   seq = rtpmsg_seq(resp_msg);
-   /* Obtain RTP header Timestamp from control buffer */
-   timestamp = rtpmsg_ts(resp_msg);
 
resp_msg->l2h = resp_msg->data;
msgb_push(resp_msg, sizeof(*resp_l1sap));

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie7cd648a4b8a5ae59efc8953d6424a91a0f025ef
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-bts[master]: bts-trx: scheduler_trx.c: Fix missing header

2018-02-01 Thread Pau Espin Pedrol

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

bts-trx: scheduler_trx.c: Fix missing header

It is required for bts_shutdown used in trx_fn_timer_cb, and compiler
warns about implicit declaration.

Change-Id: I274662cd657ce8c36ed1d262d138590808bfafea
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index d3928f1..0f3272e 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I274662cd657ce8c36ed1d262d138590808bfafea
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-bts[master]: Remove unused variables

2018-02-01 Thread Pau Espin Pedrol

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

Remove unused variables

Change-Id: I3fec7e4b337f3ea4d8cd79f4e7261babc34911cb
---
M src/common/l1sap.c
M src/common/rsl.c
M src/osmo-bts-trx/l1_if.c
3 files changed, 0 insertions(+), 6 deletions(-)


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

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 30c2759..a36ad88 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -448,7 +448,6 @@
   struct osmo_phsap_prim *l1sap,
   struct info_time_ind_param *info_time_ind)
 {
-   struct gsm_bts_trx *trx;
struct gsm_bts_role_bts *btsb = bts->role;
int frames_expired;
 
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 3d0993c..1f45cc6 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1248,7 +1248,6 @@
msgb_tlv_put(msg, RSL_IE_CAUSE, 1, );
rsl_dch_push_hdr(msg, RSL_MT_MODE_MODIFY_NACK, chan_nr);
msg->lchan = lchan;
-   msg->trx = lchan->ts->trx;
 
return abis_bts_rsl_sendmsg(msg);
 }
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 3c11dfd..8f24ccf 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -135,7 +135,6 @@
  */
 int l1if_provision_transceiver_trx(struct trx_l1h *l1h)
 {
-   struct phy_link *plink = l1h->phy_inst->phy_link;
uint8_t tn;
 
if (!transceiver_available)
@@ -215,7 +214,6 @@
 
llist_for_each_entry(trx, >trx_list, list) {
struct phy_instance *pinst = trx_phy_instance(trx);
-   struct phy_link *plink = pinst->phy_link;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
l1h->config.arfcn_sent = 0;
l1h->config.tsc_sent = 0;
@@ -305,7 +303,6 @@
 {
struct gsm_bts_trx *trx;
uint8_t bsic = bts->bsic;
-   struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
 
llist_for_each_entry(trx, >trx_list, list) {
struct phy_instance *pinst = trx_phy_instance(trx);
@@ -327,7 +324,6 @@
 static uint8_t trx_set_trx(struct gsm_bts_trx *trx)
 {
struct phy_instance *pinst = trx_phy_instance(trx);
-   struct phy_link *plink = pinst->phy_link;
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
uint16_t arfcn = trx->arfcn;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fec7e4b337f3ea4d8cd79f4e7261babc34911cb
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-bts[master]: gsm_pchan2chan_nr: move warning to pragma message and track ...

2018-02-01 Thread Pau Espin Pedrol

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

gsm_pchan2chan_nr: move warning to pragma message and track issue

Take the chance to move the default option to the end as it's the
usually expected syntax.

Change-Id: I21298fcd0d1c1aafdd3dc1e8c8dae37b271b1d3d
---
M src/common/gsm_data_shared.c
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c
index aa012bc..9aa4ba1 100644
--- a/src/common/gsm_data_shared.c
+++ b/src/common/gsm_data_shared.c
@@ -675,15 +675,15 @@
cbits = 0x08;
cbits += lchan_nr;
break;
-   default:
case GSM_PCHAN_CCCH:
+   default:
/* OSMO_ASSERT(lchan_nr == 0);
 * FIXME: On octphy and litecell, we hit above assertion (see
 * Max's comment at https://gerrit.osmocom.org/589 ); disabled
 * for BTS until this is clarified; remove the #ifdef when it
-* is fixed.
+* is fixed. Tracked in OS#2906.
 */
-#warning "fix caller that passes lchan_nr != 0"
+#pragma message "fix caller that passes lchan_nr != 0"
cbits = 0x10;
break;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I21298fcd0d1c1aafdd3dc1e8c8dae37b271b1d3d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-mgw[master]: cosmetic: rename mgcp_release_endp to mgcp_endp_release

2018-02-01 Thread dexter

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

cosmetic: rename mgcp_release_endp to mgcp_endp_release

In order to allow clean prefixes for future endpoint related
functions the "rlease" should be moved to the end of the
function name.

- rename mgcp_release_endp to mgcp_endp_release

Change-Id: I22e938e702f57ad76d38c9f4a1370b110ac1ba11
---
M include/osmocom/mgcp/mgcp_ep.h
M src/libosmo-mgcp/mgcp_ep.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
M src/osmo-mgw/mgw_main.c
M tests/mgcp/mgcp_test.c
6 files changed, 13 insertions(+), 12 deletions(-)


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

diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h
index 2b7a5d6..c0fd9ff 100644
--- a/include/osmocom/mgcp/mgcp_ep.h
+++ b/include/osmocom/mgcp/mgcp_ep.h
@@ -95,4 +95,5 @@
 /*! Extract endpoint number for a given endpoint */
 #define ENDPOINT_NUMBER(endp) abs((int)(endp - endp->tcfg->endpoints))
 
-void mgcp_release_endp(struct mgcp_endpoint *endp);
+void mgcp_endp_release(struct mgcp_endpoint *endp);
+
diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_ep.c
index c2bf78e..efa15a0 100644
--- a/src/libosmo-mgcp/mgcp_ep.c
+++ b/src/libosmo-mgcp/mgcp_ep.c
@@ -34,7 +34,7 @@
 
 /*! release endpoint, all open connections are closed.
  *  \param[in] endp endpoint to release */
-void mgcp_release_endp(struct mgcp_endpoint *endp)
+void mgcp_endp_release(struct mgcp_endpoint *endp)
 {
LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n",
 ENDPOINT_NUMBER(endp));
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 9fe30f8..c6beaa4 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -583,7 +583,7 @@
if (tcfg->force_realloc)
/* This is not our call, toss everything by releasing
 * the entire endpoint. (rude!) */
-   mgcp_release_endp(endp);
+   mgcp_endp_release(endp);
else {
/* This is not our call, leave everything as it is and
 * return with an error. */
@@ -673,7 +673,7 @@
LOGP(DLMGCP, LOGL_NOTICE,
 "CRCX: endpoint:0x%x CRCX rejected by policy\n",
 ENDPOINT_NUMBER(endp));
-   mgcp_release_endp(endp);
+   mgcp_endp_release(endp);
return create_err_response(endp, 400, "CRCX", p->trans);
break;
case MGCP_POLICY_DEFER:
@@ -703,7 +703,7 @@
 ENDPOINT_NUMBER(endp));
return create_response_with_sdp(endp, conn, "CRCX", p->trans, true);
 error2:
-   mgcp_release_endp(endp);
+   mgcp_endp_release(endp);
LOGP(DLMGCP, LOGL_NOTICE,
 "CRCX: endpoint:0x%x unable to create connection resource error\n",
 ENDPOINT_NUMBER(endp));
@@ -954,7 +954,7 @@
 "DLCX: endpoint:0x%x missing ci (connectionIdentifier), 
will remove all connections at once\n",
 ENDPOINT_NUMBER(endp));
 
-   mgcp_release_endp(endp);
+   mgcp_endp_release(endp);
 
/* Note: In this case we do not return any statistics,
 * as we assume that the client is not interested in
@@ -981,7 +981,7 @@
/* When all connections are closed, the endpoint will be released
 * in order to be ready to be used by another call. */
if (llist_count(>conns) <= 0) {
-   mgcp_release_endp(endp);
+   mgcp_endp_release(endp);
LOGP(DLMGCP, LOGL_DEBUG,
 "DLCX: endpoint:0x%x endpoint released\n",
 ENDPOINT_NUMBER(endp));
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index 99780c8..5378931 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -1048,7 +1048,7 @@
}
 
endp = >endpoints[endp_no];
-   mgcp_release_endp(endp);
+   mgcp_endp_release(endp);
return CMD_SUCCESS;
 }
 
diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c
index 8e956e4..4452ae3 100644
--- a/src/osmo-mgw/mgw_main.c
+++ b/src/osmo-mgw/mgw_main.c
@@ -190,7 +190,7 @@
/* Walk over all endpoints and trigger a release, this will 
release all
 * endpoints, possible open connections are forcefully dropped 
*/
for (i = 1; i < reset_trunk->number_endpoints; ++i)
-   mgcp_release_endp(_trunk->endpoints[i]);
+   mgcp_endp_release(_trunk->endpoints[i]);
}
 
return 0;
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 1790444..4d39bda 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1324,7 +1324,7 @@
 
/* Free the previous endpoint and the data 

[PATCH] osmo-mgw[master]: msg: fix response code on exhausted endp resources

2018-02-01 Thread dexter

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

msg: fix response code on exhausted endp resources

When all endpoints are seized and a call agent tries to allocate
another one, then 500 is returned as response code, which means
that the endpoint was not found. This does not match.

- Return 403 which is defined as "Insufficient resources available
  at this time"

Change-Id: Idf241b47e711e35e9f9b5a43f3cea5c0298ea30b
---
M src/libosmo-mgcp/mgcp_msg.c
1 file changed, 19 insertions(+), 7 deletions(-)


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

diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 3aa93b7..4055a0c 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -224,11 +224,15 @@
 /* Search the endpoint pool for the endpoint that had been selected via the
  * MGCP message (helper function for mgcp_analyze_header()) */
 static struct mgcp_endpoint *find_endpoint(struct mgcp_config *cfg,
-  const char *mgcp)
+  const char *mgcp,
+  int *cause)
 {
char *endptr = NULL;
unsigned int gw = INT_MAX;
const char *endpoint_number_str;
+   struct mgcp_endpoint *endp;
+
+   *cause = 0;
 
/* Check if the domainname in the request is correct */
if (check_domain_name(cfg, mgcp)) {
@@ -237,8 +241,12 @@
}
 
/* Check if the E1 trunk is requested */
-   if (strncmp(mgcp, "ds/e1", 5) == 0)
-   return find_e1_endpoint(cfg, mgcp);
+   if (strncmp(mgcp, "ds/e1", 5) == 0) {
+   endp = find_e1_endpoint(cfg, mgcp);
+   if (!endp)
+   *cause = -500;
+   return endp;
+   }
 
/* Check if the virtual trunk is addressed (new, correct way with 
prefix) */
if (strncmp
@@ -247,10 +255,12 @@
endpoint_number_str =
mgcp + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK);
if (endpoint_number_str[0] == '*') {
-   return find_free_endpoint(cfg->trunk.endpoints,
+   endp = find_free_endpoint(cfg->trunk.endpoints,
  cfg->trunk.number_endpoints);
+   if (!endp)
+   *cause = -403;
+   return endp;
}
-
gw = strtoul(endpoint_number_str, , 16);
if (gw < cfg->trunk.number_endpoints && endptr[0] == '@')
return >trunk.endpoints[gw];
@@ -265,6 +275,7 @@
return >trunk.endpoints[gw];
 
LOGP(DLMGCP, LOGL_ERROR, "Not able to find the endpoint: '%s'\n", mgcp);
+   *cause = -500;
return NULL;
 }
 
@@ -277,6 +288,7 @@
 {
int i = 0;
char *elem, *save = NULL;
+   int cause;
 
/*! This function will parse the header part of the received
 *  MGCP message. The parsing results are stored in pdata.
@@ -294,11 +306,11 @@
pdata->trans = elem;
break;
case 1:
-   pdata->endp = find_endpoint(pdata->cfg, elem);
+   pdata->endp = find_endpoint(pdata->cfg, elem, );
if (!pdata->endp) {
LOGP(DLMGCP, LOGL_ERROR,
 "Unable to find Endpoint `%s'\n", elem);
-   return -500;
+   return cause;
}
break;
case 2:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf241b47e711e35e9f9b5a43f3cea5c0298ea30b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-mgw[master]: cosmetic: rename mgcp_ep.c/h to mgcp_endp.c/h

2018-02-01 Thread dexter

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

cosmetic: rename mgcp_ep.c/h to mgcp_endp.c/h

The short term of endpoint has always been "endp" througout the whole
project and not "ep".

- rename mcgp_ep.c to mgcp_endp.c

- rename mgcp_ep.h to mgcp_endp.h

Change-Id: Id52047bb2d0407655ac272c858ed3412b8ae9e6d
---
M include/osmocom/mgcp/Makefile.am
R include/osmocom/mgcp/mgcp_endp.h
M src/libosmo-mgcp/Makefile.am
M src/libosmo-mgcp/mgcp_conn.c
R src/libosmo-mgcp/mgcp_endp.c
M src/libosmo-mgcp/mgcp_msg.c
M src/libosmo-mgcp/mgcp_network.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_sdp.c
M src/libosmo-mgcp/mgcp_vty.c
M src/osmo-mgw/mgw_main.c
M tests/mgcp/mgcp_test.c
13 files changed, 12 insertions(+), 12 deletions(-)


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

diff --git a/include/osmocom/mgcp/Makefile.am b/include/osmocom/mgcp/Makefile.am
index d706807..7e297e4 100644
--- a/include/osmocom/mgcp/Makefile.am
+++ b/include/osmocom/mgcp/Makefile.am
@@ -3,7 +3,7 @@
mgcp_msg.h \
mgcp_conn.h \
mgcp_stat.h \
-   mgcp_ep.h \
+   mgcp_endp.h \
mgcp_sdp.h \
debug.h \
$(NULL)
diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_endp.h
similarity index 100%
rename from include/osmocom/mgcp/mgcp_ep.h
rename to include/osmocom/mgcp/mgcp_endp.h
diff --git a/src/libosmo-mgcp/Makefile.am b/src/libosmo-mgcp/Makefile.am
index a785d62..fbb1a2e 100644
--- a/src/libosmo-mgcp/Makefile.am
+++ b/src/libosmo-mgcp/Makefile.am
@@ -42,7 +42,7 @@
mgcp_msg.c \
mgcp_conn.c \
mgcp_stat.c \
-   mgcp_ep.c \
+   mgcp_endp.c \
$(NULL)
 
 libosmo_mgcp_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_LIBVERSION)
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 33c4165..62cbdba 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_endp.c
similarity index 97%
rename from src/libosmo-mgcp/mgcp_ep.c
rename to src/libosmo-mgcp/mgcp_endp.c
index efa15a0..581c12c 100644
--- a/src/libosmo-mgcp/mgcp_ep.c
+++ b/src/libosmo-mgcp/mgcp_endp.c
@@ -22,7 +22,7 @@
  */
 
 #include 
-#include 
+#include 
 
 /* Endpoint typeset definition */
 const struct mgcp_endpoint_typeset ep_typeset = {
diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 034b64f..f533d55 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -28,7 +28,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /*! Display an mgcp message on the log output.
  *  \param[in] message mgcp message string
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 4e22e63..6923b97 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -39,7 +39,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #define RTP_SEQ_MOD(1 << 16)
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index 1bb7aa6..1d3cab3 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 static struct osmo_fd osmux_fd;
 
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index c6beaa4..b0d9943 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -38,7 +38,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 struct mgcp_request {
diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 1dffbfc..52b4df4 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index 5378931..14ecd17 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c
index 4452ae3..f95a1c7 100644
--- a/src/osmo-mgw/mgw_main.c
+++ b/src/osmo-mgw/mgw_main.c
@@ -37,7 +37,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 4d39bda..38a0a46 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id52047bb2d0407655ac272c858ed3412b8ae9e6d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: 

[PATCH] osmo-mgw[master]: protocol: on wildcarded CRCX return endpoint number as hex

2018-02-01 Thread dexter

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

protocol: on wildcarded CRCX return endpoint number as hex

When a wildcarded CRCX is done, then the endpoint number is
returned as unsigned integer (%u). This results into problems
with endpoint numbers higher than 9.

- Return endpoint identifier with the endpoint number in
  hexadecimal representation

Change-Id: I504f4658c193009347753b15256dbb46b32ad5a4
---
M src/libosmo-mgcp/mgcp_protocol.c
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 709c04a..3f1594f 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -201,7 +201,7 @@
/* NOTE: Only in the virtual trunk we allow dynamic endpoint names */
if (endp->wildcarded_crcx
&& endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) {
-   rc = msgb_printf(msg, "Z: %s%u@%s\r\n",
+   rc = msgb_printf(msg, "Z: %s%x@%s\r\n",
 MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK,
 ENDPOINT_NUMBER(endp), endp->cfg->domain);
if (rc < 0)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I504f4658c193009347753b15256dbb46b32ad5a4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-mgw[master]: ep: move endpoint struct and define to mgcp_ep.h

2018-02-01 Thread dexter

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

ep: move endpoint struct and define to mgcp_ep.h

The endpoint and the define that computes the endpoint number is
defined in mgcp_internal.h. Since we have a dedicated module for
endpoint related code it makes sense to move the endpoint related
parts there.

- move struct mgcp_endpoint to mgcp_ep.h

- move #define ENDPOINT_NUMBER(endp) to mgcp_ep.h

Change-Id: Ibae55e1859bd41e2d1918eda433418b4bf8365fe
---
M include/osmocom/mgcp/mgcp_ep.h
M include/osmocom/mgcp/mgcp_internal.h
M src/libosmo-mgcp/mgcp_ep.c
M src/libosmo-mgcp/mgcp_msg.c
M src/libosmo-mgcp/mgcp_osmux.c
M src/libosmo-mgcp/mgcp_sdp.c
6 files changed, 40 insertions(+), 22 deletions(-)


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

diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h
index 7b4ccee..2b7a5d6 100644
--- a/include/osmocom/mgcp/mgcp_ep.h
+++ b/include/osmocom/mgcp/mgcp_ep.h
@@ -60,4 +60,39 @@
 /*! static MGCP endpoint typeset (pre-initalized, read-only) */
 extern const struct mgcp_endpoint_typeset ep_typeset;
 
+/*! MGCP endpoint model */
+struct mgcp_endpoint {
+
+   /*!< Call identifier string (as supplied by the call agant) */
+   char *callid;
+
+   /*!< Local connection options (see mgcp_intermal.h) */
+   struct mgcp_lco local_options;
+
+   /*!< List with connections active on this endpoint */
+   struct llist_head conns;
+
+   /*!< Backpointer to the MGW configuration */
+   struct mgcp_config *cfg;
+
+   /*!< Backpointer to the Trunk specific configuration */
+   struct mgcp_trunk_config *tcfg;
+
+   /*!< Endpoint properties (see above) */
+   const struct mgcp_endpoint_type *type;
+
+   /*!< Last MGCP transmission (in case re-transmission is required) */
+   char *last_trans;
+
+   /*!< Last MGCP response (in case re-transmission is required) */
+   char *last_response;
+
+   /*!< Memorize if this endpoint was choosen by the MGW (wildcarded, true)
+*   or if the user has choosen the particular endpoint explicitly. */
+   bool wildcarded_crcx;
+};
+
+/*! Extract endpoint number for a given endpoint */
+#define ENDPOINT_NUMBER(endp) abs((int)(endp - endp->tcfg->endpoints))
+
 void mgcp_release_endp(struct mgcp_endpoint *endp);
diff --git a/include/osmocom/mgcp/mgcp_internal.h 
b/include/osmocom/mgcp/mgcp_internal.h
index 5de28ee..e4009e8 100644
--- a/include/osmocom/mgcp/mgcp_internal.h
+++ b/include/osmocom/mgcp/mgcp_internal.h
@@ -245,29 +245,9 @@
 
 struct mgcp_endpoint_type;
 
-struct mgcp_endpoint {
-   char *callid;
-   struct mgcp_lco local_options;
-
-   struct llist_head conns;
-
-   /* backpointer */
-   struct mgcp_config *cfg;
-   struct mgcp_trunk_config *tcfg;
-
-   const struct mgcp_endpoint_type *type;
-
-   /* fields for re-transmission */
-   char *last_trans;
-   char *last_response;
-
-   /* Memorize if this endpoint was choosen by the MGW (wildcarded, true)
-* or if the user has choosen the particular endpoint explicitly */
-   bool wildcarded_crcx;
-};
 
 
-#define ENDPOINT_NUMBER(endp) abs((int)(endp - endp->tcfg->endpoints))
+
 
 /**
  * Internal structure while parsing a request
diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_ep.c
index e23d0f1..c2bf78e 100644
--- a/src/libosmo-mgcp/mgcp_ep.c
+++ b/src/libosmo-mgcp/mgcp_ep.c
@@ -21,8 +21,8 @@
  *
  */
 
-#include 
 #include 
+#include 
 
 /* Endpoint typeset definition */
 const struct mgcp_endpoint_typeset ep_typeset = {
diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c
index 4055a0c..034b64f 100644
--- a/src/libosmo-mgcp/mgcp_msg.c
+++ b/src/libosmo-mgcp/mgcp_msg.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*! Display an mgcp message on the log output.
  *  \param[in] message mgcp message string
diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c
index d0141f3..1bb7aa6 100644
--- a/src/libosmo-mgcp/mgcp_osmux.c
+++ b/src/libosmo-mgcp/mgcp_osmux.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static struct osmo_fd osmux_fd;
 
diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c
index 666b8c2..1dffbfc 100644
--- a/src/libosmo-mgcp/mgcp_sdp.c
+++ b/src/libosmo-mgcp/mgcp_sdp.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibae55e1859bd41e2d1918eda433418b4bf8365fe
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-pcu[master]: TBF: move common test code into functions

2018-02-01 Thread Max

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

TBF: move common test code into functions

* move common code into functions
* print error instead of failing test right away

This allows the tests to continue till completion even in case of
intermediate error which simplifies troubleshooting by allowing to
gather more errors in a single test run.

Change-Id: I1c4ad1dc94542835f15bd666f0821e0ccfcc78c1
Related: OS#1759
---
M tests/tbf/TbfTest.cpp
1 file changed, 67 insertions(+), 109 deletions(-)


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

diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index fbed45a..d4702f2 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -1665,6 +1665,13 @@
}
 }
 
+static inline void print_ta_tlli(const gprs_rlcmac_ul_tbf *ul_tbf, bool 
print_ms)
+{
+   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
+   if (print_ms)
+   fprintf(stderr, "Got MS: TLLI = 0x%08x, TA = %d\n", 
ul_tbf->ms()->tlli(), ul_tbf->ms()->ta());
+}
+
 static void test_tbf_single_phase()
 {
BTS the_bts;
@@ -1674,7 +1681,6 @@
const char *imsi = "0011223344";
uint16_t qta = 31;
gprs_rlcmac_ul_tbf *ul_tbf;
-   GprsMs *ms;
 
printf("=== start %s ===\n", __func__);
 
@@ -1682,10 +1688,7 @@
 
ul_tbf = establish_ul_tbf_single_phase(_bts, ts_no, tlli, , qta);
 
-   ms = ul_tbf->ms();
-   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
-   fprintf(stderr, "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), 
ms->ta());
-
+   print_ta_tlli(ul_tbf, true);
send_dl_data(_bts, tlli, imsi, (const uint8_t *)"TEST", 4);
 
printf("=== end %s ===\n", __func__);
@@ -1703,7 +1706,6 @@
gprs_rlcmac_bts *bts;
uint8_t egprs_ms_class = 1;
gprs_rlcmac_ul_tbf *ul_tbf;
-   GprsMs *ms;
uint8_t test_data[256];
 
printf("=== start %s ===\n", __func__);
@@ -1722,10 +1724,7 @@
ul_tbf = establish_ul_tbf_two_phase_puan_URBB_no_length(_bts, 
ts_no, tlli, ,
qta, ms_class, egprs_ms_class, ul_tbf);
 
-   ms = ul_tbf->ms();
-   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
-   fprintf(stderr,
-   "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta());
+   print_ta_tlli(ul_tbf, true);
send_dl_data(_bts, tlli, imsi, test_data, sizeof(test_data));
 
ul_tbf->window()->reset_state();
@@ -1733,11 +1732,7 @@
ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(_bts, 
ts_no, tlli, ,
qta, ms_class, egprs_ms_class, ul_tbf);
 
-   ms = ul_tbf->ms();
-   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
-   fprintf(stderr,
-   "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta());
-
+   print_ta_tlli(ul_tbf, true);
send_dl_data(_bts, tlli, imsi, test_data, sizeof(test_data));
 
ul_tbf->window()->reset_state();
@@ -1747,11 +1742,7 @@
ul_tbf = establish_ul_tbf_two_phase_puan_CRBB(_bts, ts_no, tlli, 
,
qta, ms_class, egprs_ms_class);
 
-   ms = ul_tbf->ms();
-   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
-   fprintf(stderr,
-   "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta());
-
+   print_ta_tlli(ul_tbf, true);
send_dl_data(_bts, tlli, imsi, test_data, sizeof(test_data));
 
printf("=== end %s ===\n", __func__);
@@ -1848,7 +1839,6 @@
const char *imsi = "0011223344";
uint8_t ms_class = 1;
gprs_rlcmac_ul_tbf *ul_tbf;
-   GprsMs *ms;
 
printf("=== start %s ===\n", __func__);
 
@@ -1857,13 +1847,16 @@
ul_tbf = establish_ul_tbf_two_phase(_bts, ts_no, tlli, , qta,
ms_class, 0);
 
-   ms = ul_tbf->ms();
-   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
-   fprintf(stderr, "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), 
ms->ta());
-
+   print_ta_tlli(ul_tbf, true);
send_dl_data(_bts, tlli, imsi, (const uint8_t *)"TEST", 4);
 
printf("=== end %s ===\n", __func__);
+}
+
+static inline void print_ms(const GprsMs *ms, bool old)
+{
+   fprintf(stderr, "%s MS: TLLI = 0x%08x, TA = %d, IMSI = %s, LLC = %zu\n",
+   old ? "Old" : "New", ms->tlli(), ms->ta(), ms->imsi(), 
ms->llc_queue()->size());
 }
 
 static void test_tbf_ra_update_rach()
@@ -1887,11 +1880,10 @@
ms_class, 0);
 
ms1 = ul_tbf->ms();
-   fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta());
+   print_ta_tlli(ul_tbf, false);
 
send_dl_data(_bts, tlli1, imsi, (const uint8_t *)"RAU_ACCEPT", 10);
-   fprintf(stderr, "Old MS: TLLI = 0x%08x, TA = %d, IMSI = %s, LLC = 
%zu\n",
-   ms1->tlli(), ms1->ta(), ms1->imsi(), ms1->llc_queue()->size());
+   print_ms(ms1, true);
 
/* Send Packet Downlink 

[PATCH] osmo-pcu[master]: vty: add commands to show TBF of a certain kind

2018-02-01 Thread Max

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

vty: add commands to show TBF of a certain kind

Add vty commands to show only TBFs allocated via PACCH or CCCH.

Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Related: OS#1759
---
M src/pcu_vty.c
M src/pcu_vty_functions.cpp
M src/pcu_vty_functions.h
3 files changed, 24 insertions(+), 6 deletions(-)


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

diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 5c3f625..47d87f9 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -1065,7 +1065,23 @@
   SHOW_STR "information about TBFs\n" "All TBFs\n")
 {
struct gprs_rlcmac_bts *bts = bts_main_data();
-   return pcu_vty_show_tbf_all(vty, bts);
+   return pcu_vty_show_tbf_all(vty, bts, true, true);
+}
+
+DEFUN(show_tbf_ccch,
+  show_tbf_ccch_cmd,
+  "show tbf ccch",
+  SHOW_STR "information about TBFs\n" "TBFs allocated via CCCH\n")
+{
+   return pcu_vty_show_tbf_all(vty, bts_main_data(), true, false);
+}
+
+DEFUN(show_tbf_pacch,
+  show_tbf_pacch_cmd,
+  "show tbf pacch",
+  SHOW_STR "information about TBFs\n" "TBFs allocated via PACCH\n")
+{
+   return pcu_vty_show_tbf_all(vty, bts_main_data(), false, true);
 }
 
 DEFUN(show_ms_all,
@@ -1192,6 +1208,8 @@
 
install_element_ve(_bts_stats_cmd);
install_element_ve(_tbf_cmd);
+   install_element_ve(_tbf_ccch_cmd);
+   install_element_ve(_tbf_pacch_cmd);
install_element_ve(_ms_all_cmd);
install_element_ve(_ms_tlli_cmd);
install_element_ve(_ms_imsi_cmd);
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 41165f3..6c078f2 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -34,7 +34,7 @@
 #include 
 }
 
-static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf)
+static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf, bool 
show_ccch, bool show_pacch)
 {
gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf);
gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf);
@@ -91,18 +91,18 @@
vty_out(vty, "%s%s", VTY_NEWLINE, VTY_NEWLINE);
 }
 
-int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data)
+int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, 
bool show_ccch, bool show_pacch)
 {
BTS *bts = bts_data->bts;
LListHead *ms_iter;
 
vty_out(vty, "UL TBFs%s", VTY_NEWLINE);
llist_for_each(ms_iter, >ul_tbfs())
-   tbf_print_vty_info(vty, ms_iter->entry());
+   tbf_print_vty_info(vty, ms_iter->entry(), show_ccch, 
show_pacch);
 
vty_out(vty, "%sDL TBFs%s", VTY_NEWLINE, VTY_NEWLINE);
llist_for_each(ms_iter, >dl_tbfs())
-   tbf_print_vty_info(vty, ms_iter->entry());
+   tbf_print_vty_info(vty, ms_iter->entry(), show_ccch, 
show_pacch);
 
return CMD_SUCCESS;
 }
diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h
index 470df0e..3fef208 100644
--- a/src/pcu_vty_functions.h
+++ b/src/pcu_vty_functions.h
@@ -27,7 +27,7 @@
 struct vty;
 struct gprs_rlcmac_bts;
 
-int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
+int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, 
bool show_ccch, bool show_pacch);
 int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
 int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
uint32_t tlli);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max 


osmo-trx[master]: Add support to set Rx/TxAntenna

2018-02-01 Thread Pau Espin Pedrol

Patch Set 1: Code-Review-1

Not tested yet, WIP. I'll do some tests next week, I push it here meanwhile in 
case someone wants to comment on it.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1735e6ab05a05b0312d6d679b16ebd4a2260fa23
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] osmo-trx[master]: Add support to set Rx/TxAntenna

2018-02-01 Thread Pau Espin Pedrol

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

Add support to set Rx/TxAntenna

Change-Id: I1735e6ab05a05b0312d6d679b16ebd4a2260fa23
---
M Transceiver52M/UHDDevice.cpp
M Transceiver52M/USRPDevice.cpp
M Transceiver52M/USRPDevice.h
M Transceiver52M/osmo-trx.cpp
M Transceiver52M/radioDevice.h
5 files changed, 273 insertions(+), 57 deletions(-)


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

diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 09317a9..1cf6cb9 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -1,5 +1,5 @@
 /*
- * Device support for Ettus Research UHD driver 
+ * Device support for Ettus Research UHD driver
  *
  * Copyright 2010,2011 Free Software Foundation, Inc.
  * Copyright (C) 2015 Ettus Research LLC
@@ -143,8 +143,8 @@
 public:
/** Sample buffer constructor
@param len number of 32-bit samples the buffer should hold
-   @param rate sample clockrate 
-   @param timestamp 
+   @param rate sample clockrate
+   @param timestamp
*/
smpl_buf(size_t len, double rate);
~smpl_buf();
@@ -172,7 +172,7 @@
*/
std::string str_status(size_t ts) const;
 
-   /** Formatted error string 
+   /** Formatted error string
@param code an error code
@return a formatted error string
*/
@@ -208,7 +208,9 @@
 class uhd_device : public RadioDevice {
 public:
uhd_device(size_t tx_sps, size_t rx_sps, InterfaceType type,
-  size_t chans, double offset);
+  size_t chans, double offset,
+  const std::vector& tx_paths,
+  const std::vector& rx_paths);
~uhd_device();
 
int open(const std::string , int ref, bool swap_channels);
@@ -248,6 +250,11 @@
double getRxFreq(size_t chan);
double getRxFreq();
 
+   bool setRxAntenna(const std::string , size_t chan);
+   std::string getRxAntenna(size_t chan);
+   bool setTxAntenna(const std::string , size_t chan);
+   std::string getTxAntenna(size_t chan);
+
inline double getSampleRate() { return tx_rate; }
inline double numberRead() { return rx_pkt_cnt; }
inline double numberWritten() { return 0; }
@@ -280,6 +287,7 @@
 
std::vector tx_gains, rx_gains;
std::vector tx_freqs, rx_freqs;
+   std::vector tx_paths, rx_paths;
size_t tx_spp, rx_spp;
 
bool started;
@@ -295,6 +303,7 @@
void init_gains();
void set_channels(bool swap);
void set_rates();
+   bool set_antennas();
bool parse_dev_type();
bool flush_recv(size_t num_pkts);
int check_rx_md_err(uhd::rx_metadata_t , ssize_t num_smpls);
@@ -353,7 +362,9 @@
 }
 
 uhd_device::uhd_device(size_t tx_sps, size_t rx_sps,
-  InterfaceType iface, size_t chans, double offset)
+  InterfaceType iface, size_t chans, double offset,
+  const std::vector& tx_paths,
+  const std::vector& rx_paths)
: tx_gain_min(0.0), tx_gain_max(0.0),
  rx_gain_min(0.0), rx_gain_max(0.0),
  tx_spp(0), rx_spp(0),
@@ -365,6 +376,8 @@
this->chans = chans;
this->offset = offset;
this->iface = iface;
+   this->tx_paths = tx_paths;
+   this->rx_paths = rx_paths;
 }
 
 uhd_device::~uhd_device()
@@ -439,6 +452,33 @@
 
ts_offset = static_cast(desc.offset * rx_rate);
LOG(INFO) << "Rates configured for " << desc.str;
+}
+
+bool uhd_device::set_antennas()
+{
+   unsigned int i;
+
+   for (i = 0; i < tx_paths.size(); i++) {
+   if (tx_paths[i] == "")
+   continue;
+   LOG(DEBUG) << "Configuring channel " << i << " with antenna " 
<< tx_paths[i];
+   if (!setTxAntenna(tx_paths[i], i)) {
+   LOG(ALERT) << "Failed configuring channel " << i << " 
with antenna " << tx_paths[i];
+   return false;
+   }
+   }
+
+   for (i = 0; i < rx_paths.size(); i++) {
+   if (rx_paths[i] == "")
+   continue;
+   LOG(DEBUG) << "Configuring channel " << i << " with antenna " 
<< tx_paths[i];
+   if (!setRxAntenna(rx_paths[i], i)) {
+   LOG(ALERT) << "Failed configuring channel " << i << " 
with antenna " << rx_paths[i];
+   return false;
+   }
+   }
+   LOG(INFO) << "Antennas configured successfully";
+   return true;
 }
 
 double uhd_device::setTxGain(double db, size_t chan)
@@ -644,6 +684,11 @@
return -1;
}
 
+   if (!set_antennas()) {
+   LOG(ALERT) << "UHD antenna setting failed";
+   return -1;
+   }
+
tx_freqs.resize(chans);
rx_freqs.resize(chans);
tx_gains.resize(chans);
@@ -705,7 +750,7 @@
 

osmocom-bb[master]: Import gprsdecode utility

2018-02-01 Thread Max

Patch Set 1:

(5 comments)

Thank you for detailed review, I've tried to address most of it, don't hesitate 
to remind if I've missed something.

https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/README
File src/host/gprsdecode/README:

Line 3: Based on the version from https://srlabs.de/gprs/
> Let's add a minimalistic description and usage examples here?
> This link is broken :(

Updated - they have problems with their website.

> what about the license?

Same as the rest of OsmocomBB.


https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/gprs.c
File src/host/gprsdecode/gprs.c:

Line 98:const uint8_t usf_pattern[][6] = {{0, 0, 0, 0, 0, 0},
> Could be separated as a static symbol.
What for?


PS1, Line 153: static inline int decode_signalling(const uint8_t *conv_data, 
uint8_t *msg)
 : {
 :  uint8_t decoded_data[PARITY_OUTPUT_SIZE];
 :  int8_t soft_input[CONV_SIZE];
 : 
 :  /* convert to soft bits */
 :  osmo_ubit2sbit(soft_input, conv_data, CONV_SIZE);
 : 
 :  /* Viterbi decoding */
 :  osmo_conv_decode(_xcch, soft_input, decoded_data);
 : 
 :  /* parity check: if error detected try to fix it */
 :  int ret = osmo_crc64gen_check_bits(_fire_crc40, 
decoded_data, 184, decoded_data + 184);
 :  if (ret) {
 :  FC_CTX fc_ctx;
 :  FC_init(_ctx, PARITY_SIZE, DATA_BLOCK_SIZE);
 : /**/
 :  unsigned char crc_result[DATA_BLOCK_SIZE + PARITY_SIZE];
 :  ret = FC_check_crc(_ctx, decoded_data, crc_result);
 :  if (!ret)
 :  return 0;
 :  /*
 :  ubit_t crc_result[DATA_BLOCK_SIZE + PARITY_SIZE];
 :  osmo_crc64gen_set_bits(_fire_crc40, 
decoded_data, 184, crc_result);
 :  */
 :  memcpy(decoded_data, crc_result, sizeof crc_result);
 :  }
 : 
 :  osmo_ubit2pbit_ext(msg, 0, decoded_data, 0, DATA_BLOCK_SIZE, 1);
 : 
 :  return 23;
 : }
> Also looks like a code duplication, should be in libosmocoding.
I don't think so but if you can split it out and intergrate into libosmocoding 
- feel free to send a patch and add me sa reviewer.


Line 186: int process_pdch(struct l1ctl_burst_ind *bi, bool print)
> The most part of this function could be rewritten to use
Perhaps, but it's certainly beyond the scope of "initial import" commit.


https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/main.c
File src/host/gprsdecode/main.c:

PS1, Line 26: /*printf("TS = %d, FN = %d (%d)\n", ts, fn, 
process_pdch(bi));
:   else
:   printf("TS = %d, FN = %d [%d]\n", ts, fn, fn % 13);
: */
> Why this part is commented out?
Debug aid, I'd prefer to keep it here until all MCS* are implemented. We can 
drop it afterwards.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I12234d37c66b83b8abd60f7511fa1d7837db1856
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-HasComments: Yes


[PATCH] osmocom-bb[master]: Add burst_ind struct

2018-02-01 Thread Max

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

Add burst_ind struct

It's used by both burst_ind branch and gprsdecode tool (will be added in
follow-up patch).

Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Related: OS#1672
---
M include/l1ctl_proto.h
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/6237/1

diff --git a/include/l1ctl_proto.h b/include/l1ctl_proto.h
index 37d3d87..350a6d3 100644
--- a/include/l1ctl_proto.h
+++ b/include/l1ctl_proto.h
@@ -295,6 +295,19 @@
};
 } __attribute__((packed));
 
+#define BI_FLG_DUMMY (1 << 4)
+#define BI_FLG_SACCH (1 << 5)
+
+struct l1ctl_burst_ind {
+   uint32_t frame_nr;
+   uint16_t band_arfcn;/* ARFCN + band + ul indicator   */
+   uint8_t chan_nr;/* GSM 08.58 channel number (9.3.1)  */
+   uint8_t flags;  /* BI_FLG_xxx + burst_id = 2LSBs */
+   uint8_t rx_level;   /* 0 .. 63 in typical GSM notation (dBm+110) */
+   uint8_t snr;/* Reported SNR >> 8 (0-255) */
+   uint8_t bits[15];   /* 114 bits + 2 steal bits. Filled MSB first */
+} __attribute__((packed));
+
 /* a single L1CTL_PM response */
 struct l1ctl_pm_conf {
uint16_t band_arfcn;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I75e33c38accdf2a0af961c89836c5e7a3a056bda
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Max 


[PATCH] libosmocore[master]: tests: utils_test: Fix test failure when compiling with -O0

2018-02-01 Thread Pau Espin Pedrol

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

tests: utils_test: Fix test failure when compiling with -O0

It seems with default flags in_buf was being memzeroed by the compiler.
When compiling with -O0, that's not the case anymore and printf prints
after first 16 bytes, printing extra garbage which doesn't match the
expected output.

Change-Id: I736c1e4d625f647d3bb794fa717256e9dbf36e87
---
M tests/utils/utils_test.c
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/6236/1

diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c
index b4f7cd3..f358e9a 100644
--- a/tests/utils/utils_test.c
+++ b/tests/utils/utils_test.c
@@ -334,6 +334,7 @@
 
printf("\nTesting string escaping\n");
printf("- all chars from 0 to 255 in batches of 16:\n");
+   in_buf[16] = '\0';
for (j = 0; j < 16; j++) {
for (i = 0; i < 16; i++)
in_buf[i] = (j << 4) | i;

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

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


[PATCH] libosmocore[master]: tests: coding_test: Fix compilation with -O0

2018-02-01 Thread Pau Espin Pedrol

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

tests: coding_test: Fix compilation with -O0

inline keyword is a hint for the compiler to inline the function, but
it's not mandatory. If no static or extern is specified, the definition
is only visible in the current unit but the identifier still has
external linkage.
When running with -O0 it seems the compiler (gcc 7.2.1) decides to use
the external linkage but at the same time it seems it's not generating
the function symbol. Fix it by explicitly stating that we want to use
static linking for this function.

coding/coding_test.o: In function `test_xcch':
libosmocore/tests/coding/coding_test.c:86: undefined reference to `dump_ubits'
libosmocore/tests/coding/coding_test.c:87: undefined reference to `dump_sbits'

Change-Id: I18018adec05ce1c2ddbca38653311d74c7454ce8
---
M tests/coding/coding_test.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/35/6235/1

diff --git a/tests/coding/coding_test.c b/tests/coding/coding_test.c
index 511dbb7..660f51f 100644
--- a/tests/coding/coding_test.c
+++ b/tests/coding/coding_test.c
@@ -44,7 +44,7 @@
return; \
} while(0)
 
-inline void dump_ubits(ubit_t *bursts_u, unsigned until)
+static inline void dump_ubits(ubit_t *bursts_u, unsigned until)
 {
printf("U-Bits:\n");
DUMP_U_AT(bursts_u, 0, until);
@@ -57,7 +57,7 @@
DUMP_U_AT(bursts_u, 812, until);
 }
 
-inline void dump_sbits(uint8_t *bursts_s, unsigned until)
+static inline void dump_sbits(uint8_t *bursts_s, unsigned until)
 {
printf("S-Bits:\n");
DUMP_S_AT(bursts_s, 0, until);

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

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


osmo-gsm-tester[master]: Create a cumulative distribution function class

2018-02-01 Thread Pau Espin Pedrol

Patch Set 1: Code-Review-1

-1 for whitespace

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-gsm-tester[master]: WIP.. add example test script and support library

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1:

(4 comments)

Multiple ws...

https://gerrit.osmocom.org/#/c/6232/1/src/osmo_ms_driver/lua/json.lua
File src/osmo_ms_driver/lua/json.lua:

Line 41: end 
ws


Line 130: local function create_set(...) 
ws


Line 247: 
ws


https://gerrit.osmocom.org/#/c/6232/1/src/osmo_ms_driver/lua/ms_support.lua
File src/osmo_ms_driver/lua/ms_support.lua:

Line 12:g_ms = ms 
ws


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ica5aa0c2f86d0e5d8a2bc4dc0652de18762dd156
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


osmo-gsm-tester[master]: Create a cumulative distribution function class

2018-02-01 Thread Vadim Yanitskiy

Patch Set 1:

(3 comments)

https://gerrit.osmocom.org/#/c/6230/1/src/osmo_ms_driver/cdf.py
File src/osmo_ms_driver/cdf.py:

Line 50: 
ws


Line 128: 
ws


Line 134: 
ws


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes