[PATCH] osmo-iuh[master]: hnbgw: use proper talloc ctx for vty telnet init

2017-12-19 Thread Neels Hofmeyr

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

hnbgw: use proper talloc ctx for vty telnet init

Change-Id: I355c6e5489f24566612528cd679c5cab21eed008
---
M src/hnbgw.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/22/5522/1

diff --git a/src/hnbgw.c b/src/hnbgw.c
index 45a753f..ff3e2a9 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -471,7 +471,7 @@
log_set_log_level(osmo_stderr_target,
  hnbgw_cmdline_config.log_level);
 
-   rc = telnet_init_dynif(NULL, g_hnb_gw, vty_get_bind_addr(), 
OSMO_VTY_PORT_HNBGW);
+   rc = telnet_init_dynif(tall_hnb_ctx, g_hnb_gw, vty_get_bind_addr(), 
OSMO_VTY_PORT_HNBGW);
if (rc < 0) {
perror("Error binding VTY port");
exit(1);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I355c6e5489f24566612528cd679c5cab21eed008
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-iuh[master]: hnbgw: use proper VTY port number defined in libosmocore (4261)

2017-12-19 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5521

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

hnbgw: use proper VTY port number defined in libosmocore (4261)

We used to have hardcoded 2323 from early development, use the proper
libosmocore definition instead.

Depends: Ife52a968a41cb286f640006587877971ff66c1a4 (libosmocore)
Change-Id: Id67d89695ebdc6288f507338c15ad773b8adf6e4
---
M src/hnbgw.c
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/21/5521/2

diff --git a/src/hnbgw.c b/src/hnbgw.c
index c1b931c..45a753f 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -470,7 +471,7 @@
log_set_log_level(osmo_stderr_target,
  hnbgw_cmdline_config.log_level);
 
-   rc = telnet_init_dynif(NULL, g_hnb_gw, vty_get_bind_addr(), 2323);
+   rc = telnet_init_dynif(NULL, g_hnb_gw, vty_get_bind_addr(), 
OSMO_VTY_PORT_HNBGW);
if (rc < 0) {
perror("Error binding VTY port");
exit(1);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id67d89695ebdc6288f507338c15ad773b8adf6e4
Gerrit-PatchSet: 2
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-gsm-manuals[master]: common: ports: tweak OpenGGSN to osmo-ggsn as on port-number...

2017-12-19 Thread Neels Hofmeyr

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

common: ports: tweak OpenGGSN to osmo-ggsn as on port-numbers wiki page

Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers
Change-Id: Ieaac06c9d914fc7481107ca8ebe6192b36b91bcd
---
M common/chapters/port_numbers.adoc
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/18/5518/1

diff --git a/common/chapters/port_numbers.adoc 
b/common/chapters/port_numbers.adoc
index a69483a..15573ab 100644
--- a/common/chapters/port_numbers.adoc
+++ b/common/chapters/port_numbers.adoc
@@ -31,10 +31,10 @@
 |TCP|4254|telnet (VTY)|osmo-msc
 |TCP|4255|Control Interface|osmo-msc
 |TCP|4256|telnet (VTY)|osmo-sip-connector
-|TCP|4257|Control Interface|ggsn (OpenGGSN)
+|TCP|4257|Control Interface|osmo-ggsn, ggsn (OpenGGSN)
 |TCP|4258|telnet (VTY)|osmo-hlr
 |TCP|4259|Control Interface|osmo-hlr
-|TCP|4260|telnet (VTY)|ggsn (OpenGGSN)
+|TCP|4260|telnet (VTY)|osmo-ggsn
 |UDP|4729|GSMTAP|Almost every osmocom project
 |TCP|5000|A/IP|osmo-bsc, osmo-bsc_nat
 |UDP|2427|GSMTAP|osmo-pcu, osmo-bts

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaac06c9d914fc7481107ca8ebe6192b36b91bcd
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-gsm-manuals[master]: ports: add osmo-hnbgw as on port-numbers wiki page

2017-12-19 Thread Neels Hofmeyr

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

ports: add osmo-hnbgw as on port-numbers wiki page

Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers
Related: Ife52a968a41cb286f640006587877971ff66c1a4 (libosmocore)
Change-Id: I28bd7a97d24455f88fadc6724d45c3264ba2fce4
---
M common/chapters/port_numbers.adoc
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals 
refs/changes/19/5519/1

diff --git a/common/chapters/port_numbers.adoc 
b/common/chapters/port_numbers.adoc
index 15573ab..fd2cf8c 100644
--- a/common/chapters/port_numbers.adoc
+++ b/common/chapters/port_numbers.adoc
@@ -35,6 +35,8 @@
 |TCP|4258|telnet (VTY)|osmo-hlr
 |TCP|4259|Control Interface|osmo-hlr
 |TCP|4260|telnet (VTY)|osmo-ggsn
+|TCP|4261|telnet (VTY)|osmo-hnbgw
+|TCP|4262|Control Interface|osmo-hnbgw
 |UDP|4729|GSMTAP|Almost every osmocom project
 |TCP|5000|A/IP|osmo-bsc, osmo-bsc_nat
 |UDP|2427|GSMTAP|osmo-pcu, osmo-bts

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28bd7a97d24455f88fadc6724d45c3264ba2fce4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] osmo-iuh[master]: hnbgw: use proper VTY port number defined in libosmocore (4261)

2017-12-19 Thread Neels Hofmeyr

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

hnbgw: use proper VTY port number defined in libosmocore (4261)

We used to have hardcoded 2323 from early development, use the proper
libosmocore definition instead.

Depends: Ife52a968a41cb286f640006587877971ff66c1a4 (libosmocore)
Change-Id: Id67d89695ebdc6288f507338c15ad773b8adf6e4
---
M src/hnbgw.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/21/5521/1

diff --git a/src/hnbgw.c b/src/hnbgw.c
index c1b931c..41958ea 100644
--- a/src/hnbgw.c
+++ b/src/hnbgw.c
@@ -470,7 +470,7 @@
log_set_log_level(osmo_stderr_target,
  hnbgw_cmdline_config.log_level);
 
-   rc = telnet_init_dynif(NULL, g_hnb_gw, vty_get_bind_addr(), 2323);
+   rc = telnet_init_dynif(NULL, g_hnb_gw, vty_get_bind_addr(), 
OSMO_VTY_PORT_HNBGW);
if (rc < 0) {
perror("Error binding VTY port");
exit(1);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id67d89695ebdc6288f507338c15ad773b8adf6e4
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


[PATCH] libosmocore[master]: ports: define proper VTY and CTRL ports for OsmoHNBGW

2017-12-19 Thread Neels Hofmeyr

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

ports: define proper VTY and CTRL ports for OsmoHNBGW

So far it uses 2323, a development default. Instead, assign new ports,
appending to the common range of VTY and CTRL ports: 4261 and 4262.

Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers
Related: I28bd7a97d24455f88fadc6724d45c3264ba2fce4 (osmo-gsm-manuals)
Change-Id: Ife52a968a41cb286f640006587877971ff66c1a4
---
M include/osmocom/ctrl/ports.h
M include/osmocom/vty/ports.h
2 files changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/5520/1

diff --git a/include/osmocom/ctrl/ports.h b/include/osmocom/ctrl/ports.h
index f974daf..4e93190 100644
--- a/include/osmocom/ctrl/ports.h
+++ b/include/osmocom/ctrl/ports.h
@@ -17,4 +17,5 @@
 /* 4256 used by VTY interface */
 #define OSMO_CTRL_PORT_GGSN4257
 #define OSMO_CTRL_PORT_HLR 4259
+#define OSMO_CTRL_PORT_HNBGW   4262
 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */
diff --git a/include/osmocom/vty/ports.h b/include/osmocom/vty/ports.h
index ff0b58c..4819b87 100644
--- a/include/osmocom/vty/ports.h
+++ b/include/osmocom/vty/ports.h
@@ -29,4 +29,6 @@
 #define OSMO_VTY_PORT_HLR  4258
 /* 4259 used by control interface */
 #define OSMO_VTY_PORT_GGSN 4260
+#define OSMO_VTY_PORT_HNBGW4261
+/* 4262 used by control interface */
 /* When adding/changing port numbers, keep docs and wiki in sync. See above. */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife52a968a41cb286f640006587877971ff66c1a4
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


Re: Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64

2017-12-19 Thread Neels Hofmeyr
This is most probably related to / fixed by https://gerrit.osmocom.org/5516 :

[  142s] <001e> rate_ctr.c:195 counter group 'msc' already exists for 
index 0
[  142s] 
/usr/src/packages/BUILD/openbsc/tests/testsuite.dir/at-groups/1/test-source:
 line 25: 20213 Segmentation fault  
$abs_top_builddir/tests/gsm0408/gsm0408_test

On Tue, Dec 19, 2017 at 08:14:06PM +, OBS Notification wrote:
> Visit 
> https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64


signature.asc
Description: PGP signature


osmo-iuh[master]: iu client: store multiple LAC, RAC per RNC = fix paging for m...

2017-12-19 Thread Neels Hofmeyr

Patch Set 4: -Code-Review Verified+1

verified to work in manual test with two nano3G

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I189f8e2663353276b1c615d2f78455dafe568045
Gerrit-PatchSet: 4
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: rate_ctr: fix osmo-sgsn DoS: don't return NULL on already us...

2017-12-19 Thread Neels Hofmeyr

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

rate_ctr: fix osmo-sgsn DoS: don't return NULL on already used index

Recent patch I563764af1d28043e909234ebb048239125ce6ecd introduced returning
NULL from rate_ctr_group_alloc() when the index passed already exists.

Instead of returning NULL, find an unused group index and use that, adjust the
error message.

In stats_test.c, adjust, and also assert allocated counter group indexes
everywhere.

Rationale:

The original patch causes osmo-sgsn to crash as soon as the second subscriber
attempts to establish an MM context. Of course osmo-sgsn is wrong to a) fail to
check a NULL return value and crash and b) to fail to allocate an MM context
just because the rate counter group could not be allocated (it still rejects
the MM context completely if rate_ctr_group_alloc() fails).

Nevertheless, the price we pay for rate counter correctness is, at least in
this instance, way too high: osmo-sgsn becomes completely unusable for more
than one subscriber.

Numerous other places exist where rate_ctr_group_alloc() is called with a
constant index number; from a quick grep magic I found these possible breaking
points:

osmo-sgsn/src/gprs/gb_proxy.c:1431: cfg->ctrg = 
rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0);
osmo-sgsn/src/gprs/gprs_sgsn.c:139: sgsn->rate_ctrs = 
rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0);
osmo-sgsn/src/gprs/gprs_sgsn.c:270: ctx->ctrg = rate_ctr_group_alloc(ctx, 
&mmctx_ctrg_desc, 0);
osmo-sgsn/src/gprs/gtphub.c:888:b->counters_io = 
rate_ctr_group_alloc(osmo_gtphub_ctx,
  
>phub_ctrg_io_desc, 0);
osmo-bsc/src/libfilter/bsc_msg_acc.c:87:lst->stats = 
rate_ctr_group_alloc(lst, &bsc_cfg_acc_list_desc, 0);
osmo-pcu/src/bts.cpp:228:   m_ratectrs = 
rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:793:   tbf->m_ctrs = rate_ctr_group_alloc(tbf, 
&tbf_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:879:   tbf->m_ul_egprs_ctrs = 
rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:880:   tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, 
&tbf_ul_gprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:970:   tbf->m_dl_egprs_ctrs = 
rate_ctr_group_alloc(tbf, &tbf_dl_egprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:977:   tbf->m_dl_gprs_ctrs = 
rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:1475:  ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, 
&tbf_ctrg_desc, 0);
osmo-pcu/src/bts.cpp:226:   m_ratectrs = 
rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 1);

We can fix all of these callers and then reconsider returning NULL, but IMO
even into the future, rate counter group indexes are not something worth
failing to provide service for. For future bugs we should keep the automatic
index picking in case of index collisions. We will get an error message barfed
and can fix the issue in our own time, while the application remains completely
usable, and even the rate counters can still be queried (at wrong indexes, but
life is tough).

Related: I49aa95b610f2faec52dede2e4816da47ca1dfb14 (osmo-sgsn's segfault)
Change-Id: Iba6e41b8eeaea5ff6ed862bab3f34a62ab976914
---
M src/rate_ctr.c
M tests/stats/stats_test.c
2 files changed, 31 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/5516/1

diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 72c6bb1..ec054c5 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -178,6 +178,27 @@
return NULL;
 }
 
+/*! Find an unused index for this rate counter group.
+ *  \param[in] name Name of the counter group
+ *  \returns the largest used index number + 1, or 0 if none exist yet. */
+static unsigned int rate_ctr_get_unused_name_idx(const char *name)
+{
+   unsigned int idx = 0;
+   struct rate_ctr_group *ctrg;
+
+   llist_for_each_entry(ctrg, &rate_ctr_groups, list) {
+   if (!ctrg->desc)
+   continue;
+
+   if (strcmp(ctrg->desc->group_name_prefix, name))
+   continue;
+
+   if (idx <= ctrg->idx)
+   idx = ctrg->idx + 1;
+   }
+   return idx;
+}
+
 /*! Allocate a new group of counters according to description
  *  \param[in] ctx \ref talloc context
  *  \param[in] desc Rate counter group description
@@ -191,9 +212,11 @@
struct rate_ctr_group *group;
 
if (rate_ctr_get_group_by_name_idx(desc->group_name_prefix, idx)) {
-   LOGP(DLGLOBAL, LOGL_ERROR, "counter group '%s' already exists 
for index %u\n",
-desc->group_name_prefix, idx);
-   return NULL; /* group already exist */
+   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,"
+" i

[PATCH] osmo-sgsn[master]: gprs_gmm: segfault: gracefully handle failure to alloc context

2017-12-19 Thread Neels Hofmeyr

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

gprs_gmm: segfault: gracefully handle failure to alloc context

This counter allocation error I hit uncovers a segfault when allocating an MM
context fails in the GSM_MI_TYPE_TMSI case:

  DRANAP <001a> ../../../src/osmo-iuh/src/iu_client.c:509 
handle_co_initial(dir=1, proc=19)
  DRANAP <001a> ../../../src/osmo-iuh/src/iu_client.c:229 RNC 23: new LAC 24358 
RAC 22
  DMM <0002> ../../../../src/osmo-sgsn/src/gprs/gprs_gmm.c:1271 
MM(---/) -> GMM ATTACH REQUEST MI(3427325924) type="GPRS attach"
  DLGLOBAL <001d> ../../../src/libosmocore/src/rate_ctr.c:195 counter group 
'sgsn:mmctx' already exists for index 0
  DMM <0002> ../../../../src/osmo-sgsn/src/gprs/gprs_sgsn.c:272 MM(/) 
Cannot allocate counter group

  Program received signal SIGSEGV, Segmentation fault.
  gsm48_rx_gmm_att_req (llme=0x0, msg=0x55886950, ctx=0x0) at 
../../../../src/osmo-sgsn/src/gprs/gprs_gmm.c:1375
  1375  ctx->p_tmsi = tmsi;

Fix it with a bit of code already present for the GSM_MI_TYPE_IMSI case just
above the segfault.

Change-Id: I49aa95b610f2faec52dede2e4816da47ca1dfb14
---
M src/gprs/gprs_gmm.c
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/17/5517/1

diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c
index 147e001..8441f6b 100644
--- a/src/gprs/gprs_gmm.c
+++ b/src/gprs/gprs_gmm.c
@@ -1372,6 +1372,10 @@
ctx = sgsn_mm_ctx_alloc_iu(msg->dst);
else
ctx = sgsn_mm_ctx_alloc_gb(msgb_tlli(msg), 
&ra_id);
+   if (!ctx) {
+   reject_cause = GMM_CAUSE_NET_FAIL;
+   goto rejected;
+   }
ctx->p_tmsi = tmsi;
}
if (ctx->ran_type == MM_CTX_T_GERAN_Gb) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49aa95b610f2faec52dede2e4816da47ca1dfb14
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


libosmo-sccp[master]: ss7: Re-bind xUA server socket after setting new IP

2017-12-19 Thread Pau Espin Pedrol

Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/#/c/4893/4/src/osmo_ss7.c
File src/osmo_ss7.c:

Line 1792: osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum 
osmo_ss7_asp_protocol proto,
> to keep the public API backwards compatible, you should rather introduce os
We don't need changes anywhere else because the only direct user of this API is 
osmo-stp which resides in this same repository and its implementation is fixed 
in the same code. Other users like osmo-msc or osmo-bsc, afaik, use the 
"simple_server" API, whose implementation is also fixed internally in this 
commit to bind the IPs after creating the server, which means no code or VTY 
change is needed for projects using the "simple_server" API.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I79738963d633bec70705ff159c5b2127cd498aa2
Gerrit-PatchSet: 4
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: neels 
Gerrit-HasComments: Yes


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/armv7l

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/armv7l

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  412s] | ac_cv_header_memory_h=yes
[  412s] | ac_cv_header_pcap_pcap_h=yes
[  412s] | ac_cv_header_stdc=yes
[  412s] | ac_cv_header_stdint_h=yes
[  412s] | ac_cv_header_stdlib_h=yes
[  412s] | ac_cv_header_string_h=yes
[  412s] | ac_cv_header_strings_h=yes
[  412s] | ac_cv_header_sys_stat_h=yes
[  412s] | ac_cv_header_sys_types_h=yes
[  412s] | ac_cv_header_unistd_h=yes
[  412s] | ac_cv_host=arm-unknown-linux-gnueabihf
[  412s] | ac_cv_objext=o
[  412s] | ac_cv_path_EGREP='/bin/grep -E'
[  412s] | ac_cv_path_FGREP='/bin/grep -F'
[  412s] | ac_cv_path_GREP=/bin/grep
[  412s] | ac_cv_path_PKG_CONFIG_INSTALLED=/usr/bin/pkg-config
[  412s] | ac_cv_path_SED=/bin/sed
[  412s] | ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
[  412s] | ac_cv_path_install='/usr/bin/install -c'
[  412s] | ac_cv_path_lt_DD=/bin/dd
[  412s] | ac_cv_path_mkdir=/bin/mkdir
[  412s] | ac_cv_prog_AWK=gawk
[  412s] | ac_cv_prog_CPP='gcc -E'
[  414s] | ac_cv_prog_a[  359.118835] SysRq : Power Off
[  414s] [  359.120183] reboot: Power down
[  414s] ### VM INTERACTION END ###
[  414s] 
[  414s] armbuild18 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
23:29:09 UTC 2017.
[  414s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


meta-telephony[201705]: osmo-sgsn: no longer depend on libpcap

2017-12-19 Thread Pau Espin Pedrol

Patch Set 1: Verified-1

This should actually be merged against branch laforge/nightly instead of 
201705, since 201705 still doesn't  use an osmo-sgsn new enough.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I284c16c1f7abd3b24525b824baca357576f16675
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: 201705
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


[PATCH] osmo-hlr[master]: fix debug log: put 'deriving 2G from 3G' in proper place

2017-12-19 Thread Neels Hofmeyr

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

fix debug log: put 'deriving 2G from 3G' in proper place

Don't log "deriving 2G from 3G" when we're actually calculating separately; log
it when we're actually deriving from 3G.

Add log "calculating 2G separately" in the right place.

The test output changes show that each test said "separate 2G" at the top while
logging "deriving 2G from 3G" further down, which was obviously wrong.

Change-Id: I6679d7ef8fdcae39a0c2aff7ac638e63dddb10dc
---
M src/auc.c
M tests/auc/auc_test.err
M tests/auc/auc_ts_55_205_test_sets.err
3 files changed, 32 insertions(+), 3 deletions(-)


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

diff --git a/src/auc.c b/src/auc.c
index f55b377..79c3918 100644
--- a/src/auc.c
+++ b/src/auc.c
@@ -144,6 +144,7 @@
 
if (!aud2g) {
/* use the 2G tokens from 3G keys */
+   DBGP("vector [%u]: deriving 2G from 3G\n", i);
DBGVB(kc);
DBGVB(sres);
DBGVV("0x%x", auth_types);
@@ -151,7 +152,7 @@
}
/* calculate 2G separately */
 
-   DBGP("vector [%u]: deriving 2G from 3G\n", i);
+   DBGP("vector [%u]: calculating 2G separately\n", i);
 
rc = osmo_auth_gen_vec(&vtmp, aud2g, rand);
if (rc < 0) {
diff --git a/tests/auc/auc_test.err b/tests/auc/auc_test.err
index 5263d04..0a4d9af 100644
--- a/tests/auc/auc_test.err
+++ b/tests/auc/auc_test.err
@@ -35,7 +35,7 @@
 DAUC vector [0]: ik = 27497388b6cb044648f396aa155b95ef
 DAUC vector [0]: res = e229c19e791f2e41
 DAUC vector [0]: res_len = 8
-DAUC vector [0]: deriving 2G from 3G
+DAUC vector [0]: calculating 2G separately
 DAUC vector [0]: kc = 241a5b16aeb8e400
 DAUC vector [0]: sres = 429d5b27
 DAUC vector [0]: auth_types = 0x3
@@ -55,7 +55,7 @@
 DAUC vector [0]: ik = 27497388b6cb044648f396aa155b95ef
 DAUC vector [0]: res = e229c19e791f2e41
 DAUC vector [0]: res_len = 8
-DAUC vector [0]: deriving 2G from 3G
+DAUC vector [0]: calculating 2G separately
 DAUC vector [0]: kc = 241a5b16aeb8e400
 DAUC vector [0]: sres = 429d5b27
 DAUC vector [0]: auth_types = 0x3
@@ -78,6 +78,7 @@
 DAUC vector [0]: ik = 27497388b6cb044648f396aa155b95ef
 DAUC vector [0]: res = e229c19e791f2e41
 DAUC vector [0]: res_len = 8
+DAUC vector [0]: deriving 2G from 3G
 DAUC vector [0]: kc = 059a4f668f6fbe39
 DAUC vector [0]: sres = 9b36efdf
 DAUC vector [0]: auth_types = 0x3
@@ -96,6 +97,7 @@
 DAUC vector [0]: ik = 27497388b6cb044648f396aa155b95ef
 DAUC vector [0]: res = e229c19e791f2e41
 DAUC vector [0]: res_len = 8
+DAUC vector [0]: deriving 2G from 3G
 DAUC vector [0]: kc = 059a4f668f6fbe39
 DAUC vector [0]: sres = 9b36efdf
 DAUC vector [0]: auth_types = 0x3
@@ -117,6 +119,7 @@
 DAUC vector [0]: ik = f19c20ca863137f8892326d959ec5e01
 DAUC vector [0]: res = 9af5a557902d2db8
 DAUC vector [0]: res_len = 8
+DAUC vector [0]: deriving 2G from 3G
 DAUC vector [0]: kc = 7526fc13c5976685
 DAUC vector [0]: sres = 0ad888ef
 DAUC vector [0]: auth_types = 0x3
@@ -137,6 +140,7 @@
 DAUC vector [0]: ik = f19c20ca863137f8892326d959ec5e01
 DAUC vector [0]: res = 9af5a557902d2db8
 DAUC vector [0]: res_len = 8
+DAUC vector [0]: deriving 2G from 3G
 DAUC vector [0]: kc = 7526fc13c5976685
 DAUC vector [0]: sres = 0ad888ef
 DAUC vector [0]: auth_types = 0x3
@@ -147,6 +151,7 @@
 DAUC vector [1]: ik = 79f21ed53bcb47787de57d136ff803a5
 DAUC vector [1]: res = 43023475cb29292c
 DAUC vector [1]: res_len = 8
+DAUC vector [1]: deriving 2G from 3G
 DAUC vector [1]: kc = aef73dd515e86c15
 DAUC vector [1]: sres = 882b1d59
 DAUC vector [1]: auth_types = 0x3
@@ -157,6 +162,7 @@
 DAUC vector [2]: ik = 648dab72016181406243420649e63dc9
 DAUC vector [2]: res = 010cab11cc63a6e4
 DAUC vector [2]: res_len = 8
+DAUC vector [2]: deriving 2G from 3G
 DAUC vector [2]: kc = f0eaf8cb19e0758d
 DAUC vector [2]: sres = cd6f0df5
 DAUC vector [2]: auth_types = 0x3
@@ -179,6 +185,7 @@
 DAUC vector [0]: ik = f19c20ca863137f8892326d959ec5e01
 DAUC vector [0]: res = 9af5a557902d2db8
 DAUC vector [0]: res_len = 8
+DAUC vector [0]: deriving 2G from 3G
 DAUC vector [0]: kc = 7526fc13c5976685
 DAUC vector [0]: sres = 0ad888ef
 DAUC vector [0]: auth_types = 0x3
@@ -189,6 +196,7 @@
 DAUC vector [1]: ik = 79f21ed53bcb47787de57d136ff803a5
 DAUC vector [1]: res = 43023475cb29292c
 DAUC vector [1]: res_len = 8
+DAUC vector [1]: deriving 2G from 3G
 DAUC vector [1]: kc = aef73dd515e86c15
 DAUC vector [1]: sres = 882b1d59
 DAUC vector [1]: auth_types = 0x3
@@ -199,6 +207,7 @@
 DAUC vector [2]: ik = 648dab72016181406243420649e63dc9
 DAUC vector [2]: res = 010cab11cc63a6e4
 DAUC vector [2]: res_len = 8
+D

osmo-ci[master]: jobs: master: fix: libosmoabis should trigger osmo-hlr

2017-12-19 Thread Neels Hofmeyr

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9a122cee4fa98115140e4a34f623958697affed2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] osmo-ci[master]: jobs: master: fix: libosmoabis should trigger osmo-hlr

2017-12-19 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: jobs: master: fix: libosmoabis should trigger osmo-hlr
..


jobs: master: fix: libosmoabis should trigger osmo-hlr

Change-Id: I9a122cee4fa98115140e4a34f623958697affed2
---
M jobs/master-builds.yml
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved; Verified



diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 78d373b..3e2e5fb 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -35,7 +35,7 @@
   - libasn1c
   - libgtpnl
   - libosmo-abis:
-  trigger: master-openbsc, master-libosmo-netif
+  trigger: master-openbsc, master-libosmo-netif, master-osmo-hlr
 
   - libosmo-dsp:
   cmd: >

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9a122cee4fa98115140e4a34f623958697affed2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 


[PATCH] osmo-ci[master]: jobs: master: fix: libosmoabis should trigger osmo-hlr

2017-12-19 Thread Neels Hofmeyr

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

jobs: master: fix: libosmoabis should trigger osmo-hlr

Change-Id: I9a122cee4fa98115140e4a34f623958697affed2
---
M jobs/master-builds.yml
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/14/5514/1

diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml
index 78d373b..3e2e5fb 100644
--- a/jobs/master-builds.yml
+++ b/jobs/master-builds.yml
@@ -35,7 +35,7 @@
   - libasn1c
   - libgtpnl
   - libosmo-abis:
-  trigger: master-openbsc, master-libosmo-netif
+  trigger: master-openbsc, master-libosmo-netif, master-osmo-hlr
 
   - libosmo-dsp:
   cmd: >

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a122cee4fa98115140e4a34f623958697affed2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/aarch64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/aarch64

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[ 1046s] | configure:3076: checking whether make sets $(MAKE)
[ 1046s] | configure:3098: result: yes
[ 1046s] | configure:3155: checking for gcc
[ 1046s] | configure:3171: found /usr/bin/gcc
[ 1046s] | configure:3182: result: gcc
[ 1046s] | configure:3411: checking for C compiler version
[ 1046s] | configure:3420: gcc --version >&5
[ 1046s] | gcc (Debian 6.3.0-18) 6.3.0 20170516
[ 1046s] | Copyright (C) 2016 Free Software Foundation, Inc.
[ 1046s] | This is free software; see the source for copying conditions.  There 
is NO
[ 1046s] | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.
[ 1046s] | 
[ 1046s] | configure:3431: $? = 0
[ 1046s] | configure:3420: gcc -v >&5
[ 1046s] | Using built-in specs.
[ 1046s] | COLLECT_GCC=gcc
[ 1046s] | COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/6/lto-wrapper
[ 1046s] | Target: aarch64-linux-gnu
[ 1046s] | Configured with: ../src/configure -v --with-pkgversion='Debian 
6.3.0-18' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs 
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-6 --program-prefix=aarch64-linux-gnu- --enable-shared 
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ 
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes 
--with-default-libstdcxx-abi=new --enable-gnu-unique-object 
--disable-libquadmath --enable-plugin --enable-default-pie --with-system-zlib 
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-arm64/jre --enable-java-home 
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-arm64 
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-arm64 
--with-arch-directory=aarch64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar 
--enable-multiarch --enable-fix-cortex-a53-843419 --enable-checking=release 
--build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu
[ 1046s] | Thread model: posix
[ 1046s] | gcc version 6.3.0 20170516 (Debian 6.3.0-18) 
[ 1046s] | configure:3431: $? = 0
[ 1046s] | configure:3420: gcc -V >&5
[ 1048s] | gcc: error: unrecognized command line option[  989.967956] sysrq: 
SysRq : Power Off
[ 1048s] [  989.982274] reboot: Power down
[ 1049s] ### VM INTERACTION END ###
[ 1049s] 
[ 1049s] obs-arm-2 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
21:24:50 UTC 2017.
[ 1049s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/x86_64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/x86_64

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  143s] | #define HAVE_STRINGS_H 1
[  143s] | #define HAVE_INTTYPES_H 1
[  143s] | #define HAVE_STDINT_H 1
[  143s] | #define HAVE_UNISTD_H 1
[  143s] | #define HAVE_DLFCN_H 1
[  143s] | #define LT_OBJDIR ".libs/"
[  143s] | #define BUILD_SMPP 1
[  143s] | #define STDC_HEADERS 1
[  143s] | #define HAVE_DBI_DBD_H 1
[  143s] | #define HAVE_PCAP_PCAP_H 1
[  143s] | #define HAVE_TM_GMTOFF_IN_TM 1
[  143s] | 
[  143s] | configure: exit 0
[  143s] 
[  143s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  143s] make[1]: *** [override_dh_auto_test] Error 1
[  143s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  143s] debian/rules:13: recipe for target 'build' failed
[  143s] make: *** [build] Error 2
[  143s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  143s] 
[  143s] lamb60 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:13:55 UTC 2017.
[  143s] 
[  143s] ### VM INTERACTION START ###
[  146s] [  138.219926] reboot: Power down
[  146s] ### VM INTERACTION END ###
[  146s] 
[  146s] lamb60 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:13:59 UTC 2017.
[  146s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/x86_64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  169s] | #define HAVE_STRINGS_H 1
[  169s] | #define HAVE_INTTYPES_H 1
[  169s] | #define HAVE_STDINT_H 1
[  169s] | #define HAVE_UNISTD_H 1
[  169s] | #define HAVE_DLFCN_H 1
[  169s] | #define LT_OBJDIR ".libs/"
[  169s] | #define BUILD_SMPP 1
[  169s] | #define STDC_HEADERS 1
[  169s] | #define HAVE_DBI_DBD_H 1
[  169s] | #define HAVE_PCAP_PCAP_H 1
[  169s] | #define HAVE_TM_GMTOFF_IN_TM 1
[  169s] | 
[  169s] | configure: exit 0
[  169s] 
[  169s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  169s] make[1]: *** [override_dh_auto_test] Error 1
[  169s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  169s] debian/rules:13: recipe for target 'build' failed
[  169s] make: *** [build] Error 2
[  169s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  169s] 
[  169s] cloud121 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:09:25 UTC 2017.
[  169s] 
[  169s] ### VM INTERACTION START ###
[  173s] [  156.925764] reboot: Power down
[  175s] ### VM INTERACTION END ###
[  175s] 
[  175s] cloud121 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:09:32 UTC 2017.
[  175s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.04/x86_64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.04/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.04/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  154s] -generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 
ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b 
[  154s] -generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 
54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b 
[  154s] -generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 
54 21 27 61 09 59 08 4b b7 2e ca c1 2b 
[  154s] -generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 
53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b 
[  154s] -Testing if BA-IND is set as expected in SI2xxx and SI5xxx
[  154s] -SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 
[  154s] -SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 
[  154s] -SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  154s] -SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  154s] -SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  154s] -SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  154s] -Done.
[  154s] ./testsuite.at:7: exit code was 139, expected 0
[  154s] 1. testsuite.at:4: 1. gsm0408 (testsuite.at:4): FAILED (testsuite.at:7)
[  154s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  154s] make[1]: *** [override_dh_auto_test] Error 1
[  154s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  154s] debian/rules:13: recipe for target 'build' failed
[  154s] make: *** [build] Error 2
[  154s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  154s] 
[  154s] lamb27 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:08:16 UTC 2017.
[  154s] 
[  154s] ### VM INTERACTION START ###
[  158s] [  150.072232] reboot: Power down
[  158s] ### VM INTERACTION END ###
[  158s] 
[  158s] lamb27 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:08:20 UTC 2017.
[  158s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.10/x86_64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.10/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  141s] -generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 
ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b 
[  141s] -generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 
54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b 
[  141s] -generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 
54 21 27 61 09 59 08 4b b7 2e ca c1 2b 
[  141s] -generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 
53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b 
[  141s] -Testing if BA-IND is set as expected in SI2xxx and SI5xxx
[  141s] -SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 
[  141s] -SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 
[  141s] -SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  141s] -SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  141s] -SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  141s] -SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  141s] -Done.
[  141s] ./testsuite.at:7: exit code was 139, expected 0
[  141s] 1. testsuite.at:4: 1. gsm0408 (testsuite.at:4): FAILED (testsuite.at:7)
[  141s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  141s] make[1]: *** [override_dh_auto_test] Error 1
[  141s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  141s] debian/rules:13: recipe for target 'build' failed
[  141s] make: *** [build] Error 2
[  141s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  141s] 
[  141s] lamb53 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:08:01 UTC 2017.
[  141s] 
[  141s] ### VM INTERACTION START ###
[  144s] [  136.852633] reboot: Power down
[  144s] ### VM INTERACTION END ###
[  144s] 
[  144s] lamb53 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:08:06 UTC 2017.
[  144s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/x86_64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/x86_64

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[   89s] | #define HAVE_STRINGS_H 1
[   89s] | #define HAVE_INTTYPES_H 1
[   89s] | #define HAVE_STDINT_H 1
[   89s] | #define HAVE_UNISTD_H 1
[   89s] | #define HAVE_DLFCN_H 1
[   89s] | #define LT_OBJDIR ".libs/"
[   89s] | #define BUILD_SMPP 1
[   89s] | #define STDC_HEADERS 1
[   89s] | #define HAVE_DBI_DBD_H 1
[   89s] | #define HAVE_PCAP_PCAP_H 1
[   89s] | #define HAVE_TM_GMTOFF_IN_TM 1
[   89s] | 
[   89s] | configure: exit 0
[   89s] 
[   89s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[   89s] make[1]: *** [override_dh_auto_test] Error 1
[   89s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[   89s] debian/rules:13: recipe for target 'build' failed
[   89s] make: *** [build] Error 2
[   89s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[   89s] 
[   89s] build84 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:06:52 UTC 2017.
[   89s] 
[   89s] ### VM INTERACTION START ###
[   92s] [   86.716305] reboot: Power down
[   92s] ### VM INTERACTION END ###
[   92s] 
[   92s] build84 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:06:55 UTC 2017.
[   92s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_8.0/x86_64

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_8.0/x86_64

Package network:osmocom:nightly/openbsc failed to build in Debian_8.0/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  136s] ./testsuite.at:7: exit code was 139, expected 0
[  136s] 1. testsuite.at:4: 1. gsm0408 (testsuite.at:4): FAILED (testsuite.at:7)
[  136s] # -*- compilation -*-
[  136s] 5. testsuite.at:31: testing channel ...
[  136s] ./testsuite.at:34: $abs_top_builddir/tests/channel/channel_test
[  136s] stderr:
[  136s] <001e> rate_ctr.c:195 counter group 'msc' already exists for index 0
[  136s] 
/usr/src/packages/BUILD/openbsc/tests/testsuite.dir/at-groups/5/test-source:
 line 25: 22819 Segmentation fault  
$abs_top_builddir/tests/channel/channel_test
[  136s] --- expout 2017-12-19 20:06:50.123997606 +
[  136s] +++ 
/usr/src/packages/BUILD/openbsc/tests/testsuite.dir/at-groups/5/stdout 
2017-12-19 20:06:50.123997606 +
[  136s] @@ -1,4 +0,0 @@
[  136s] -Testing the gsm_subscriber chan logic
[  136s] -Reached, didn't crash, test passed
[  136s] -Testing subslot numbers for pchan types
[  136s] -Testing the lchan printing: (bts=45,trx=0,ts=3,ss=4) 
(bts=45,trx=1,ts=3,ss=4)
[  136s] ./testsuite.at:34: exit code was 139, expected 0
[  136s] 5. testsuite.at:31: 5. channel (testsuite.at:31): FAILED 
(testsuite.at:34)
[  136s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  136s] make[1]: *** [override_dh_auto_test] Error 1
[  136s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  136s] debian/rules:13: recipe for target 'build' failed
[  136s] make: *** [build] Error 2
[  136s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  136s] 
[  136s] wildcard3 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:06:50 UTC 2017.
[  136s] 
[  136s] ### VM INTERACTION START ###
[  137s] Powering off.
[  137s] [  124.665690] reboot: Power down

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in Debian_9.0/i586

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/Debian_9.0/i586

Package network:osmocom:nightly/openbsc failed to build in Debian_9.0/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  150s] -generated valid SI2quater [02/05]: [23] 59 06 07 44 a0 04 86 59 83 c2 
ec 20 ff 61 08 19 08 41 b7 2e ca c1 2b 
[  150s] -generated valid SI2quater [03/05]: [23] 59 06 07 46 a0 04 86 59 84 21 
54 21 4f 61 0a 99 08 55 b7 2e ca c1 2b 
[  150s] -generated valid SI2quater [04/05]: [23] 59 06 07 48 a0 04 86 59 84 2b 
54 21 27 61 09 59 08 4b b7 2e ca c1 2b 
[  150s] -generated valid SI2quater [05/05]: [23] 59 06 07 4a a0 04 86 59 84 26 
53 97 65 60 2b 2b 2b 2b 2b 2b 2b 2b 2b 
[  150s] -Testing if BA-IND is set as expected in SI2xxx and SI5xxx
[  150s] -SI2: 59 06 1a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 
[  150s] -SI2bis: 59 06 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 
[  150s] -SI2ter: 59 06 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  150s] -SI5: 06 1d 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  150s] -SI5bis: 06 05 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  150s] -SI5ter: 06 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
[  150s] -Done.
[  150s] ./testsuite.at:7: exit code was 139, expected 0
[  150s] 1. testsuite.at:4: 1. gsm0408 (testsuite.at:4): FAILED (testsuite.at:7)
[  150s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  150s] make[1]: *** [override_dh_auto_test] Error 1
[  150s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  150s] debian/rules:13: recipe for target 'build' failed
[  150s] make: *** [build] Error 2
[  150s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  150s] 
[  150s] lamb06 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:05:37 UTC 2017.
[  150s] 
[  150s] ### VM INTERACTION START ###
[  153s] [  144.611310] reboot: Power down
[  153s] ### VM INTERACTION END ###
[  153s] 
[  153s] lamb06 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:05:41 UTC 2017.
[  153s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_16.10/i586

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_16.10/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_16.10/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  173s] | #define HAVE_STRINGS_H 1
[  173s] | #define HAVE_INTTYPES_H 1
[  173s] | #define HAVE_STDINT_H 1
[  173s] | #define HAVE_UNISTD_H 1
[  173s] | #define HAVE_DLFCN_H 1
[  173s] | #define LT_OBJDIR ".libs/"
[  173s] | #define BUILD_SMPP 1
[  173s] | #define STDC_HEADERS 1
[  173s] | #define HAVE_DBI_DBD_H 1
[  173s] | #define HAVE_PCAP_PCAP_H 1
[  173s] | #define HAVE_TM_GMTOFF_IN_TM 1
[  173s] | 
[  173s] | configure: exit 0
[  173s] 
[  173s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  173s] make[1]: *** [override_dh_auto_test] Error 1
[  173s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  173s] debian/rules:13: recipe for target 'build' failed
[  173s] make: *** [build] Error 2
[  173s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  173s] 
[  173s] build30 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:05:02 UTC 2017.
[  173s] 
[  173s] ### VM INTERACTION START ###
[  176s] [  162.221780] reboot: Power down
[  177s] ### VM INTERACTION END ###
[  177s] 
[  177s] build30 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:05:07 UTC 2017.
[  177s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/openbsc in xUbuntu_17.04/i586

2017-12-19 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/openbsc/xUbuntu_17.04/i586

Package network:osmocom:nightly/openbsc failed to build in xUbuntu_17.04/i586

Check out the package for editing:
  osc checkout network:osmocom:nightly openbsc

Last lines of build log:
[  138s] | #define HAVE_STRINGS_H 1
[  138s] | #define HAVE_INTTYPES_H 1
[  138s] | #define HAVE_STDINT_H 1
[  138s] | #define HAVE_UNISTD_H 1
[  138s] | #define HAVE_DLFCN_H 1
[  138s] | #define LT_OBJDIR ".libs/"
[  138s] | #define BUILD_SMPP 1
[  138s] | #define STDC_HEADERS 1
[  138s] | #define HAVE_DBI_DBD_H 1
[  138s] | #define HAVE_PCAP_PCAP_H 1
[  138s] | #define HAVE_TM_GMTOFF_IN_TM 1
[  138s] | 
[  138s] | configure: exit 0
[  138s] 
[  138s] debian/rules:32: recipe for target 'override_dh_auto_test' failed
[  138s] make[1]: *** [override_dh_auto_test] Error 1
[  138s] make[1]: Leaving directory '/usr/src/packages/BUILD'
[  138s] debian/rules:13: recipe for target 'build' failed
[  138s] make: *** [build] Error 2
[  138s] dpkg-buildpackage: error: debian/rules build gave error exit status 2
[  138s] 
[  138s] lamb02 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:03:28 UTC 2017.
[  138s] 
[  138s] ### VM INTERACTION START ###
[  141s] [  132.633609] reboot: Power down
[  141s] ### VM INTERACTION END ###
[  141s] 
[  141s] lamb02 failed "build openbsc_1.0.0.20171219.dsc" at Tue Dec 19 
20:03:31 UTC 2017.
[  141s] 

-- 
Configure notifications at https://build.opensuse.org/user/notifications
openSUSE Build Service (https://build.opensuse.org/)


[MERGED] osmo-bsc[master]: remove unused 'lac' member of 'struct gsm_subscriber_connect...

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: remove unused 'lac' member of 'struct gsm_subscriber_connection'
..


remove unused 'lac' member of 'struct gsm_subscriber_connection'

This field was used in write-pnly mode, i.e. set but never read.

Change-Id: I319945538fd3e3bc5cf3b9d82533641cb8ba5256
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
2 files changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 2e97055..3cc3794 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -96,8 +96,6 @@
 
/* buffer/cache for classmark of the ME of the subscriber */
struct gsm_classmark classmark;
-
-   uint16_t lac;
 };
 
 
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 6ff1688..9ec51af 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -261,7 +261,6 @@
conn->network = net;
conn->lchan = lchan;
conn->bts = lchan->ts->trx->bts;
-   conn->lac = conn->bts->location_area_code;
lchan->conn = conn;
llist_add_tail(&conn->entry, &net->subscr_conns);
return conn;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I319945538fd3e3bc5cf3b9d82533641cb8ba5256
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-bsc[master]: Remove unused struct osmo_bsc_sccp_con member sccp_queue_size

2017-12-19 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


[MERGED] osmo-bsc[master]: gsm_data.h: Document all fields of gsm_subscriber_connection

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gsm_data.h: Document all fields of gsm_subscriber_connection
..


gsm_data.h: Document all fields of gsm_subscriber_connection

Change-Id: I429fe7817f075d0794645d37f5ea11b104102ba0
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 14 insertions(+), 8 deletions(-)

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



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1cedef0..2e97055 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -75,20 +75,26 @@
/* libbsc subscriber information (if available) */
struct bsc_subscr *bsub;
 
-   /* bsc structures */
-   struct osmo_bsc_sccp_con *sccp_con; /* BSC */
+   /* SCCP connection associatd with this subscriber_connection */
+   struct osmo_bsc_sccp_con *sccp_con;
 
/* back pointers */
struct gsm_network *network;
 
-   struct gsm_lchan *lchan; /* BSC */
-   struct gsm_lchan *ho_lchan; /* BSC */
-   struct gsm_bts *bts; /* BSC */
+   /* the primary / currently active lchan to the BTS/subscriber */
+   struct gsm_lchan *lchan;
+   /* the future/allocated but not yet used lchan during HANDOVER */
+   struct gsm_lchan *ho_lchan;
+   /* a short-hand pointer to the BTS currently serving the subscriber,
+* points to gsm_subscriber_connection.lchan->ts->trx->bts */
+   struct gsm_bts *bts;
 
-   /* for assignment handling */
-   struct osmo_timer_list T10; /* BSC */
-   struct gsm_lchan *secondary_lchan; /* BSC */
+   /* timer for assignment handling */
+   struct osmo_timer_list T10;
+   /* the future allocated but not yet used lchan during ASSIGNMENT */
+   struct gsm_lchan *secondary_lchan;
 
+   /* buffer/cache for classmark of the ME of the subscriber */
struct gsm_classmark classmark;
 
uint16_t lac;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I429fe7817f075d0794645d37f5ea11b104102ba0
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-bsc[master]: osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'
..


osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

Change-Id: I674ed61a22fad5cc09c45128dbc73474893aefb6
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 5 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 13072c2..131007b 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -19,8 +19,10 @@
 struct bsc_msc_connection;
 
 struct osmo_bsc_sccp_con {
+   /* list_head anchoring us to gsm_network.subscr_conns */
struct llist_head entry;
 
+   /* flag to prevent multiple simultaneous ciphering commands */
int ciphering_handled;
 
/* for audio handling */
@@ -48,9 +50,12 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
+   /* back-pointer to subscriber connection */
struct gsm_subscriber_connection *conn;
+   /* state related to welcome USSD */
uint8_t new_subscriber;
 
+   /* state related to osmo_bsc_filter.c */
struct bsc_filter_state filter_state;
 
/* Sigtran connection ID */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I674ed61a22fad5cc09c45128dbc73474893aefb6
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-bsc[master]: Remove unused struct osmo_bsc_sccp_con member sccp_queue_size

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove unused struct osmo_bsc_sccp_con member sccp_queue_size
..


Remove unused struct osmo_bsc_sccp_con member sccp_queue_size

Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 0 insertions(+), 3 deletions(-)

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



diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 0fd29b7..13072c2 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -48,9 +48,6 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
-   struct llist_head sccp_queue;
-   unsigned int sccp_queue_size;
-
struct gsm_subscriber_connection *conn;
uint8_t new_subscriber;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-bsc[master]: osmo-bsc: Move user plane/voice related bits into sub-structure

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo-bsc: Move user plane/voice related bits into sub-structure
..


osmo-bsc: Move user plane/voice related bits into sub-structure

This clarifies which members of the struct are for what.

Change-Id: I618822e6f2d48adce25f9df5c25acbce7c858412
---
M include/osmocom/bsc/osmo_bsc.h
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_ctrl.c
M src/osmo-bsc/osmo_bsc_mgcp.c
M src/osmo-bsc/osmo_bsc_sigtran.c
7 files changed, 43 insertions(+), 44 deletions(-)

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



diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 131007b..485c836 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -26,23 +26,23 @@
int ciphering_handled;
 
/* for audio handling */
-   uint16_t cic;
-   uint32_t rtp_ip;
-   int rtp_port;
+   struct {
+   uint16_t cic;
+   uint32_t rtp_ip;
+   int rtp_port;
+   /* RTP address of the remote end (assigned by MSC through 
assignment request) */
+   struct sockaddr_storage aoip_rtp_addr_remote;
 
-   /* RTP address of the remote end (assigned by MSC through assignment
-* request) */
-   struct sockaddr_storage aoip_rtp_addr_remote;
+   /* Local RTP address (reported back to the MSC by us with the
+* assignment complete message) */
+   struct sockaddr_storage aoip_rtp_addr_local;
 
-   /* Local RTP address (reported back to the MSC by us with the
-* assignment complete message) */
-   struct sockaddr_storage aoip_rtp_addr_local;
-
-   /* storage to keep states of the MGCP connection handler, the
-* handler is created when an assignment request is received
-* and is terminated when the assignment complete message is
-* sent */
-   struct mgcp_ctx *mgcp_ctx;
+   /* storage to keep states of the MGCP connection handler, the
+   * handler is created when an assignment request is received
+   * and is terminated when the assignment complete message is
+   * sent */
+   struct mgcp_ctx *mgcp_ctx;
+   } user_plane;
 
/* for advanced ping/pong */
int send_ping;
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index 152b818..a2a8630 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -435,7 +435,7 @@
struct msgb *resp;
return_when_not_connected(conn);
 
-   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->rtp_ip) {
+   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->user_plane.rtp_ip) {
/* NOTE: In a network that makes use of an IPA base station
 * and AoIP, we have to wait until the BTS reports its RTP
 * IP/Port combination back to BSC via RSL. Unfortunately, the
diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c
index 0c11b85..82367f0 100644
--- a/src/osmo-bsc/osmo_bsc_audio.c
+++ b/src/osmo-bsc/osmo_bsc_audio.c
@@ -57,17 +57,17 @@
 
/* we can ask it to connect now */
LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n",
-con->sccp_con->rtp_port, lchan->abis_ip.conn_id);
+con->sccp_con->user_plane.rtp_port, 
lchan->abis_ip.conn_id);
 
/* If AoIP is in use, the rtp_ip, which has been communicated
 * via the A interface as connect_ip */
-   if(con->sccp_con->rtp_ip)
-   rtp_ip = con->sccp_con->rtp_ip;
+   if(con->sccp_con->user_plane.rtp_ip)
+   rtp_ip = con->sccp_con->user_plane.rtp_ip;
else
rtp_ip = ntohl(INADDR_ANY);
 
rc = rsl_ipacc_mdcx(lchan, rtp_ip,
-   con->sccp_con->rtp_port,
+   con->sccp_con->user_plane.rtp_port,
lchan->abis_ip.rtp_payload2);
if (rc < 0) {
LOGP(DMSC, LOGL_ERROR, "Failed to send MDCX: %d\n", rc);
@@ -84,13 +84,13 @@
 * inform the logic that controls the MGW about the new
 * connection info */
LOGP(DMSC, LOGL_INFO,"RTP connection handover 
initiated...\n");
-   mgcp_handover(con->sccp_con->mgcp_ctx, con->ho_lchan);
-   } else if (is_ipaccess_bts(con->bts) && con->sccp_con->rtp_ip) {
+   mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, 
con->ho_lchan);
+   } else if (is_ipaccess_bts(con->bts) && 
con->sccp_con->user_plane.r

[PATCH] osmo-bsc[master]: Remove unused struct osmo_bsc_sccp_con member sccp_queue_size

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5504

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

Remove unused struct osmo_bsc_sccp_con member sccp_queue_size

Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/5504/4

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 0fd29b7..13072c2 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -48,9 +48,6 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
-   struct llist_head sccp_queue;
-   unsigned int sccp_queue_size;
-
struct gsm_subscriber_connection *conn;
uint8_t new_subscriber;
 

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-gsm-tester[master]: osmo-bsc.cfg.tmpl: Remove bogus VTY commands

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo-bsc.cfg.tmpl: Remove bogus VTY commands
..


osmo-bsc.cfg.tmpl: Remove bogus VTY commands

There are plenty of VTY commands that were inherited from OsmoNITB,
but which make no sense in a BSC.  Upstream OsmoBSC has removed them in
change-ids Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38,
c499e5c62e9bef0db219e4658ffeb3292d6e6a5b and
8311a81bae85618302273c3f769275893161a7d7

Change-Id: I79ff48983d9cb7b875c1859870d5e3bce2c0ef22
---
M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
1 file changed, 0 insertions(+), 5 deletions(-)

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



diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
index 95db16d..56ebe5a 100644
--- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
@@ -29,13 +29,8 @@
 network
  network country code ${bsc.net.mcc}
  mobile network code ${bsc.net.mnc}
- short name ${bsc.net.short_name}
- long name ${bsc.net.long_name}
- location updating reject cause 13
  encryption ${bsc.net.encryption}
  neci 1
- rrlp mode none
- mm info 1
  handover 0
  handover window rxlev averaging 10
  handover window rxqual averaging 1

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I79ff48983d9cb7b875c1859870d5e3bce2c0ef22
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 


osmo-gsm-tester[master]: osmo-bsc.cfg.tmpl: Remove bogus VTY commands

2017-12-19 Thread Harald Welte

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I79ff48983d9cb7b875c1859870d5e3bce2c0ef22
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-HasComments: No


[PATCH] osmo-gsm-tester[master]: osmo-bsc.cfg.tmpl: Remove bogus VTY commands

2017-12-19 Thread Harald Welte

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

osmo-bsc.cfg.tmpl: Remove bogus VTY commands

There are plenty of VTY commands that were inherited from OsmoNITB,
but which make no sense in a BSC.  Upstream OsmoBSC has removed them in
change-ids Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38,
c499e5c62e9bef0db219e4658ffeb3292d6e6a5b and
8311a81bae85618302273c3f769275893161a7d7

Change-Id: I79ff48983d9cb7b875c1859870d5e3bce2c0ef22
---
M src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/13/5513/1

diff --git a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
index 95db16d..56ebe5a 100644
--- a/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-bsc.cfg.tmpl
@@ -29,13 +29,8 @@
 network
  network country code ${bsc.net.mcc}
  mobile network code ${bsc.net.mnc}
- short name ${bsc.net.short_name}
- long name ${bsc.net.long_name}
- location updating reject cause 13
  encryption ${bsc.net.encryption}
  neci 1
- rrlp mode none
- mm info 1
  handover 0
  handover window rxlev averaging 10
  handover window rxqual averaging 1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79ff48983d9cb7b875c1859870d5e3bce2c0ef22
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] osmo-bsc[master]: Remove unused RRLP options/codec

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove unused RRLP options/codec
..


Remove unused RRLP options/codec

RRLP is handled in OsmoMSC after the split from NITB, so let's remove
any bogus VTY commands left over in the BSC.

Change-Id: Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
D include/osmocom/bsc/rrlp.h
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/gsm_data.c
9 files changed, 0 insertions(+), 65 deletions(-)

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



diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 64c3abd..6ad5e59 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -12,7 +12,6 @@
  encryption a5 0
  neci 0
  paging any use tch 0
- rrlp mode none
  mm info 0
  handover 0
  handover window rxlev averaging 10
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 7697481..5031f2c 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -11,7 +11,6 @@
  encryption a5 0
  neci 0
  paging any use tch 0
- rrlp mode none
  mm info 0
  handover 0
  handover window rxlev averaging 10
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 1b86f9a..b067fc2 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -44,7 +44,6 @@
pcu_if.h \
pcuif_proto.h \
rest_octets.h \
-   rrlp.h \
rs232.h \
signal.h \
socket.h \
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3268426..0f8bcb9 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -332,11 +332,6 @@
/* timer to expire old location updates */
struct osmo_timer_list subscr_expire_timer;
 
-   /* Radio Resource Location Protocol (TS 04.31) */
-   struct {
-   enum rrlp_mode mode;
-   } rrlp;
-
enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T];
 
/* Use a TCH for handling requests of type paging any */
@@ -519,9 +514,6 @@
 
 enum gsm_auth_policy gsm_auth_policy_parse(const char *arg);
 const char *gsm_auth_policy_name(enum gsm_auth_policy policy);
-
-enum rrlp_mode rrlp_mode_parse(const char *arg);
-const char *rrlp_mode_name(enum rrlp_mode mode);
 
 enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid);
 const char *bts_gprs_mode_name(enum bts_gprs_mode mode);
diff --git a/include/osmocom/bsc/gsm_data_shared.h 
b/include/osmocom/bsc/gsm_data_shared.h
index 9bbcabd..5d9b570 100644
--- a/include/osmocom/bsc/gsm_data_shared.h
+++ b/include/osmocom/bsc/gsm_data_shared.h
@@ -34,14 +34,6 @@
 
 struct osmo_bsc_sccp_con;
 
-/* RRLP mode of operation */
-enum rrlp_mode {
-   RRLP_MODE_NONE,
-   RRLP_MODE_MS_BASED,
-   RRLP_MODE_MS_PREF,
-   RRLP_MODE_ASS_PREF,
-};
-
 /* Channel Request reason */
 enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
diff --git a/include/osmocom/bsc/rrlp.h b/include/osmocom/bsc/rrlp.h
deleted file mode 100644
index c89402a..000
--- a/include/osmocom/bsc/rrlp.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _RRLP_H
-#define _RRLP_H
-
-void on_dso_load_rrlp(void);
-
-#endif /* _RRLP_H */
-
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 9500645..6fa8e04 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -180,8 +180,6 @@
VTY_NEWLINE);
vty_out(vty, "  Use TCH for Paging any: %d%s", net->pag_any_tch,
VTY_NEWLINE);
-   vty_out(vty, "  RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode),
-   VTY_NEWLINE);
vty_out(vty, "  MM Info: %s%s", net->send_mm_info ? "On" : "Off",
VTY_NEWLINE);
vty_out(vty, "  Handover: %s%s", net->handover.active ? "On" : "Off",
@@ -817,8 +815,6 @@
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, 
VTY_NEWLINE);
-   vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
-   VTY_NEWLINE);
vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE);
vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE);
vty_out(vty, " handover window rxlev averaging %u%s",
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index beb936b..8f6e4ef 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -133,22 +133,6 @@
r

[MERGED] osmo-bsc[master]: remove libosmo-sccp dependency for osmo-bsc

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: remove libosmo-sccp dependency for osmo-bsc
..


remove libosmo-sccp dependency for osmo-bsc

libosmo-sccp is the old sccp-lite-focused SCCP implementation that we
used before libosmo-sigtran was created.  The new osmo-bsc in this
repository is using libosmo-sigtran and shouldn't be using parts of
libosmo-sccp anymore.

We only keep it around in configure.ac and Makefile.am for osmo-bsc_nat,
which is not even built in this repository anymore (or 'again yet'?)

Change-Id: I8f274be7d196cd7a5b1ec9ada949130fb06e984d
---
M include/osmocom/bsc/osmo_bsc.h
M src/libfilter/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/osmo_bsc_msc.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/osmo_bsc_vty.c
M tests/bsc/Makefile.am
9 files changed, 6 insertions(+), 25 deletions(-)

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



diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 8a5cd30..0fd29b7 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -15,7 +15,6 @@
BSC_CON_NO_MEM,
 };
 
-struct sccp_connection;
 struct bsc_msc_data;
 struct bsc_msc_connection;
 
@@ -47,10 +46,7 @@
int send_ping;
 
/* SCCP connection realted */
-   struct sccp_connection *sccp;
struct bsc_msc_data *msc;
-   struct osmo_timer_list sccp_it_timeout;
-   struct osmo_timer_list sccp_cc_timeout;
 
struct llist_head sccp_queue;
unsigned int sccp_queue_size;
diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am
index 6d3db0b..41a75bd 100644
--- a/src/libfilter/Makefile.am
+++ b/src/libfilter/Makefile.am
@@ -10,7 +10,6 @@
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(NULL)
 
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 4acbe56..7978852 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -11,7 +11,6 @@
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOCTRL_CFLAGS) \
$(LIBOSMONETIF_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
@@ -45,7 +44,6 @@
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(top_builddir)/src/libcommon/libcommon.a \
-   $(LIBOSMOSCCP_LIBS) \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index c388f5b..152b818 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #define return_when_not_connected(conn) \
@@ -296,13 +295,11 @@
resp = gsm0808_create_layer3(msg, network_code, country_code, lac, ci);
if (!resp) {
LOGP(DMSC, LOGL_DEBUG, "Failed to create layer3 message.\n");
-   sccp_connection_free(conn->sccp_con->sccp);
osmo_bsc_sigtran_del_conn(conn->sccp_con);
return BSC_API_CONN_POL_REJECT;
}
 
if (osmo_bsc_sigtran_open_conn(conn->sccp_con, resp) != 0) {
-   sccp_connection_free(conn->sccp_con->sccp);
osmo_bsc_sigtran_del_conn(conn->sccp_con);
msgb_free(resp);
return BSC_API_CONN_POL_REJECT;
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 829f207..e4c8fc5 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -43,7 +43,6 @@
 
 #include 
 
-#include 
 #include 
 
 #define _GNU_SOURCE
@@ -233,9 +232,6 @@
 
/* seed the PRNG */
srand(time(NULL));
-
-   /* initialize SCCP */
-   sccp_set_log_area(DSCCP);
 
/* Read the config */
rc = bsc_network_configure(config_file);
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 0e5777e..46be2e6 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -34,8 +34,6 @@
 
 #include 
 
-#include 
-
 #include 
 
 #include 
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index a18d4f3..7669b67 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -511,7 +510,8 @@
 
/* If unset, use default local SCCP address */
if (!msc->a.bsc_addr.presence)
-   osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, 
msc->a.sccp, SCCP_SSN_BSSAP);
+   osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, 
msc->a.sccp,
+ 

[MERGED] osmo-bsc[master]: Remove bogus vty config for LU reject cause

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove bogus vty config for LU reject cause
..


Remove bogus vty config for LU reject cause

The LU reject cause (like anything MM related) is under control of
OsmoMSC, not BSC.

Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_vty.c
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs_vty.c
6 files changed, 0 insertions(+), 25 deletions(-)

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



diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 6ad5e59..c7ba689 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -8,7 +8,6 @@
  mobile network code 1
  short name OsmoBSC
  long name OsmoBSC
- location updating reject cause 13
  encryption a5 0
  neci 0
  paging any use tch 0
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 5031f2c..341aa43 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -7,7 +7,6 @@
  mobile network code 1
  short name OsmoBSC
  long name OsmoBSC
- location updating reject cause 13
  encryption a5 0
  neci 0
  paging any use tch 0
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 0f8bcb9..8e4dc04 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -280,7 +280,6 @@
uint16_t network_code;
char *name_long;
char *name_short;
-   enum gsm48_reject_value reject_cause;
int a5_encryption;
int neci;
int send_mm_info;
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 6fa8e04..a73c6a4 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -172,8 +172,6 @@
vty_out(vty, "  Short network name: '%s'%s",
net->name_short, VTY_NEWLINE);
vty_out(vty, "%s", VTY_NEWLINE);
-   vty_out(vty, "  Location updating reject cause: %u%s",
-   net->reject_cause, VTY_NEWLINE);
vty_out(vty, "  Encryption: A5/%u%s", net->a5_encryption,
VTY_NEWLINE);
vty_out(vty, "  NECI (TCH/H): %u%s", net->neci,
@@ -810,8 +808,6 @@
vty_out(vty, " mobile network code %u%s", gsmnet->network_code, 
VTY_NEWLINE);
vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE);
-   vty_out(vty, " location updating reject cause %u%s",
-   gsmnet->reject_cause, VTY_NEWLINE);
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, 
VTY_NEWLINE);
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 59a8d5c..30de0cc 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -42,7 +42,6 @@
INIT_LLIST_HEAD(&net->bsc_data->mscs);
 
net->num_bts = 0;
-   net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED;
net->T3101 = GSM_T3101_DEFAULT;
net->T3103 = GSM_T3103_DEFAULT;
net->T3105 = GSM_T3105_DEFAULT;
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index 8f6e4ef..2732ebf 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -102,22 +102,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_reject_cause,
-  cfg_net_reject_cause_cmd,
-  "location updating reject cause <2-111>",
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Cause Value as Per GSM TS 04.08\n")
-{
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-
-   gsmnet->reject_cause = atoi(argv[0]);
-
-   return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
   cfg_net_encryption_cmd,
   "encryption a5 (0|1|2|3)",
@@ -264,7 +248,6 @@
install_element(GSMNET_NODE, &cfg_net_mnc_cmd);
install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
-   install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_mm_info_cmd);
install_element(GSMNET_NODE, &cfg_net_timezone_cmd);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace

[MERGED] osmo-bsc[master]: osmo_bsc_bssap.c: Spelling fixes in comment

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: osmo_bsc_bssap.c: Spelling fixes in comment
..


osmo_bsc_bssap.c: Spelling fixes in comment

Change-Id: I32b2d08bf25cd2d343755ac8491e4f5f758ccee6
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 4fd43aa..aea3994 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -385,7 +385,7 @@
  * a cipher we will have to send cipher mode reject to the MSC,
  * otherwise we will have to pick something that we and the MS
  * is supporting. Currently we are doing it in a rather static
- * way by picking one ecnryption or no encrytpion.
+ * way by picking one encryption or no encryption.
  */
 static int bssmap_handle_cipher_mode(struct osmo_bsc_sccp_con *conn,
 struct msgb *msg, unsigned int 
payload_length)
@@ -613,7 +613,7 @@
   get_value_string(gsm48_chan_mode_names, chan_mode),
   ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, 
ct.perm_spch_len));
 
-   /* Forward the assingment request to lower layers */
+   /* Forward the assignment request to lower layers */
if (aoip) {
/* Store network side RTP connection information, we will
 * process this address later after we have established an RTP
@@ -626,7 +626,7 @@
/* Create an assignment request using the MGCP fsm. This FSM
 * is directly started when its created (now) and will also
 * take care about the further processing (creating RTP
-* endpoints, calling gsm0808_assign_req(), rsponding to
+* endpoints, calling gsm0808_assign_req(), responding to
 * the assignment request etc... */
conn->mgcp_ctx = mgcp_assignm_req(msc->network, 
msc->network->mgw.client, conn, chan_mode, full_rate);
if (!conn->mgcp_ctx) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I32b2d08bf25cd2d343755ac8491e4f5f758ccee6
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-bsc[master]: Remove bogus MM INFO configuration

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove bogus MM INFO configuration
..


Remove bogus MM INFO configuration

The network name and other MM INFO is controlled by the MSC, not the BSC.

Change-Id: I1cbf72fc50cff29e7c1633ba752cbf15b4b84c58
---
M doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_ctrl_commands.c
M src/libbsc/bsc_init.c
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
8 files changed, 0 insertions(+), 100 deletions(-)

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



diff --git a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg 
b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
index c972e06..850e29c 100644
--- a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
@@ -1,9 +1,6 @@
 network
  network country code 901
  mobile network code 70
- mm info 1
- short name OsmoBSC
- long name OsmoBSC
  bts 0
   type sysmobts
   band GSM-1800
diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index c7ba689..17412f7 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -6,12 +6,9 @@
 network
  network country code 1
  mobile network code 1
- short name OsmoBSC
- long name OsmoBSC
  encryption a5 0
  neci 0
  paging any use tch 0
- mm info 0
  handover 0
  handover window rxlev averaging 10
  handover window rxqual averaging 1
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 341aa43..581d541 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -5,12 +5,9 @@
 network
  network country code 1
  mobile network code 1
- short name OsmoBSC
- long name OsmoBSC
  encryption a5 0
  neci 0
  paging any use tch 0
- mm info 0
  handover 0
  handover window rxlev averaging 10
  handover window rxqual averaging 1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 8e4dc04..7a1b62d 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -278,8 +278,6 @@
/* global parameters */
uint16_t country_code;
uint16_t network_code;
-   char *name_long;
-   char *name_short;
int a5_encryption;
int neci;
int send_mm_info;
diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c
index 2d6fcb6..41d2361 100644
--- a/src/libbsc/bsc_ctrl_commands.c
+++ b/src/libbsc/bsc_ctrl_commands.c
@@ -30,45 +30,8 @@
 #include 
 #include 
 
-#define CTRL_CMD_VTY_STRING(cmdname, cmdstr, dtype, element) \
-   CTRL_HELPER_GET_STRING(cmdname, dtype, element) \
-   CTRL_HELPER_SET_STRING(cmdname, dtype, element) \
-static struct ctrl_cmd_element cmd_##cmdname = { \
-   .name = cmdstr, \
-   .get = get_##cmdname, \
-   .set = set_##cmdname, \
-   .verify = verify_vty_description_string, \
-}
-
-/**
- * Check that there are no newlines or comments or other things
- * that could make the VTY configuration unparsable.
- */
-static int verify_vty_description_string(struct ctrl_cmd *cmd,
-   const char *value, void *data)
-{
-   int i;
-   const size_t len = strlen(value);
-
-   for (i = 0; i < len; ++i) {
-   switch(value[i]) {
-   case '#':
-   case '\n':
-   case '\r':
-   cmd->reply = "String includes illegal character";
-   return -1;
-   default:
-   break;
-   }
-   }
-
-   return 0;
-}
-
 CTRL_CMD_DEFINE_RANGE(net_mnc, "mnc", struct gsm_network, network_code, 0, 
999);
 CTRL_CMD_DEFINE_RANGE(net_mcc, "mcc", struct gsm_network, country_code, 1, 
999);
-CTRL_CMD_VTY_STRING(net_short_name, "short-name", struct gsm_network, 
name_short);
-CTRL_CMD_VTY_STRING(net_long_name, "long-name", struct gsm_network, name_long);
 
 static int set_net_apply_config(struct ctrl_cmd *cmd, void *data)
 {
@@ -452,8 +415,6 @@
int rc = 0;
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mnc);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc);
-   rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_short_name);
-   rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_long_name);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_apply_config);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc_mnc_apply);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_rf_lock);
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index 34dfd36..c5a75aa 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -536,9 +536,6 @@
if (!bsc_gsmnet)
return -ENOMEM;
 
-   bsc_gsmnet->

[MERGED] osmo-bsc[master]: Remove dead code left over from NITB split

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove dead code left over from NITB split
..


Remove dead code left over from NITB split

There still is a lot of dead code that we inherited from the NITB
days, let's remove more of it.

libtrau will be re-introduced as part of osmo-mgw later.

Change-Id: I8e0af56a158f25a4f1384d667c03eb20e72df5b8
---
M configure.ac
M include/osmocom/bsc/Makefile.am
D include/osmocom/bsc/auth.h
M include/osmocom/bsc/bss.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/common_bsc.h
M include/osmocom/bsc/common_cs.h
D include/osmocom/bsc/crc24.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
D include/osmocom/bsc/gsm_subscriber.h
M include/osmocom/bsc/ipaccess.h
D include/osmocom/bsc/mncc.h
D include/osmocom/bsc/mncc_int.h
D include/osmocom/bsc/msc_ifaces.h
D include/osmocom/bsc/rtp_proxy.h
M include/osmocom/bsc/signal.h
D include/osmocom/bsc/silent_call.h
D include/osmocom/bsc/smpp.h
D include/osmocom/bsc/sms_queue.h
D include/osmocom/bsc/transaction.h
D include/osmocom/bsc/trau_mux.h
D include/osmocom/bsc/trau_upqueue.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/ipaccess/ipaccess-config.c
M src/libbsc/abis_rsl.c
M src/libbsc/bsc_api.c
M src/libbsc/bsc_init.c
M src/libbsc/chan_alloc.c
M src/libbsc/e1_config.c
M src/libbsc/gsm_04_08_utils.c
M src/libbsc/handover_logic.c
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs.c
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/Makefile.am
M src/libcommon/common_vty.c
D src/libcommon/gsm_subscriber_base.c
M src/libcommon/talloc_ctx.c
D src/libtrau/Makefile.am
D src/libtrau/rtp_proxy.c
D src/libtrau/trau_mux.c
D src/libtrau/trau_upqueue.c
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/Makefile.am
M src/osmo-bsc_nat/bsc_filter.c
M src/utils/Makefile.am
M src/utils/bs11_config.c
M tests/Makefile.am
M tests/abis/Makefile.am
M tests/bsc-nat-trie/Makefile.am
M tests/bsc-nat/Makefile.am
M tests/bsc/Makefile.am
M tests/bsc/bsc_test.c
M tests/bssap/Makefile.am
M tests/bssap/bssap_test.c
M tests/channel/channel_test.c
M tests/gsm0408/Makefile.am
M tests/gsm0408/gsm0408_test.c
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
M tests/testsuite.at
D tests/trau/Makefile.am
D tests/trau/trau_test.c
D tests/trau/trau_test.ok
68 files changed, 25 insertions(+), 2,484 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index bdcf026..98f96bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,7 +145,6 @@
 include/osmocom/Makefile
 include/osmocom/bsc/Makefile
 src/Makefile
-src/libtrau/Makefile
 src/libbsc/Makefile
 src/libcommon/Makefile
 src/libfilter/Makefile
@@ -161,7 +160,6 @@
 tests/bsc-nat/Makefile
 tests/bsc-nat-trie/Makefile
 tests/abis/Makefile
-tests/trau/Makefile
 tests/subscr/Makefile
 tests/nanobts_omlattr/Makefile
 tests/bssap/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 9d2ee6e..1b86f9a 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -4,7 +4,6 @@
abis_om2000.h \
abis_rsl.h \
arfcn_range_encode.h \
-   auth.h \
bsc_msc.h \
bsc_msg_filter.h \
bsc_nat.h \
@@ -18,7 +17,6 @@
common.h \
common_bsc.h \
common_cs.h \
-   crc24.h \
ctrl.h \
debug.h \
e1_config.h \
@@ -26,16 +24,12 @@
gsm_04_80.h \
gsm_data.h \
gsm_data_shared.h \
-   gsm_subscriber.h \
handover.h \
handover_decision.h \
ipaccess.h \
meas_feed.h \
meas_rep.h \
misdn.h \
-   mncc.h \
-   mncc_int.h \
-   msc_ifaces.h \
nat_rewrite_trie.h \
network_listen.h \
openbscdefines.h \
@@ -52,15 +46,9 @@
rest_octets.h \
rrlp.h \
rs232.h \
-   rtp_proxy.h \
signal.h \
-   silent_call.h \
-   sms_queue.h \
socket.h \
system_information.h \
-   transaction.h \
-   trau_mux.h \
-   trau_upqueue.h \
ussd.h \
vty.h \
bsc_api.h \
diff --git a/include/osmocom/bsc/auth.h b/include/osmocom/bsc/auth.h
deleted file mode 100644
index b314bbf..000
--- a/include/osmocom/bsc/auth.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _AUTH_H
-#define _AUTH_H
-
-#include 
-
-struct gsm_auth_tuple;
-
-enum auth_action {
-   AUTH_ERROR  = -1,   /* Internal error */
-   AUTH_NOT_AVAIL  = 0,/* No auth tuple available */
-   AUTH_DO_AUTH_THEN_CIPH  = 1,/* Firsth authenticate, then cipher */
-   AUTH_DO_CIPH= 2,/* Only ciphering */
-   AUTH_DO_AUTH= 3,/* Only authentication, no ciphering */
-

osmo-bsc[master]: Remove some more dead code

2017-12-19 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


[MERGED] osmo-bsc[master]: Remove some more dead code

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove some more dead code
..


Remove some more dead code

Change-Id: I919bffe88babd90227c89abd4434322965c32ebb
---
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
M src/libcommon-cs/common_cs.c
M src/libcommon/gsm_data.c
4 files changed, 0 insertions(+), 163 deletions(-)

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



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 7a1b62d..1cedef0 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -24,9 +24,7 @@
 
 #define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
 
-struct gsm_subscriber_group;
 struct bsc_subscr;
-struct vlr_instance;
 struct gprs_ra_id;
 
 #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
@@ -40,26 +38,11 @@
 #define EARFCN_QRXLV_INVALID 32
 #define EARFCN_THRESH_LOW_INVALID 32
 
-enum gsm_security_event {
-   GSM_SECURITY_NOAVAIL,
-   GSM_SECURITY_AUTH_FAILED,
-   GSM_SECURITY_SUCCEEDED,
-   GSM_SECURITY_ALREADY,
-};
-
 struct msgb;
 typedef int gsm_cbfn(unsigned int hooknum,
 unsigned int event,
 struct msgb *msg,
 void *data, void *param);
-
-/*
- * A dummy to keep a connection up for at least
- * a couple of seconds to work around MSC issues.
- */
-struct gsm_anchor_operation {
-   struct osmo_timer_list timeout;
-};
 
 /* Maximum number of neighbor cells whose average we track */
 #define MAX_NEIGH_MEAS 10
@@ -75,16 +58,6 @@
uint8_t last_seen_nr;
 };
 
-enum ran_type {
-   RAN_UNKNOWN,
-   RAN_GERAN_A,/* 2G / A-interface */
-   RAN_UTRAN_IU,   /* 3G / Iu-interface (IuCS or IuPS) */
-};
-
-extern const struct value_string ran_type_names[];
-static inline const char *ran_type_name(enum ran_type val)
-{  return get_value_string(ran_type_names, val);   }
-
 struct gsm_classmark {
bool classmark1_set;
struct gsm48_classmark1 classmark1;
@@ -92,12 +65,6 @@
uint8_t classmark2[3];
uint8_t classmark3_len;
uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be 
truncated */
-};
-
-enum integrity_protection_state {
-   INTEGRITY_PROTECTION_NONE   = 0,
-   INTEGRITY_PROTECTION_IK = 1,
-   INTEGRITY_PROTECTION_IK_CK  = 2,
 };
 
 /* active radio connection of a mobile subscriber */
@@ -125,29 +92,6 @@
struct gsm_classmark classmark;
 
uint16_t lac;
-   struct gsm_encr encr;
-
-   struct {
-   unsigned int mgcp_rtp_endpoint;
-   uint16_t port_subscr;
-   uint16_t port_cn;
-   } rtp;
-
-   struct {
-   /* A pointer to the SCCP user that handles
-* the SCCP connections for this subscriber
-* connection */
-   struct osmo_sccp_user *scu;
-
-   /* The address of the BSC that is associated
-* with this subscriber connection */
-   struct osmo_sccp_addr bsc_addr;
-
-   /* The connection identifier that is used
-* to reference the SCCP connection that is
-* associated with this subscriber connection */
-   int conn_id;
-   } a;
 };
 
 
@@ -241,13 +185,6 @@
bsc_ctr_description,
 };
 
-enum gsm_auth_policy {
-   GSM_AUTH_POLICY_CLOSED, /* only subscribers authorized in DB */
-   GSM_AUTH_POLICY_ACCEPT_ALL, /* accept everyone, even if not authorized 
in DB */
-   GSM_AUTH_POLICY_TOKEN, /* accept first, send token per sms, then revoke 
authorization */
-   GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */
-};
-
 #define GSM_T3101_DEFAULT 3/* s */
 #define GSM_T3103_DEFAULT 5/* s */
 #define GSM_T3105_DEFAULT 100  /* ms */
@@ -280,7 +217,6 @@
uint16_t network_code;
int a5_encryption;
int neci;
-   int send_mm_info;
struct {
int active;
/* Window RXLEV averaging */
@@ -299,7 +235,6 @@
} handover;
 
struct rate_ctr_group *bsc_ctrs;
-   struct osmo_counter *active_calls;
 
/*
 * TODO: Move the trans_list into the subscriber connection and
@@ -361,12 +296,6 @@
 * pointer is NULL to indicate absence of a bsc_subscribers list. */
struct llist_head *bsc_subscribers;
 
-   /* MSC: GSUP server address of the HLR */
-   const char *gsup_server_addr_str;
-   uint16_t gsup_server_port;
-
-   struct vlr_instance *vlr;
-
/* Periodic location update default value */
uint8_t t3212;
 
@@ -374,65 +303,6 @@
struct mgcp_client_conf *conf;
struct mgcp_client *client;
} mgw;
-
-   struct {
-   /* CS7 instance id number (set via VTY) */
-   uint32_t cs7_i

osmo-bsc[master]: Remove unused RRLP options/codec

2017-12-19 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


osmo-bsc[master]: Remove bogus MM INFO configuration

2017-12-19 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


osmo-bsc[master]: Remove bogus vty config for LU reject cause

2017-12-19 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


osmo-bsc[master]: gsm_data.h: Document all fields of gsm_subscriber_connection

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: remove unused 'lac' member of 'struct gsm_subscriber_connect...

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: osmo_bsc_bssap.c: Spelling fixes in comment

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: osmo-bsc: Move user plane/voice related bits into sub-structure

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: bsc_test.c: Use proper network/bts/lchan structures

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: Remove dead code left over from NITB split

2017-12-19 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


osmo-bsc[master]: Remove unneeded .py scripts

2017-12-19 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: remove libosmo-sccp dependency for osmo-bsc

2017-12-19 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


[MERGED] osmo-bsc[master]: Remove unneeded .py scripts

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove unneeded .py scripts
..


Remove unneeded .py scripts

The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for
vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py
are not BSC-specific: leftovers from repository split which are now
available in osmo-python-tests as well.

Change-Id: Ia4285b18b152b070c148228604d1e61a8adedba1
---
M Makefile.am
M configure.ac
D contrib/Makefile.am
D contrib/bsc_control.py
D contrib/ipa.py
D contrib/soap.py
D contrib/twisted_ipa.py
M tests/ctrl_test_runner.py
M tests/vty_test_runner.py
9 files changed, 2 insertions(+), 983 deletions(-)

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



diff --git a/Makefile.am b/Makefile.am
index 690deae..2f0a786 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@
include \
src \
tests \
-   contrib \
$(NULL)
 
 BUILT_SOURCES = $(top_srcdir)/.version
diff --git a/configure.ac b/configure.ac
index b7dd016..bdcf026 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,5 +167,4 @@
 tests/bssap/Makefile
 doc/Makefile
 doc/examples/Makefile
-contrib/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index db6d0f5..000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = ipa.py
diff --git a/contrib/bsc_control.py b/contrib/bsc_control.py
deleted file mode 100755
index c1b09ce..000
--- a/contrib/bsc_control.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/python
-# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
-"""
-/*
- * Copyright (C) 2016 sysmocom s.f.m.c. GmbH
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-"""
-
-from optparse import OptionParser
-from ipa import Ctrl
-import socket
-
-verbose = False
-
-def connect(host, port):
-if verbose:
-print "Connecting to host %s:%i" % (host, port)
-
-sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-sck.setblocking(1)
-sck.connect((host, port))
-return sck
-
-def do_set_get(sck, var, value = None):
-(r, c) = Ctrl().cmd(var, value)
-sck.send(c)
-answer = Ctrl().rem_header(sck.recv(4096))
-return (answer,) + Ctrl().verify(answer, r, var, value)
-
-def set_var(sck, var, val):
-(a, _, _) = do_set_get(sck, var, val)
-return a
-
-def get_var(sck, var):
-(_, _, v) = do_set_get(sck, var)
-return v
-
-def _leftovers(sck, fl):
-"""
-Read outstanding data if any according to flags
-"""
-try:
-data = sck.recv(1024, fl)
-except socket.error as (s_errno, strerror):
-return False
-if len(data) != 0:
-tail = data
-while True:
-(head, tail) = Ctrl().split_combined(tail)
-print "Got message:", Ctrl().rem_header(head)
-if len(tail) == 0:
-break
-return True
-return False
-
-if __name__ == '__main__':
-parser = OptionParser("Usage: %prog [options] var [value]")
-parser.add_option("-d", "--host", dest="host",
-  help="connect to HOST", metavar="HOST")
-parser.add_option("-p", "--port", dest="port", type="int",
-  help="use PORT", metavar="PORT", default=4249)
-parser.add_option("-g", "--get", action="store_true",
-  dest="cmd_get", help="perform GET operation")
-parser.add_option("-s", "--set", action="store_true",
-  dest="cmd_set", help="perform SET operation")
-parser.add_option("-v", "--verbose", action="store_true",
-  dest="verbose", help="be verbose", default=False)
-parser.add_option("-m", "--monitor", action="store_true",
-  dest="monitor", help="monitor the connection for 
traps", default=False)
-
-(options, args) = parser.parse_args()
-
-verbose = options.verbose
-
-if opti

[MERGED] osmo-sgsn[master]: Remove unneeded .py scripts

2017-12-19 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Remove unneeded .py scripts
..


Remove unneeded .py scripts

The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for
vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py
are not SGSN-specific: leftovers from repository split which are now
available in osmo-python-tests as well.

Change-Id: I3ef4ca790878921a5846f64942a8de8a6ff9c11c
---
M Makefile.am
M configure.ac
D contrib/Makefile.am
D contrib/ipa.py
D contrib/soap.py
D contrib/twisted_ipa.py
M tests/ctrl_test_runner.py
M tests/vty_test_runner.py
8 files changed, 2 insertions(+), 863 deletions(-)

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



diff --git a/Makefile.am b/Makefile.am
index d57b66d..38fdcba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@
include \
src \
tests \
-   contrib \
$(NULL)
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/configure.ac b/configure.ac
index 8f279fd..2de31cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,5 +197,4 @@
 tests/v42bis/Makefile
 doc/Makefile
 doc/examples/Makefile
-contrib/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index db6d0f5..000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = ipa.py
diff --git a/contrib/ipa.py b/contrib/ipa.py
deleted file mode 100755
index 71cbf45..000
--- a/contrib/ipa.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/python3
-# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
-"""
-/*
- * Copyright (C) 2016 sysmocom s.f.m.c. GmbH
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-"""
-
-import struct, random, sys
-
-class IPA(object):
-"""
-Stateless IPA protocol multiplexer: add/remove/parse (extended) header
-"""
-version = "0.0.5"
-TCP_PORT_OML = 3002
-TCP_PORT_RSL = 3003
-# OpenBSC extensions: OSMO, MGCP_OLD
-PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, 
MGCP_OLD=0xFC)
-# ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol
-EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6)
-# OpenBSC extension: SCCP_OLD
-MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, 
SCCP_OLD=0xFF)
-_IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, 
SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8)
-CTRL_GET = 'GET'
-CTRL_SET = 'SET'
-CTRL_REP = 'REPLY'
-CTRL_ERR = 'ERR'
-CTRL_TRAP = 'TRAP'
-
-def _l(self, d, p):
-"""
-Reverse dictionary lookup: return key for a given value
-"""
-if p is None:
-return 'UNKNOWN'
-return list(d.keys())[list(d.values()).index(p)]
-
-def _tag(self, t, v):
-"""
-Create TAG as TLV data
-"""
-return struct.pack(">HB", len(v) + 1, t) + v
-
-def proto(self, p):
-"""
-Lookup protocol name
-"""
-return self._l(self.PROTO, p)
-
-def ext(self, p):
-"""
-Lookup protocol extension name
-"""
-return self._l(self.EXT, p)
-
-def msgt(self, p):
-"""
-Lookup message type name
-"""
-return self._l(self.MSGT, p)
-
-def idtag(self, p):
-"""
-Lookup ID tag name
-"""
-return self._l(self._IDTAG, p)
-
-def ext_name(self, proto, exten):
-"""
-Return proper extension byte name depending on the protocol used
-"""
-if self.PROTO['CCM'] == proto:
-return self.msgt(exten)
-if self.PROTO['OSMO'] == proto:
-return self.ext(exten)
-return None
-
-def add_header(self, data, proto, ext=None):
-"""
-Add IPA header (with extension if necessary), data must be represented 
as bytes
-"""
-if ext is None:
-return struct.pack(">HB", len(data) + 1, proto) + data
-return struct.pack(">HBB", len(data) + 1, proto, ext) + data
-
-def del_header(self, data):
-"""
-Strip IPA protocol header correctly removing extensio

osmo-sgsn[master]: Remove unneeded .py scripts

2017-12-19 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3ef4ca790878921a5846f64942a8de8a6ff9c11c
Gerrit-PatchSet: 2
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: Remove bogus MM INFO configuration

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5478

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

Remove bogus MM INFO configuration

The network name and other MM INFO is controlled by the MSC, not the BSC.

Change-Id: I1cbf72fc50cff29e7c1633ba752cbf15b4b84c58
---
M doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_ctrl_commands.c
M src/libbsc/bsc_init.c
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
8 files changed, 0 insertions(+), 100 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/5478/4

diff --git a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg 
b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
index c972e06..850e29c 100644
--- a/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg
@@ -1,9 +1,6 @@
 network
  network country code 901
  mobile network code 70
- mm info 1
- short name OsmoBSC
- long name OsmoBSC
  bts 0
   type sysmobts
   band GSM-1800
diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index c7ba689..17412f7 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -6,12 +6,9 @@
 network
  network country code 1
  mobile network code 1
- short name OsmoBSC
- long name OsmoBSC
  encryption a5 0
  neci 0
  paging any use tch 0
- mm info 0
  handover 0
  handover window rxlev averaging 10
  handover window rxqual averaging 1
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 341aa43..581d541 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -5,12 +5,9 @@
 network
  network country code 1
  mobile network code 1
- short name OsmoBSC
- long name OsmoBSC
  encryption a5 0
  neci 0
  paging any use tch 0
- mm info 0
  handover 0
  handover window rxlev averaging 10
  handover window rxqual averaging 1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 8e4dc04..7a1b62d 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -278,8 +278,6 @@
/* global parameters */
uint16_t country_code;
uint16_t network_code;
-   char *name_long;
-   char *name_short;
int a5_encryption;
int neci;
int send_mm_info;
diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c
index 2d6fcb6..41d2361 100644
--- a/src/libbsc/bsc_ctrl_commands.c
+++ b/src/libbsc/bsc_ctrl_commands.c
@@ -30,45 +30,8 @@
 #include 
 #include 
 
-#define CTRL_CMD_VTY_STRING(cmdname, cmdstr, dtype, element) \
-   CTRL_HELPER_GET_STRING(cmdname, dtype, element) \
-   CTRL_HELPER_SET_STRING(cmdname, dtype, element) \
-static struct ctrl_cmd_element cmd_##cmdname = { \
-   .name = cmdstr, \
-   .get = get_##cmdname, \
-   .set = set_##cmdname, \
-   .verify = verify_vty_description_string, \
-}
-
-/**
- * Check that there are no newlines or comments or other things
- * that could make the VTY configuration unparsable.
- */
-static int verify_vty_description_string(struct ctrl_cmd *cmd,
-   const char *value, void *data)
-{
-   int i;
-   const size_t len = strlen(value);
-
-   for (i = 0; i < len; ++i) {
-   switch(value[i]) {
-   case '#':
-   case '\n':
-   case '\r':
-   cmd->reply = "String includes illegal character";
-   return -1;
-   default:
-   break;
-   }
-   }
-
-   return 0;
-}
-
 CTRL_CMD_DEFINE_RANGE(net_mnc, "mnc", struct gsm_network, network_code, 0, 
999);
 CTRL_CMD_DEFINE_RANGE(net_mcc, "mcc", struct gsm_network, country_code, 1, 
999);
-CTRL_CMD_VTY_STRING(net_short_name, "short-name", struct gsm_network, 
name_short);
-CTRL_CMD_VTY_STRING(net_long_name, "long-name", struct gsm_network, name_long);
 
 static int set_net_apply_config(struct ctrl_cmd *cmd, void *data)
 {
@@ -452,8 +415,6 @@
int rc = 0;
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mnc);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc);
-   rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_short_name);
-   rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_long_name);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_apply_config);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc_mnc_apply);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_rf_lock);
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index 34dfd36..c5a75aa 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -536,9 +536,6 @@
if (!bsc_gsmnet)
return -ENOMEM;
 
-   bsc_gsmnet->name_long = talloc_strdup(bsc_gsmnet, "OpenB

[PATCH] osmo-bsc[master]: Remove unused RRLP options/codec

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5476

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

Remove unused RRLP options/codec

RRLP is handled in OsmoMSC after the split from NITB, so let's remove
any bogus VTY commands left over in the BSC.

Change-Id: Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
D include/osmocom/bsc/rrlp.h
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/gsm_data.c
9 files changed, 0 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/5476/4

diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 64c3abd..6ad5e59 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -12,7 +12,6 @@
  encryption a5 0
  neci 0
  paging any use tch 0
- rrlp mode none
  mm info 0
  handover 0
  handover window rxlev averaging 10
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 7697481..5031f2c 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -11,7 +11,6 @@
  encryption a5 0
  neci 0
  paging any use tch 0
- rrlp mode none
  mm info 0
  handover 0
  handover window rxlev averaging 10
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 1b86f9a..b067fc2 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -44,7 +44,6 @@
pcu_if.h \
pcuif_proto.h \
rest_octets.h \
-   rrlp.h \
rs232.h \
signal.h \
socket.h \
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3268426..0f8bcb9 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -332,11 +332,6 @@
/* timer to expire old location updates */
struct osmo_timer_list subscr_expire_timer;
 
-   /* Radio Resource Location Protocol (TS 04.31) */
-   struct {
-   enum rrlp_mode mode;
-   } rrlp;
-
enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T];
 
/* Use a TCH for handling requests of type paging any */
@@ -519,9 +514,6 @@
 
 enum gsm_auth_policy gsm_auth_policy_parse(const char *arg);
 const char *gsm_auth_policy_name(enum gsm_auth_policy policy);
-
-enum rrlp_mode rrlp_mode_parse(const char *arg);
-const char *rrlp_mode_name(enum rrlp_mode mode);
 
 enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid);
 const char *bts_gprs_mode_name(enum bts_gprs_mode mode);
diff --git a/include/osmocom/bsc/gsm_data_shared.h 
b/include/osmocom/bsc/gsm_data_shared.h
index 9bbcabd..5d9b570 100644
--- a/include/osmocom/bsc/gsm_data_shared.h
+++ b/include/osmocom/bsc/gsm_data_shared.h
@@ -34,14 +34,6 @@
 
 struct osmo_bsc_sccp_con;
 
-/* RRLP mode of operation */
-enum rrlp_mode {
-   RRLP_MODE_NONE,
-   RRLP_MODE_MS_BASED,
-   RRLP_MODE_MS_PREF,
-   RRLP_MODE_ASS_PREF,
-};
-
 /* Channel Request reason */
 enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
diff --git a/include/osmocom/bsc/rrlp.h b/include/osmocom/bsc/rrlp.h
deleted file mode 100644
index c89402a..000
--- a/include/osmocom/bsc/rrlp.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _RRLP_H
-#define _RRLP_H
-
-void on_dso_load_rrlp(void);
-
-#endif /* _RRLP_H */
-
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 9500645..6fa8e04 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -180,8 +180,6 @@
VTY_NEWLINE);
vty_out(vty, "  Use TCH for Paging any: %d%s", net->pag_any_tch,
VTY_NEWLINE);
-   vty_out(vty, "  RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode),
-   VTY_NEWLINE);
vty_out(vty, "  MM Info: %s%s", net->send_mm_info ? "On" : "Off",
VTY_NEWLINE);
vty_out(vty, "  Handover: %s%s", net->handover.active ? "On" : "Off",
@@ -817,8 +815,6 @@
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, 
VTY_NEWLINE);
-   vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
-   VTY_NEWLINE);
vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE);
vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE);
vty_out(vty, " handover window rxlev averaging %u%s",
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index beb936b..8f6e4ef 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -133,22 +133,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_rrl

[PATCH] osmo-bsc[master]: Remove bogus vty config for LU reject cause

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5477

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

Remove bogus vty config for LU reject cause

The LU reject cause (like anything MM related) is under control of
OsmoMSC, not BSC.

Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_vty.c
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs_vty.c
6 files changed, 0 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/77/5477/4

diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 6ad5e59..c7ba689 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -8,7 +8,6 @@
  mobile network code 1
  short name OsmoBSC
  long name OsmoBSC
- location updating reject cause 13
  encryption a5 0
  neci 0
  paging any use tch 0
diff --git a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg 
b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
index 5031f2c..341aa43 100644
--- a/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc_custom-sccp.cfg
@@ -7,7 +7,6 @@
  mobile network code 1
  short name OsmoBSC
  long name OsmoBSC
- location updating reject cause 13
  encryption a5 0
  neci 0
  paging any use tch 0
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 0f8bcb9..8e4dc04 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -280,7 +280,6 @@
uint16_t network_code;
char *name_long;
char *name_short;
-   enum gsm48_reject_value reject_cause;
int a5_encryption;
int neci;
int send_mm_info;
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 6fa8e04..a73c6a4 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -172,8 +172,6 @@
vty_out(vty, "  Short network name: '%s'%s",
net->name_short, VTY_NEWLINE);
vty_out(vty, "%s", VTY_NEWLINE);
-   vty_out(vty, "  Location updating reject cause: %u%s",
-   net->reject_cause, VTY_NEWLINE);
vty_out(vty, "  Encryption: A5/%u%s", net->a5_encryption,
VTY_NEWLINE);
vty_out(vty, "  NECI (TCH/H): %u%s", net->neci,
@@ -810,8 +808,6 @@
vty_out(vty, " mobile network code %u%s", gsmnet->network_code, 
VTY_NEWLINE);
vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE);
-   vty_out(vty, " location updating reject cause %u%s",
-   gsmnet->reject_cause, VTY_NEWLINE);
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, 
VTY_NEWLINE);
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 59a8d5c..30de0cc 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -42,7 +42,6 @@
INIT_LLIST_HEAD(&net->bsc_data->mscs);
 
net->num_bts = 0;
-   net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED;
net->T3101 = GSM_T3101_DEFAULT;
net->T3103 = GSM_T3103_DEFAULT;
net->T3105 = GSM_T3105_DEFAULT;
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index 8f6e4ef..2732ebf 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -102,22 +102,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_reject_cause,
-  cfg_net_reject_cause_cmd,
-  "location updating reject cause <2-111>",
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Cause Value as Per GSM TS 04.08\n")
-{
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-
-   gsmnet->reject_cause = atoi(argv[0]);
-
-   return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
   cfg_net_encryption_cmd,
   "encryption a5 (0|1|2|3)",
@@ -264,7 +248,6 @@
install_element(GSMNET_NODE, &cfg_net_mnc_cmd);
install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
-   install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_mm_info_cmd);
install_element(GSMNET_NODE, &cfg_net_timezone_cmd);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Ge

[PATCH] osmo-bsc[master]: Remove dead code left over from NITB split

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5475

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

Remove dead code left over from NITB split

There still is a lot of dead code that we inherited from the NITB
days, let's remove more of it.

libtrau will be re-introduced as part of osmo-mgw later.

Change-Id: I8e0af56a158f25a4f1384d667c03eb20e72df5b8
---
M configure.ac
M include/osmocom/bsc/Makefile.am
D include/osmocom/bsc/auth.h
M include/osmocom/bsc/bss.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/common_bsc.h
M include/osmocom/bsc/common_cs.h
D include/osmocom/bsc/crc24.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
D include/osmocom/bsc/gsm_subscriber.h
M include/osmocom/bsc/ipaccess.h
D include/osmocom/bsc/mncc.h
D include/osmocom/bsc/mncc_int.h
D include/osmocom/bsc/msc_ifaces.h
D include/osmocom/bsc/rtp_proxy.h
M include/osmocom/bsc/signal.h
D include/osmocom/bsc/silent_call.h
D include/osmocom/bsc/smpp.h
D include/osmocom/bsc/sms_queue.h
D include/osmocom/bsc/transaction.h
D include/osmocom/bsc/trau_mux.h
D include/osmocom/bsc/trau_upqueue.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/ipaccess/ipaccess-config.c
M src/libbsc/abis_rsl.c
M src/libbsc/bsc_api.c
M src/libbsc/bsc_init.c
M src/libbsc/chan_alloc.c
M src/libbsc/e1_config.c
M src/libbsc/gsm_04_08_utils.c
M src/libbsc/handover_logic.c
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs.c
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/Makefile.am
M src/libcommon/common_vty.c
D src/libcommon/gsm_subscriber_base.c
M src/libcommon/talloc_ctx.c
D src/libtrau/Makefile.am
D src/libtrau/rtp_proxy.c
D src/libtrau/trau_mux.c
D src/libtrau/trau_upqueue.c
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/Makefile.am
M src/osmo-bsc_nat/bsc_filter.c
M src/utils/Makefile.am
M src/utils/bs11_config.c
M tests/Makefile.am
M tests/abis/Makefile.am
M tests/bsc-nat-trie/Makefile.am
M tests/bsc-nat/Makefile.am
M tests/bsc/Makefile.am
M tests/bsc/bsc_test.c
M tests/bssap/Makefile.am
M tests/bssap/bssap_test.c
M tests/channel/channel_test.c
M tests/gsm0408/Makefile.am
M tests/gsm0408/gsm0408_test.c
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
M tests/testsuite.at
D tests/trau/Makefile.am
D tests/trau/trau_test.c
D tests/trau/trau_test.ok
68 files changed, 25 insertions(+), 2,484 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/5475/4

diff --git a/configure.ac b/configure.ac
index b7dd016..540d2cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,7 +145,6 @@
 include/osmocom/Makefile
 include/osmocom/bsc/Makefile
 src/Makefile
-src/libtrau/Makefile
 src/libbsc/Makefile
 src/libcommon/Makefile
 src/libfilter/Makefile
@@ -161,7 +160,6 @@
 tests/bsc-nat/Makefile
 tests/bsc-nat-trie/Makefile
 tests/abis/Makefile
-tests/trau/Makefile
 tests/subscr/Makefile
 tests/nanobts_omlattr/Makefile
 tests/bssap/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 9d2ee6e..1b86f9a 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -4,7 +4,6 @@
abis_om2000.h \
abis_rsl.h \
arfcn_range_encode.h \
-   auth.h \
bsc_msc.h \
bsc_msg_filter.h \
bsc_nat.h \
@@ -18,7 +17,6 @@
common.h \
common_bsc.h \
common_cs.h \
-   crc24.h \
ctrl.h \
debug.h \
e1_config.h \
@@ -26,16 +24,12 @@
gsm_04_80.h \
gsm_data.h \
gsm_data_shared.h \
-   gsm_subscriber.h \
handover.h \
handover_decision.h \
ipaccess.h \
meas_feed.h \
meas_rep.h \
misdn.h \
-   mncc.h \
-   mncc_int.h \
-   msc_ifaces.h \
nat_rewrite_trie.h \
network_listen.h \
openbscdefines.h \
@@ -52,15 +46,9 @@
rest_octets.h \
rrlp.h \
rs232.h \
-   rtp_proxy.h \
signal.h \
-   silent_call.h \
-   sms_queue.h \
socket.h \
system_information.h \
-   transaction.h \
-   trau_mux.h \
-   trau_upqueue.h \
ussd.h \
vty.h \
bsc_api.h \
diff --git a/include/osmocom/bsc/auth.h b/include/osmocom/bsc/auth.h
deleted file mode 100644
index b314bbf..000
--- a/include/osmocom/bsc/auth.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _AUTH_H
-#define _AUTH_H
-
-#include 
-
-struct gsm_auth_tuple;
-
-enum auth_action {
-   AUTH_ERROR  = -1,   /* Internal error */
-   AUTH_NOT_AVAIL  = 0,/* No auth tuple available */
-   AUTH_DO_AUTH_THEN_CIPH  = 1,/* Firsth authenticate, then cipher */
-   AUTH_DO_CIPH= 2,/* Only ciphering */
-   AUTH_DO_AUTH= 3,/* Only authentication, no ciphering */
-};
-
-extern const struct value_string auth_action_n

[PATCH] osmo-sgsn[master]: Remove unneeded .py scripts

2017-12-19 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5512

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

Remove unneeded .py scripts

The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for
vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py
are not SGSN-specific: leftovers from repository split which are now
available in osmo-python-tests as well.

Change-Id: I3ef4ca790878921a5846f64942a8de8a6ff9c11c
---
M Makefile.am
M configure.ac
D contrib/Makefile.am
D contrib/ipa.py
D contrib/soap.py
D contrib/twisted_ipa.py
M tests/ctrl_test_runner.py
M tests/vty_test_runner.py
8 files changed, 2 insertions(+), 863 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/12/5512/2

diff --git a/Makefile.am b/Makefile.am
index d57b66d..38fdcba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@
include \
src \
tests \
-   contrib \
$(NULL)
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/configure.ac b/configure.ac
index 8f279fd..2de31cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,5 +197,4 @@
 tests/v42bis/Makefile
 doc/Makefile
 doc/examples/Makefile
-contrib/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index db6d0f5..000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = ipa.py
diff --git a/contrib/ipa.py b/contrib/ipa.py
deleted file mode 100755
index 71cbf45..000
--- a/contrib/ipa.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/python3
-# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
-"""
-/*
- * Copyright (C) 2016 sysmocom s.f.m.c. GmbH
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-"""
-
-import struct, random, sys
-
-class IPA(object):
-"""
-Stateless IPA protocol multiplexer: add/remove/parse (extended) header
-"""
-version = "0.0.5"
-TCP_PORT_OML = 3002
-TCP_PORT_RSL = 3003
-# OpenBSC extensions: OSMO, MGCP_OLD
-PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, 
MGCP_OLD=0xFC)
-# ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol
-EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6)
-# OpenBSC extension: SCCP_OLD
-MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, 
SCCP_OLD=0xFF)
-_IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, 
SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8)
-CTRL_GET = 'GET'
-CTRL_SET = 'SET'
-CTRL_REP = 'REPLY'
-CTRL_ERR = 'ERR'
-CTRL_TRAP = 'TRAP'
-
-def _l(self, d, p):
-"""
-Reverse dictionary lookup: return key for a given value
-"""
-if p is None:
-return 'UNKNOWN'
-return list(d.keys())[list(d.values()).index(p)]
-
-def _tag(self, t, v):
-"""
-Create TAG as TLV data
-"""
-return struct.pack(">HB", len(v) + 1, t) + v
-
-def proto(self, p):
-"""
-Lookup protocol name
-"""
-return self._l(self.PROTO, p)
-
-def ext(self, p):
-"""
-Lookup protocol extension name
-"""
-return self._l(self.EXT, p)
-
-def msgt(self, p):
-"""
-Lookup message type name
-"""
-return self._l(self.MSGT, p)
-
-def idtag(self, p):
-"""
-Lookup ID tag name
-"""
-return self._l(self._IDTAG, p)
-
-def ext_name(self, proto, exten):
-"""
-Return proper extension byte name depending on the protocol used
-"""
-if self.PROTO['CCM'] == proto:
-return self.msgt(exten)
-if self.PROTO['OSMO'] == proto:
-return self.ext(exten)
-return None
-
-def add_header(self, data, proto, ext=None):
-"""
-Add IPA header (with extension if necessary), data must be represented 
as bytes
-"""
-if ext is None:
-return struct.pack(">HB", len(data) + 1, proto) + data
-return struct.pack(">HBB", len(data) + 1, proto, ext) + data
-
-def del_header(self, data):
-"""
-Strip IPA protocol header correctly removing extension if present
-Returns data l

python/osmo-python-tests[master]: fix osmo_interact_* and osmo_verify_transcript_* after dir s...

2017-12-19 Thread Max

Patch Set 2:

How to reproduce the issues you mention in commit log?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I40a37b212274cb70ebb1e1d9d1b3743eb2d64d05
Gerrit-PatchSet: 2
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: remove libosmo-sccp dependency for osmo-bsc

2017-12-19 Thread Harald Welte

remove libosmo-sccp dependency for osmo-bsc

libosmo-sccp is the old sccp-lite-focused SCCP implementation that we
used before libosmo-sigtran was created.  The new osmo-bsc in this
repository is using libosmo-sigtran and shouldn't be using parts of
libosmo-sccp anymore.

We only keep it around in configure.ac and Makefile.am for osmo-bsc_nat,
which is not even built in this repository anymore (or 'again yet'?)

Change-Id: I8f274be7d196cd7a5b1ec9ada949130fb06e984d
---
M include/osmocom/bsc/osmo_bsc.h
M src/libfilter/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/osmo_bsc_msc.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/osmo_bsc_vty.c
M tests/bsc/Makefile.am
9 files changed, 6 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/5502/2

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 8a5cd30..0fd29b7 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -15,7 +15,6 @@
BSC_CON_NO_MEM,
 };
 
-struct sccp_connection;
 struct bsc_msc_data;
 struct bsc_msc_connection;
 
@@ -47,10 +46,7 @@
int send_ping;
 
/* SCCP connection realted */
-   struct sccp_connection *sccp;
struct bsc_msc_data *msc;
-   struct osmo_timer_list sccp_it_timeout;
-   struct osmo_timer_list sccp_cc_timeout;
 
struct llist_head sccp_queue;
unsigned int sccp_queue_size;
diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am
index 6d3db0b..41a75bd 100644
--- a/src/libfilter/Makefile.am
+++ b/src/libfilter/Makefile.am
@@ -10,7 +10,6 @@
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(NULL)
 
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 4acbe56..7978852 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -11,7 +11,6 @@
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOCTRL_CFLAGS) \
$(LIBOSMONETIF_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
@@ -45,7 +44,6 @@
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(top_builddir)/src/libcommon/libcommon.a \
-   $(LIBOSMOSCCP_LIBS) \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index c388f5b..152b818 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #define return_when_not_connected(conn) \
@@ -296,13 +295,11 @@
resp = gsm0808_create_layer3(msg, network_code, country_code, lac, ci);
if (!resp) {
LOGP(DMSC, LOGL_DEBUG, "Failed to create layer3 message.\n");
-   sccp_connection_free(conn->sccp_con->sccp);
osmo_bsc_sigtran_del_conn(conn->sccp_con);
return BSC_API_CONN_POL_REJECT;
}
 
if (osmo_bsc_sigtran_open_conn(conn->sccp_con, resp) != 0) {
-   sccp_connection_free(conn->sccp_con->sccp);
osmo_bsc_sigtran_del_conn(conn->sccp_con);
msgb_free(resp);
return BSC_API_CONN_POL_REJECT;
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 829f207..e4c8fc5 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -43,7 +43,6 @@
 
 #include 
 
-#include 
 #include 
 
 #define _GNU_SOURCE
@@ -233,9 +232,6 @@
 
/* seed the PRNG */
srand(time(NULL));
-
-   /* initialize SCCP */
-   sccp_set_log_area(DSCCP);
 
/* Read the config */
rc = bsc_network_configure(config_file);
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 0e5777e..46be2e6 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -34,8 +34,6 @@
 
 #include 
 
-#include 
-
 #include 
 
 #include 
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index a18d4f3..7669b67 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -511,7 +510,8 @@
 
/* If unset, use default local SCCP address */
if (!msc->a.bsc_addr.presence)
-   osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, 
msc->a.sccp, SCCP_SSN_BSSAP);
+   osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, 
msc->a.sccp,
+OSMO_SCCP_SSN_BSSAP);
 
if (!osmo_sccp_check_addr(&msc->a.bsc_addr, 
OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC)) {
 

[PATCH] osmo-bsc[master]: Remove some more dead code

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5479

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

Remove some more dead code

Change-Id: I919bffe88babd90227c89abd4434322965c32ebb
---
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
M src/libcommon-cs/common_cs.c
M src/libcommon/gsm_data.c
4 files changed, 0 insertions(+), 163 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/79/5479/3

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 7a1b62d..1cedef0 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -24,9 +24,7 @@
 
 #define OBSC_NM_W_ACK_CB(__msgb) (__msgb)->cb[3]
 
-struct gsm_subscriber_group;
 struct bsc_subscr;
-struct vlr_instance;
 struct gprs_ra_id;
 
 #define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
@@ -40,26 +38,11 @@
 #define EARFCN_QRXLV_INVALID 32
 #define EARFCN_THRESH_LOW_INVALID 32
 
-enum gsm_security_event {
-   GSM_SECURITY_NOAVAIL,
-   GSM_SECURITY_AUTH_FAILED,
-   GSM_SECURITY_SUCCEEDED,
-   GSM_SECURITY_ALREADY,
-};
-
 struct msgb;
 typedef int gsm_cbfn(unsigned int hooknum,
 unsigned int event,
 struct msgb *msg,
 void *data, void *param);
-
-/*
- * A dummy to keep a connection up for at least
- * a couple of seconds to work around MSC issues.
- */
-struct gsm_anchor_operation {
-   struct osmo_timer_list timeout;
-};
 
 /* Maximum number of neighbor cells whose average we track */
 #define MAX_NEIGH_MEAS 10
@@ -75,16 +58,6 @@
uint8_t last_seen_nr;
 };
 
-enum ran_type {
-   RAN_UNKNOWN,
-   RAN_GERAN_A,/* 2G / A-interface */
-   RAN_UTRAN_IU,   /* 3G / Iu-interface (IuCS or IuPS) */
-};
-
-extern const struct value_string ran_type_names[];
-static inline const char *ran_type_name(enum ran_type val)
-{  return get_value_string(ran_type_names, val);   }
-
 struct gsm_classmark {
bool classmark1_set;
struct gsm48_classmark1 classmark1;
@@ -92,12 +65,6 @@
uint8_t classmark2[3];
uint8_t classmark3_len;
uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be 
truncated */
-};
-
-enum integrity_protection_state {
-   INTEGRITY_PROTECTION_NONE   = 0,
-   INTEGRITY_PROTECTION_IK = 1,
-   INTEGRITY_PROTECTION_IK_CK  = 2,
 };
 
 /* active radio connection of a mobile subscriber */
@@ -125,29 +92,6 @@
struct gsm_classmark classmark;
 
uint16_t lac;
-   struct gsm_encr encr;
-
-   struct {
-   unsigned int mgcp_rtp_endpoint;
-   uint16_t port_subscr;
-   uint16_t port_cn;
-   } rtp;
-
-   struct {
-   /* A pointer to the SCCP user that handles
-* the SCCP connections for this subscriber
-* connection */
-   struct osmo_sccp_user *scu;
-
-   /* The address of the BSC that is associated
-* with this subscriber connection */
-   struct osmo_sccp_addr bsc_addr;
-
-   /* The connection identifier that is used
-* to reference the SCCP connection that is
-* associated with this subscriber connection */
-   int conn_id;
-   } a;
 };
 
 
@@ -241,13 +185,6 @@
bsc_ctr_description,
 };
 
-enum gsm_auth_policy {
-   GSM_AUTH_POLICY_CLOSED, /* only subscribers authorized in DB */
-   GSM_AUTH_POLICY_ACCEPT_ALL, /* accept everyone, even if not authorized 
in DB */
-   GSM_AUTH_POLICY_TOKEN, /* accept first, send token per sms, then revoke 
authorization */
-   GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */
-};
-
 #define GSM_T3101_DEFAULT 3/* s */
 #define GSM_T3103_DEFAULT 5/* s */
 #define GSM_T3105_DEFAULT 100  /* ms */
@@ -280,7 +217,6 @@
uint16_t network_code;
int a5_encryption;
int neci;
-   int send_mm_info;
struct {
int active;
/* Window RXLEV averaging */
@@ -299,7 +235,6 @@
} handover;
 
struct rate_ctr_group *bsc_ctrs;
-   struct osmo_counter *active_calls;
 
/*
 * TODO: Move the trans_list into the subscriber connection and
@@ -361,12 +296,6 @@
 * pointer is NULL to indicate absence of a bsc_subscribers list. */
struct llist_head *bsc_subscribers;
 
-   /* MSC: GSUP server address of the HLR */
-   const char *gsup_server_addr_str;
-   uint16_t gsup_server_port;
-
-   struct vlr_instance *vlr;
-
/* Periodic location update default value */
uint8_t t3212;
 
@@ -374,65 +303,6 @@
struct mgcp_client_conf *conf;
struct mgcp_client *client;
} mgw;
-
-   struct {
-   /* CS7 instance id number (set via VTY) */
-   uint32_t cs7_instance;
-   /* A list w

[PATCH] osmo-bsc[master]: cosmetic: Hide all accesses to conn->bts behind conn_get_bts()

2017-12-19 Thread Harald Welte

cosmetic: Hide all accesses to conn->bts behind conn_get_bts()

This is a new inline function that hides all accesses to conn->bts.

A follow-up patch will then point this to conn->lchan->ts->trx->bts
to get rid of the bts field.

Change-Id: Ib6cf7097ced34eebe80441c29ab1534f21956a33
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
M src/libbsc/bsc_vty.c
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_sigtran.c
8 files changed, 29 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/5510/2

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3cc3794..45fbcd2 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -98,6 +98,10 @@
struct gsm_classmark classmark;
 };
 
+static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection 
*conn) {
+   return conn->bts;
+}
+
 
 #include "gsm_data_shared.h"
 
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 9ec51af..bd55dfc 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -214,7 +214,7 @@
 
chan_type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H;
 
-   new_lchan = lchan_alloc(conn->bts, chan_type, 0);
+   new_lchan = lchan_alloc(conn_get_bts(conn), chan_type, 0);
 
if (!new_lchan) {
LOGP(DMSC, LOGL_NOTICE, "No free channel.\n");
@@ -451,7 +451,7 @@
conn->lchan = conn->secondary_lchan;
conn->secondary_lchan = NULL;
 
-   if (is_ipaccess_bts(conn->bts) && conn->lchan->tch_mode != 
GSM48_CMODE_SIGN)
+   if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != 
GSM48_CMODE_SIGN)
rsl_ipacc_crcx(conn->lchan);
 
api->assign_compl(conn, gh->data[0],
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 7612eda..6d01109 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -1378,7 +1378,7 @@
 
/* Find the connection/lchan that we want to handover */
llist_for_each_entry(conn, &net->subscr_conns, entry) {
-   if (conn->bts->nr == bts_nr &&
+   if (conn_get_bts(conn)->nr == bts_nr &&
conn->lchan->ts->trx->nr == trx_nr &&
conn->lchan->ts->nr == ts_nr && conn->lchan->nr == ss_nr) {
vty_out(vty, "starting handover for lchan %s...%s",
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index a2a8630..1caaeee 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -115,7 +115,7 @@
req.black_list = NULL;
req.access_lists = bsc_access_lists();
req.local_lst_name = msc->acc_lst_name;
-   req.global_lst_name = conn->bts->network->bsc_data->acc_lst_name;
+   req.global_lst_name = 
conn_get_bts(conn)->network->bsc_data->acc_lst_name;
req.bsc_nr = 0;
 
rc = bsc_msg_filter_initial(gh, msgb_l3len(msg), &req,
@@ -136,7 +136,7 @@
req.black_list = NULL;
req.access_lists = bsc_access_lists();
req.local_lst_name = conn->sccp_con->msc->acc_lst_name;
-   req.global_lst_name = conn->bts->network->bsc_data->acc_lst_name;
+   req.global_lst_name = 
conn_get_bts(conn)->network->bsc_data->acc_lst_name;
req.bsc_nr = 0;
 
rc = bsc_msg_filter_data(gh, msgb_l3len(msg), &req,
@@ -228,7 +228,7 @@
if (!msc) {
LOGP(DMSC, LOGL_ERROR, "Failed to find a MSC for a 
connection.\n");
bsc_send_ussd_no_srv(conn, msg,
-
conn->bts->network->bsc_data->ussd_no_msc_txt);
+
conn_get_bts(conn)->network->bsc_data->ussd_no_msc_txt);
return -1;
}
 
@@ -287,8 +287,8 @@
 
network_code = get_network_code_for_msc(conn->sccp_con->msc);
country_code = get_country_code_for_msc(conn->sccp_con->msc);
-   lac = get_lac_for_msc(conn->sccp_con->msc, conn->bts);
-   ci = get_ci_for_msc(conn->sccp_con->msc, conn->bts);
+   lac = get_lac_for_msc(conn->sccp_con->msc, conn_get_bts(conn));
+   ci = get_ci_for_msc(conn->sccp_con->msc, conn_get_bts(conn));
 
bsc_scan_bts_msg(conn, msg);
 
@@ -383,7 +383,7 @@
/*
 * Check if the connection should be moved...
 */
-   llist_for_each_entry(msc, &conn->bts->network->bsc_data->mscs, entry) {
+   llist_for_each_entry(msc, &conn_get_bts(conn)->network->bsc_data->mscs, 
entry) {
if (msc->type != MSC_CON_TYPE_LOCAL)
continue;
if (!msc->local_pref)
@@ -435,7 +435,7 @@
struct msgb *resp;
return_when_not_connected(conn);
 
-   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->user_plane.rtp_ip) {
+   if (is_ipaccess_bts(conn_get_bts(conn)) && 
conn->sccp_con->user_plane.rtp_ip) {
/* NOTE: In

[PATCH] osmo-bsc[master]: remove obsolete gsm_subscriber_connection.bts member

2017-12-19 Thread Harald Welte

remove obsolete gsm_subscriber_connection.bts member

This member was merely a cache for conn->lchan->ts->trx->bts,
so let's avoid having to keep copies of the same data (which needs
to be kept up to date).

Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
M src/libbsc/handover_logic.c
3 files changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/5511/2

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 45fbcd2..05260c6 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -85,9 +85,6 @@
struct gsm_lchan *lchan;
/* the future/allocated but not yet used lchan during HANDOVER */
struct gsm_lchan *ho_lchan;
-   /* a short-hand pointer to the BTS currently serving the subscriber,
-* points to gsm_subscriber_connection.lchan->ts->trx->bts */
-   struct gsm_bts *bts;
 
/* timer for assignment handling */
struct osmo_timer_list T10;
@@ -98,13 +95,14 @@
struct gsm_classmark classmark;
 };
 
-static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection 
*conn) {
-   return conn->bts;
-}
-
 
 #include "gsm_data_shared.h"
 
+static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection 
*conn) {
+   OSMO_ASSERT(conn->lchan);
+   return conn->lchan->ts->trx->bts;
+}
+
 enum {
BTS_CTR_CHREQ_TOTAL,
BTS_CTR_CHREQ_NO_CHANNEL,
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index bd55dfc..e015a02 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -260,7 +260,6 @@
 
conn->network = net;
conn->lchan = lchan;
-   conn->bts = lchan->ts->trx->bts;
lchan->conn = conn;
llist_add_tail(&conn->entry, &net->subscr_conns);
return conn;
@@ -747,7 +746,6 @@
conn->lchan = NULL;
conn->secondary_lchan = NULL;
conn->ho_lchan = NULL;
-   conn->bts = NULL;
 
osmo_timer_del(&conn->T10);
 
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index a30cd09..5ad1392 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -277,7 +277,6 @@
 
new_lchan->conn->ho_lchan = NULL;
new_lchan->conn->lchan = new_lchan;
-   new_lchan->conn->bts = new_lchan->ts->trx->bts;
ho->old_lchan->conn = NULL;
 
lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END);

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

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


[PATCH] osmo-bsc[master]: osmo_bsc_bssap.c: Spelling fixes in comment

2017-12-19 Thread Harald Welte

osmo_bsc_bssap.c: Spelling fixes in comment

Change-Id: I32b2d08bf25cd2d343755ac8491e4f5f758ccee6
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/5503/2

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 4fd43aa..aea3994 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -385,7 +385,7 @@
  * a cipher we will have to send cipher mode reject to the MSC,
  * otherwise we will have to pick something that we and the MS
  * is supporting. Currently we are doing it in a rather static
- * way by picking one ecnryption or no encrytpion.
+ * way by picking one encryption or no encryption.
  */
 static int bssmap_handle_cipher_mode(struct osmo_bsc_sccp_con *conn,
 struct msgb *msg, unsigned int 
payload_length)
@@ -613,7 +613,7 @@
   get_value_string(gsm48_chan_mode_names, chan_mode),
   ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, 
ct.perm_spch_len));
 
-   /* Forward the assingment request to lower layers */
+   /* Forward the assignment request to lower layers */
if (aoip) {
/* Store network side RTP connection information, we will
 * process this address later after we have established an RTP
@@ -626,7 +626,7 @@
/* Create an assignment request using the MGCP fsm. This FSM
 * is directly started when its created (now) and will also
 * take care about the further processing (creating RTP
-* endpoints, calling gsm0808_assign_req(), rsponding to
+* endpoints, calling gsm0808_assign_req(), responding to
 * the assignment request etc... */
conn->mgcp_ctx = mgcp_assignm_req(msc->network, 
msc->network->mgw.client, conn, chan_mode, full_rate);
if (!conn->mgcp_ctx) {

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

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


[PATCH] osmo-bsc[master]: Remove bogus vty config for LU reject cause

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5477

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

Remove bogus vty config for LU reject cause

The LU reject cause (like anything MM related) is under control of
OsmoMSC, not BSC.

Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_vty.c
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs_vty.c
4 files changed, 0 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/77/5477/3

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 0f8bcb9..8e4dc04 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -280,7 +280,6 @@
uint16_t network_code;
char *name_long;
char *name_short;
-   enum gsm48_reject_value reject_cause;
int a5_encryption;
int neci;
int send_mm_info;
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 6fa8e04..a73c6a4 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -172,8 +172,6 @@
vty_out(vty, "  Short network name: '%s'%s",
net->name_short, VTY_NEWLINE);
vty_out(vty, "%s", VTY_NEWLINE);
-   vty_out(vty, "  Location updating reject cause: %u%s",
-   net->reject_cause, VTY_NEWLINE);
vty_out(vty, "  Encryption: A5/%u%s", net->a5_encryption,
VTY_NEWLINE);
vty_out(vty, "  NECI (TCH/H): %u%s", net->neci,
@@ -810,8 +808,6 @@
vty_out(vty, " mobile network code %u%s", gsmnet->network_code, 
VTY_NEWLINE);
vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE);
-   vty_out(vty, " location updating reject cause %u%s",
-   gsmnet->reject_cause, VTY_NEWLINE);
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, 
VTY_NEWLINE);
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 59a8d5c..30de0cc 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -42,7 +42,6 @@
INIT_LLIST_HEAD(&net->bsc_data->mscs);
 
net->num_bts = 0;
-   net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED;
net->T3101 = GSM_T3101_DEFAULT;
net->T3103 = GSM_T3103_DEFAULT;
net->T3105 = GSM_T3105_DEFAULT;
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index 8f6e4ef..2732ebf 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -102,22 +102,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_reject_cause,
-  cfg_net_reject_cause_cmd,
-  "location updating reject cause <2-111>",
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Set the reject cause of location updating reject\n"
-  "Cause Value as Per GSM TS 04.08\n")
-{
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-
-   gsmnet->reject_cause = atoi(argv[0]);
-
-   return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
   cfg_net_encryption_cmd,
   "encryption a5 (0|1|2|3)",
@@ -264,7 +248,6 @@
install_element(GSMNET_NODE, &cfg_net_mnc_cmd);
install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
-   install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_mm_info_cmd);
install_element(GSMNET_NODE, &cfg_net_timezone_cmd);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I559ae31d67726845c9699c8b6127e21c6f63ace6
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[PATCH] osmo-bsc[master]: Remove bogus MM INFO configuration

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5478

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

Remove bogus MM INFO configuration

The network name and other MM INFO is controlled by the MSC, not the BSC.

Change-Id: I1cbf72fc50cff29e7c1633ba752cbf15b4b84c58
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_ctrl_commands.c
M src/libbsc/bsc_init.c
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
5 files changed, 0 insertions(+), 91 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/5478/3

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 8e4dc04..7a1b62d 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -278,8 +278,6 @@
/* global parameters */
uint16_t country_code;
uint16_t network_code;
-   char *name_long;
-   char *name_short;
int a5_encryption;
int neci;
int send_mm_info;
diff --git a/src/libbsc/bsc_ctrl_commands.c b/src/libbsc/bsc_ctrl_commands.c
index 2d6fcb6..41d2361 100644
--- a/src/libbsc/bsc_ctrl_commands.c
+++ b/src/libbsc/bsc_ctrl_commands.c
@@ -30,45 +30,8 @@
 #include 
 #include 
 
-#define CTRL_CMD_VTY_STRING(cmdname, cmdstr, dtype, element) \
-   CTRL_HELPER_GET_STRING(cmdname, dtype, element) \
-   CTRL_HELPER_SET_STRING(cmdname, dtype, element) \
-static struct ctrl_cmd_element cmd_##cmdname = { \
-   .name = cmdstr, \
-   .get = get_##cmdname, \
-   .set = set_##cmdname, \
-   .verify = verify_vty_description_string, \
-}
-
-/**
- * Check that there are no newlines or comments or other things
- * that could make the VTY configuration unparsable.
- */
-static int verify_vty_description_string(struct ctrl_cmd *cmd,
-   const char *value, void *data)
-{
-   int i;
-   const size_t len = strlen(value);
-
-   for (i = 0; i < len; ++i) {
-   switch(value[i]) {
-   case '#':
-   case '\n':
-   case '\r':
-   cmd->reply = "String includes illegal character";
-   return -1;
-   default:
-   break;
-   }
-   }
-
-   return 0;
-}
-
 CTRL_CMD_DEFINE_RANGE(net_mnc, "mnc", struct gsm_network, network_code, 0, 
999);
 CTRL_CMD_DEFINE_RANGE(net_mcc, "mcc", struct gsm_network, country_code, 1, 
999);
-CTRL_CMD_VTY_STRING(net_short_name, "short-name", struct gsm_network, 
name_short);
-CTRL_CMD_VTY_STRING(net_long_name, "long-name", struct gsm_network, name_long);
 
 static int set_net_apply_config(struct ctrl_cmd *cmd, void *data)
 {
@@ -452,8 +415,6 @@
int rc = 0;
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mnc);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc);
-   rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_short_name);
-   rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_long_name);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_apply_config);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_mcc_mnc_apply);
rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_rf_lock);
diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c
index 34dfd36..c5a75aa 100644
--- a/src/libbsc/bsc_init.c
+++ b/src/libbsc/bsc_init.c
@@ -536,9 +536,6 @@
if (!bsc_gsmnet)
return -ENOMEM;
 
-   bsc_gsmnet->name_long = talloc_strdup(bsc_gsmnet, "OpenBSC");
-   bsc_gsmnet->name_short = talloc_strdup(bsc_gsmnet, "OpenBSC");
-
return 0;
 }
 
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index a73c6a4..7612eda 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -167,18 +167,12 @@
vty_out(vty, "BSC is on Country Code %u, Network Code %u "
"and has %u BTS%s", net->country_code, net->network_code,
net->num_bts, VTY_NEWLINE);
-   vty_out(vty, "  Long network name: '%s'%s",
-   net->name_long, VTY_NEWLINE);
-   vty_out(vty, "  Short network name: '%s'%s",
-   net->name_short, VTY_NEWLINE);
vty_out(vty, "%s", VTY_NEWLINE);
vty_out(vty, "  Encryption: A5/%u%s", net->a5_encryption,
VTY_NEWLINE);
vty_out(vty, "  NECI (TCH/H): %u%s", net->neci,
VTY_NEWLINE);
vty_out(vty, "  Use TCH for Paging any: %d%s", net->pag_any_tch,
-   VTY_NEWLINE);
-   vty_out(vty, "  MM Info: %s%s", net->send_mm_info ? "On" : "Off",
VTY_NEWLINE);
vty_out(vty, "  Handover: %s%s", net->handover.active ? "On" : "Off",
VTY_NEWLINE);
@@ -806,12 +800,9 @@
vty_out(vty, "network%s", VTY_NEWLINE);
vty_out(vty, " network country code %u%s", gsmnet->country_code, 
VTY_NEWLINE);
vty_out(vty, " mobile network code %u%s", gsmnet->network_code, 
VTY_NEWLINE);
-   vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
-  

[PATCH] osmo-bsc[master]: Remove unused RRLP options/codec

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5476

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

Remove unused RRLP options/codec

RRLP is handled in OsmoMSC after the split from NITB, so let's remove
any bogus VTY commands left over in the BSC.

Change-Id: Ib626f43a3a3ca69dfc127afe5832eb58f7fb6a38
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
D include/osmocom/bsc/rrlp.h
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/gsm_data.c
8 files changed, 0 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/5476/3

diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 64c3abd..6ad5e59 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -12,7 +12,6 @@
  encryption a5 0
  neci 0
  paging any use tch 0
- rrlp mode none
  mm info 0
  handover 0
  handover window rxlev averaging 10
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 1b86f9a..b067fc2 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -44,7 +44,6 @@
pcu_if.h \
pcuif_proto.h \
rest_octets.h \
-   rrlp.h \
rs232.h \
signal.h \
socket.h \
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3268426..0f8bcb9 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -332,11 +332,6 @@
/* timer to expire old location updates */
struct osmo_timer_list subscr_expire_timer;
 
-   /* Radio Resource Location Protocol (TS 04.31) */
-   struct {
-   enum rrlp_mode mode;
-   } rrlp;
-
enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T];
 
/* Use a TCH for handling requests of type paging any */
@@ -519,9 +514,6 @@
 
 enum gsm_auth_policy gsm_auth_policy_parse(const char *arg);
 const char *gsm_auth_policy_name(enum gsm_auth_policy policy);
-
-enum rrlp_mode rrlp_mode_parse(const char *arg);
-const char *rrlp_mode_name(enum rrlp_mode mode);
 
 enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid);
 const char *bts_gprs_mode_name(enum bts_gprs_mode mode);
diff --git a/include/osmocom/bsc/gsm_data_shared.h 
b/include/osmocom/bsc/gsm_data_shared.h
index 9bbcabd..5d9b570 100644
--- a/include/osmocom/bsc/gsm_data_shared.h
+++ b/include/osmocom/bsc/gsm_data_shared.h
@@ -34,14 +34,6 @@
 
 struct osmo_bsc_sccp_con;
 
-/* RRLP mode of operation */
-enum rrlp_mode {
-   RRLP_MODE_NONE,
-   RRLP_MODE_MS_BASED,
-   RRLP_MODE_MS_PREF,
-   RRLP_MODE_ASS_PREF,
-};
-
 /* Channel Request reason */
 enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
diff --git a/include/osmocom/bsc/rrlp.h b/include/osmocom/bsc/rrlp.h
deleted file mode 100644
index c89402a..000
--- a/include/osmocom/bsc/rrlp.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _RRLP_H
-#define _RRLP_H
-
-void on_dso_load_rrlp(void);
-
-#endif /* _RRLP_H */
-
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 9500645..6fa8e04 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -180,8 +180,6 @@
VTY_NEWLINE);
vty_out(vty, "  Use TCH for Paging any: %d%s", net->pag_any_tch,
VTY_NEWLINE);
-   vty_out(vty, "  RRLP Mode: %s%s", rrlp_mode_name(net->rrlp.mode),
-   VTY_NEWLINE);
vty_out(vty, "  MM Info: %s%s", net->send_mm_info ? "On" : "Off",
VTY_NEWLINE);
vty_out(vty, "  Handover: %s%s", net->handover.active ? "On" : "Off",
@@ -817,8 +815,6 @@
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE);
vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, 
VTY_NEWLINE);
-   vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
-   VTY_NEWLINE);
vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE);
vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE);
vty_out(vty, " handover window rxlev averaging %u%s",
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index beb936b..8f6e4ef 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -133,22 +133,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd,
-  "rrlp mode (none|ms-based|ms-preferred|ass-preferred)",
-   "Radio Resource Location Protocol\n"
-   "Set the Radio Resource Location Protocol Mode\n"
-   "Don't send RRLP request\n"
-   "Request MS-based location\n"
-   "Request any location, prefer MS-based\n"
-   "Request any location, prefer MS-assisted\n")
-{
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-
-  

[PATCH] osmo-bsc[master]: remove unused 'lac' member of 'struct gsm_subscriber_connect...

2017-12-19 Thread Harald Welte

remove unused 'lac' member of 'struct gsm_subscriber_connection'

This field was used in write-pnly mode, i.e. set but never read.

Change-Id: I319945538fd3e3bc5cf3b9d82533641cb8ba5256
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
2 files changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/5508/2

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 2e97055..3cc3794 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -96,8 +96,6 @@
 
/* buffer/cache for classmark of the ME of the subscriber */
struct gsm_classmark classmark;
-
-   uint16_t lac;
 };
 
 
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 6ff1688..9ec51af 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -261,7 +261,6 @@
conn->network = net;
conn->lchan = lchan;
conn->bts = lchan->ts->trx->bts;
-   conn->lac = conn->bts->location_area_code;
lchan->conn = conn;
llist_add_tail(&conn->entry, &net->subscr_conns);
return conn;

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

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


[PATCH] osmo-bsc[master]: bsc_test.c: Use proper network/bts/lchan structures

2017-12-19 Thread Harald Welte

bsc_test.c: Use proper network/bts/lchan structures

don't mock them, simply call the respective functions to get
a gsm_network and a gsm_bts with all its subordinate members.

Change-Id: I8bdf009d3c7e2473dd42da02762039a19430d6ce
---
M tests/bsc/bsc_test.c
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/5509/2

diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 1d7baa1..420ef73 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -121,22 +122,20 @@
 {
int i;
 
-   struct gsm_network *net;
-   struct gsm_bts *bts;
+   struct gsm_network *net = bsc_network_init(NULL, 1, 1);
+   struct gsm_bts *bts = gsm_bts_alloc(net, 0);
struct osmo_bsc_sccp_con *sccp_con;
struct bsc_msc_data *msc;
struct gsm_subscriber_connection *conn;
 
-   net = talloc_zero(NULL, struct gsm_network);
-   bts = talloc_zero(net, struct gsm_bts);
sccp_con = talloc_zero(net, struct osmo_bsc_sccp_con);
msc = talloc_zero(net, struct bsc_msc_data);
conn = talloc_zero(net, struct gsm_subscriber_connection);
 
bts->network = net;
sccp_con->msc = msc;
-   conn->bts = bts;
conn->sccp_con = sccp_con;
+   conn->lchan = &bts->c0->ts[1].lchan[0];
 
/* start testing with proper messages */
printf("Testing BTS<->MSC message scan.\n");

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

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


[PATCH] osmo-bsc[master]: gsm_data.h: Document all fields of gsm_subscriber_connection

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5507

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

gsm_data.h: Document all fields of gsm_subscriber_connection

Change-Id: I429fe7817f075d0794645d37f5ea11b104102ba0
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 14 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/5507/2

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1cedef0..2e97055 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -75,20 +75,26 @@
/* libbsc subscriber information (if available) */
struct bsc_subscr *bsub;
 
-   /* bsc structures */
-   struct osmo_bsc_sccp_con *sccp_con; /* BSC */
+   /* SCCP connection associatd with this subscriber_connection */
+   struct osmo_bsc_sccp_con *sccp_con;
 
/* back pointers */
struct gsm_network *network;
 
-   struct gsm_lchan *lchan; /* BSC */
-   struct gsm_lchan *ho_lchan; /* BSC */
-   struct gsm_bts *bts; /* BSC */
+   /* the primary / currently active lchan to the BTS/subscriber */
+   struct gsm_lchan *lchan;
+   /* the future/allocated but not yet used lchan during HANDOVER */
+   struct gsm_lchan *ho_lchan;
+   /* a short-hand pointer to the BTS currently serving the subscriber,
+* points to gsm_subscriber_connection.lchan->ts->trx->bts */
+   struct gsm_bts *bts;
 
-   /* for assignment handling */
-   struct osmo_timer_list T10; /* BSC */
-   struct gsm_lchan *secondary_lchan; /* BSC */
+   /* timer for assignment handling */
+   struct osmo_timer_list T10;
+   /* the future allocated but not yet used lchan during ASSIGNMENT */
+   struct gsm_lchan *secondary_lchan;
 
+   /* buffer/cache for classmark of the ME of the subscriber */
struct gsm_classmark classmark;
 
uint16_t lac;

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

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


[PATCH] osmo-bsc[master]: Remove dead code left over from NITB split

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5475

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

Remove dead code left over from NITB split

There still is a lot of dead code that we inherited from the NITB
days, let's remove more of it.

libtrau will be re-introduced as part of osmo-mgw later.

Change-Id: I8e0af56a158f25a4f1384d667c03eb20e72df5b8
---
M configure.ac
M include/osmocom/bsc/Makefile.am
D include/osmocom/bsc/auth.h
M include/osmocom/bsc/bss.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/common_bsc.h
M include/osmocom/bsc/common_cs.h
D include/osmocom/bsc/crc24.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/gsm_data_shared.h
D include/osmocom/bsc/gsm_subscriber.h
M include/osmocom/bsc/ipaccess.h
D include/osmocom/bsc/mncc.h
D include/osmocom/bsc/mncc_int.h
D include/osmocom/bsc/msc_ifaces.h
D include/osmocom/bsc/rtp_proxy.h
M include/osmocom/bsc/signal.h
D include/osmocom/bsc/silent_call.h
D include/osmocom/bsc/smpp.h
D include/osmocom/bsc/sms_queue.h
D include/osmocom/bsc/transaction.h
D include/osmocom/bsc/trau_mux.h
D include/osmocom/bsc/trau_upqueue.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/ipaccess/ipaccess-config.c
M src/libbsc/abis_rsl.c
M src/libbsc/bsc_api.c
M src/libbsc/bsc_init.c
M src/libbsc/chan_alloc.c
M src/libbsc/e1_config.c
M src/libbsc/gsm_04_08_utils.c
M src/libbsc/handover_logic.c
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs.c
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/Makefile.am
M src/libcommon/common_vty.c
D src/libcommon/gsm_subscriber_base.c
M src/libcommon/talloc_ctx.c
D src/libtrau/Makefile.am
D src/libtrau/rtp_proxy.c
D src/libtrau/trau_mux.c
D src/libtrau/trau_upqueue.c
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/Makefile.am
M src/osmo-bsc_nat/bsc_filter.c
M src/utils/Makefile.am
M src/utils/bs11_config.c
M tests/Makefile.am
M tests/abis/Makefile.am
M tests/bsc-nat-trie/Makefile.am
M tests/bsc-nat/Makefile.am
M tests/bsc/Makefile.am
M tests/bsc/bsc_test.c
M tests/bssap/Makefile.am
M tests/bssap/bssap_test.c
M tests/channel/channel_test.c
M tests/gsm0408/Makefile.am
M tests/gsm0408/gsm0408_test.c
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
M tests/testsuite.at
D tests/trau/Makefile.am
D tests/trau/trau_test.c
D tests/trau/trau_test.ok
68 files changed, 30 insertions(+), 2,489 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/5475/3

diff --git a/configure.ac b/configure.ac
index b7dd016..540d2cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,7 +145,6 @@
 include/osmocom/Makefile
 include/osmocom/bsc/Makefile
 src/Makefile
-src/libtrau/Makefile
 src/libbsc/Makefile
 src/libcommon/Makefile
 src/libfilter/Makefile
@@ -161,7 +160,6 @@
 tests/bsc-nat/Makefile
 tests/bsc-nat-trie/Makefile
 tests/abis/Makefile
-tests/trau/Makefile
 tests/subscr/Makefile
 tests/nanobts_omlattr/Makefile
 tests/bssap/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 9d2ee6e..1b86f9a 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -4,7 +4,6 @@
abis_om2000.h \
abis_rsl.h \
arfcn_range_encode.h \
-   auth.h \
bsc_msc.h \
bsc_msg_filter.h \
bsc_nat.h \
@@ -18,7 +17,6 @@
common.h \
common_bsc.h \
common_cs.h \
-   crc24.h \
ctrl.h \
debug.h \
e1_config.h \
@@ -26,16 +24,12 @@
gsm_04_80.h \
gsm_data.h \
gsm_data_shared.h \
-   gsm_subscriber.h \
handover.h \
handover_decision.h \
ipaccess.h \
meas_feed.h \
meas_rep.h \
misdn.h \
-   mncc.h \
-   mncc_int.h \
-   msc_ifaces.h \
nat_rewrite_trie.h \
network_listen.h \
openbscdefines.h \
@@ -52,15 +46,9 @@
rest_octets.h \
rrlp.h \
rs232.h \
-   rtp_proxy.h \
signal.h \
-   silent_call.h \
-   sms_queue.h \
socket.h \
system_information.h \
-   transaction.h \
-   trau_mux.h \
-   trau_upqueue.h \
ussd.h \
vty.h \
bsc_api.h \
diff --git a/include/osmocom/bsc/auth.h b/include/osmocom/bsc/auth.h
deleted file mode 100644
index b314bbf..000
--- a/include/osmocom/bsc/auth.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef _AUTH_H
-#define _AUTH_H
-
-#include 
-
-struct gsm_auth_tuple;
-
-enum auth_action {
-   AUTH_ERROR  = -1,   /* Internal error */
-   AUTH_NOT_AVAIL  = 0,/* No auth tuple available */
-   AUTH_DO_AUTH_THEN_CIPH  = 1,/* Firsth authenticate, then cipher */
-   AUTH_DO_CIPH= 2,/* Only ciphering */
-   AUTH_DO_AUTH= 3,/* Only authentication, no ciphering */
-};
-
-extern const struct value_string auth_action_n

[PATCH] osmo-bsc[master]: more remove

2017-12-19 Thread Harald Welte

more remove

Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 0 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/5504/2

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 0fd29b7..13072c2 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -48,9 +48,6 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
-   struct llist_head sccp_queue;
-   unsigned int sccp_queue_size;
-
struct gsm_subscriber_connection *conn;
uint8_t new_subscriber;
 

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

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


[PATCH] osmo-bsc[master]: osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

2017-12-19 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5505

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

osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

Change-Id: I674ed61a22fad5cc09c45128dbc73474893aefb6
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5505/2

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 13072c2..131007b 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -19,8 +19,10 @@
 struct bsc_msc_connection;
 
 struct osmo_bsc_sccp_con {
+   /* list_head anchoring us to gsm_network.subscr_conns */
struct llist_head entry;
 
+   /* flag to prevent multiple simultaneous ciphering commands */
int ciphering_handled;
 
/* for audio handling */
@@ -48,9 +50,12 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
+   /* back-pointer to subscriber connection */
struct gsm_subscriber_connection *conn;
+   /* state related to welcome USSD */
uint8_t new_subscriber;
 
+   /* state related to osmo_bsc_filter.c */
struct bsc_filter_state filter_state;
 
/* Sigtran connection ID */

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

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


[PATCH] osmo-bsc[master]: osmo-bsc: Move user plane/voice related bits into sub-structure

2017-12-19 Thread Harald Welte

osmo-bsc: Move user plane/voice related bits into sub-structure

This clarifies which members of the struct are for what.

Change-Id: I618822e6f2d48adce25f9df5c25acbce7c858412
---
M include/osmocom/bsc/osmo_bsc.h
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_ctrl.c
M src/osmo-bsc/osmo_bsc_mgcp.c
M src/osmo-bsc/osmo_bsc_sigtran.c
7 files changed, 43 insertions(+), 44 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/5506/2

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 131007b..485c836 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -26,23 +26,23 @@
int ciphering_handled;
 
/* for audio handling */
-   uint16_t cic;
-   uint32_t rtp_ip;
-   int rtp_port;
+   struct {
+   uint16_t cic;
+   uint32_t rtp_ip;
+   int rtp_port;
+   /* RTP address of the remote end (assigned by MSC through 
assignment request) */
+   struct sockaddr_storage aoip_rtp_addr_remote;
 
-   /* RTP address of the remote end (assigned by MSC through assignment
-* request) */
-   struct sockaddr_storage aoip_rtp_addr_remote;
+   /* Local RTP address (reported back to the MSC by us with the
+* assignment complete message) */
+   struct sockaddr_storage aoip_rtp_addr_local;
 
-   /* Local RTP address (reported back to the MSC by us with the
-* assignment complete message) */
-   struct sockaddr_storage aoip_rtp_addr_local;
-
-   /* storage to keep states of the MGCP connection handler, the
-* handler is created when an assignment request is received
-* and is terminated when the assignment complete message is
-* sent */
-   struct mgcp_ctx *mgcp_ctx;
+   /* storage to keep states of the MGCP connection handler, the
+   * handler is created when an assignment request is received
+   * and is terminated when the assignment complete message is
+   * sent */
+   struct mgcp_ctx *mgcp_ctx;
+   } user_plane;
 
/* for advanced ping/pong */
int send_ping;
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index 152b818..a2a8630 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -435,7 +435,7 @@
struct msgb *resp;
return_when_not_connected(conn);
 
-   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->rtp_ip) {
+   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->user_plane.rtp_ip) {
/* NOTE: In a network that makes use of an IPA base station
 * and AoIP, we have to wait until the BTS reports its RTP
 * IP/Port combination back to BSC via RSL. Unfortunately, the
diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c
index 0c11b85..82367f0 100644
--- a/src/osmo-bsc/osmo_bsc_audio.c
+++ b/src/osmo-bsc/osmo_bsc_audio.c
@@ -57,17 +57,17 @@
 
/* we can ask it to connect now */
LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n",
-con->sccp_con->rtp_port, lchan->abis_ip.conn_id);
+con->sccp_con->user_plane.rtp_port, 
lchan->abis_ip.conn_id);
 
/* If AoIP is in use, the rtp_ip, which has been communicated
 * via the A interface as connect_ip */
-   if(con->sccp_con->rtp_ip)
-   rtp_ip = con->sccp_con->rtp_ip;
+   if(con->sccp_con->user_plane.rtp_ip)
+   rtp_ip = con->sccp_con->user_plane.rtp_ip;
else
rtp_ip = ntohl(INADDR_ANY);
 
rc = rsl_ipacc_mdcx(lchan, rtp_ip,
-   con->sccp_con->rtp_port,
+   con->sccp_con->user_plane.rtp_port,
lchan->abis_ip.rtp_payload2);
if (rc < 0) {
LOGP(DMSC, LOGL_ERROR, "Failed to send MDCX: %d\n", rc);
@@ -84,13 +84,13 @@
 * inform the logic that controls the MGW about the new
 * connection info */
LOGP(DMSC, LOGL_INFO,"RTP connection handover 
initiated...\n");
-   mgcp_handover(con->sccp_con->mgcp_ctx, con->ho_lchan);
-   } else if (is_ipaccess_bts(con->bts) && con->sccp_con->rtp_ip) {
+   mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, 
con->ho_lchan);
+   } else if (is_ipaccess_bts(con->bts) && 
con->sccp_con->user_plane.rtp_ip) {
/* NOTE: This is only relevant on AoIP networks with
 * IPA based base stations. See also osmo_bsc_api.c,
 * function bsc_assign_compl() */

[PATCH] osmo-sgsn[master]: Remove unneeded .py scripts

2017-12-19 Thread Max

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

Remove unneeded .py scripts

The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for
vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py
are not SGSN-specific: leftovers from repository split which are now
available in osmo-python-tests as well.

Change-Id: I3ef4ca790878921a5846f64942a8de8a6ff9c11c
---
M configure.ac
D contrib/Makefile.am
D contrib/ipa.py
D contrib/soap.py
D contrib/twisted_ipa.py
M tests/ctrl_test_runner.py
M tests/vty_test_runner.py
7 files changed, 2 insertions(+), 862 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/12/5512/1

diff --git a/configure.ac b/configure.ac
index 8f279fd..2de31cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,5 +197,4 @@
 tests/v42bis/Makefile
 doc/Makefile
 doc/examples/Makefile
-contrib/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index db6d0f5..000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = ipa.py
diff --git a/contrib/ipa.py b/contrib/ipa.py
deleted file mode 100755
index 71cbf45..000
--- a/contrib/ipa.py
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/python3
-# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
-"""
-/*
- * Copyright (C) 2016 sysmocom s.f.m.c. GmbH
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-"""
-
-import struct, random, sys
-
-class IPA(object):
-"""
-Stateless IPA protocol multiplexer: add/remove/parse (extended) header
-"""
-version = "0.0.5"
-TCP_PORT_OML = 3002
-TCP_PORT_RSL = 3003
-# OpenBSC extensions: OSMO, MGCP_OLD
-PROTO = dict(RSL=0x00, CCM=0xFE, SCCP=0xFD, OML=0xFF, OSMO=0xEE, 
MGCP_OLD=0xFC)
-# ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol
-EXT = dict(CTRL=0, MGCP=1, LAC=2, SMSC=3, ORC=4, GSUP=5, OAP=6)
-# OpenBSC extension: SCCP_OLD
-MSGT = dict(PING=0x00, PONG=0x01, ID_GET=0x04, ID_RESP=0x05, ID_ACK=0x06, 
SCCP_OLD=0xFF)
-_IDTAG = dict(SERNR=0, UNITNAME=1, LOCATION=2, TYPE=3, EQUIPVERS=4, 
SWVERSION=5, IPADDR=6, MACADDR=7, UNIT=8)
-CTRL_GET = 'GET'
-CTRL_SET = 'SET'
-CTRL_REP = 'REPLY'
-CTRL_ERR = 'ERR'
-CTRL_TRAP = 'TRAP'
-
-def _l(self, d, p):
-"""
-Reverse dictionary lookup: return key for a given value
-"""
-if p is None:
-return 'UNKNOWN'
-return list(d.keys())[list(d.values()).index(p)]
-
-def _tag(self, t, v):
-"""
-Create TAG as TLV data
-"""
-return struct.pack(">HB", len(v) + 1, t) + v
-
-def proto(self, p):
-"""
-Lookup protocol name
-"""
-return self._l(self.PROTO, p)
-
-def ext(self, p):
-"""
-Lookup protocol extension name
-"""
-return self._l(self.EXT, p)
-
-def msgt(self, p):
-"""
-Lookup message type name
-"""
-return self._l(self.MSGT, p)
-
-def idtag(self, p):
-"""
-Lookup ID tag name
-"""
-return self._l(self._IDTAG, p)
-
-def ext_name(self, proto, exten):
-"""
-Return proper extension byte name depending on the protocol used
-"""
-if self.PROTO['CCM'] == proto:
-return self.msgt(exten)
-if self.PROTO['OSMO'] == proto:
-return self.ext(exten)
-return None
-
-def add_header(self, data, proto, ext=None):
-"""
-Add IPA header (with extension if necessary), data must be represented 
as bytes
-"""
-if ext is None:
-return struct.pack(">HB", len(data) + 1, proto) + data
-return struct.pack(">HBB", len(data) + 1, proto, ext) + data
-
-def del_header(self, data):
-"""
-Strip IPA protocol header correctly removing extension if present
-Returns data length, IPA protocol, extension (or None if not defined 
for a give protocol) and the data without header
-"""
-if not len(data):
-return None, None, None, None
-(dlen, proto) = struct.unpack('>HB', data[:3])
-if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # 
there's extension which we have to unpack

[PATCH] osmo-bsc[master]: remove obsolete gsm_subscriber_connection.bts member

2017-12-19 Thread Harald Welte

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

remove obsolete gsm_subscriber_connection.bts member

This member was merely a cache for conn->lchan->ts->trx->bts,
so let's avoid having to keep copies of the same data (which needs
to be kept up to date).

Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
M src/libbsc/handover_logic.c
3 files changed, 5 insertions(+), 10 deletions(-)


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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 45fbcd2..05260c6 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -85,9 +85,6 @@
struct gsm_lchan *lchan;
/* the future/allocated but not yet used lchan during HANDOVER */
struct gsm_lchan *ho_lchan;
-   /* a short-hand pointer to the BTS currently serving the subscriber,
-* points to gsm_subscriber_connection.lchan->ts->trx->bts */
-   struct gsm_bts *bts;
 
/* timer for assignment handling */
struct osmo_timer_list T10;
@@ -98,13 +95,14 @@
struct gsm_classmark classmark;
 };
 
-static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection 
*conn) {
-   return conn->bts;
-}
-
 
 #include "gsm_data_shared.h"
 
+static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection 
*conn) {
+   OSMO_ASSERT(conn->lchan);
+   return conn->lchan->ts->trx->bts;
+}
+
 enum {
BTS_CTR_CHREQ_TOTAL,
BTS_CTR_CHREQ_NO_CHANNEL,
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index bd55dfc..e015a02 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -260,7 +260,6 @@
 
conn->network = net;
conn->lchan = lchan;
-   conn->bts = lchan->ts->trx->bts;
lchan->conn = conn;
llist_add_tail(&conn->entry, &net->subscr_conns);
return conn;
@@ -747,7 +746,6 @@
conn->lchan = NULL;
conn->secondary_lchan = NULL;
conn->ho_lchan = NULL;
-   conn->bts = NULL;
 
osmo_timer_del(&conn->T10);
 
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index a30cd09..5ad1392 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -277,7 +277,6 @@
 
new_lchan->conn->ho_lchan = NULL;
new_lchan->conn->lchan = new_lchan;
-   new_lchan->conn->bts = new_lchan->ts->trx->bts;
ho->old_lchan->conn = NULL;
 
lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END);

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

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


[PATCH] osmo-bsc[master]: more remove

2017-12-19 Thread Harald Welte

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

more remove

Change-Id: Ibc4b8f3776c35df7e81252efb78ec740a371de7f
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 0fd29b7..13072c2 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -48,9 +48,6 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
-   struct llist_head sccp_queue;
-   unsigned int sccp_queue_size;
-
struct gsm_subscriber_connection *conn;
uint8_t new_subscriber;
 

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

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


[PATCH] osmo-bsc[master]: osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

2017-12-19 Thread Harald Welte

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

osmo_bsc.h: document every field in 'struct osmo_bsc_sccp_con'

Change-Id: I674ed61a22fad5cc09c45128dbc73474893aefb6
---
M include/osmocom/bsc/osmo_bsc.h
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 13072c2..131007b 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -19,8 +19,10 @@
 struct bsc_msc_connection;
 
 struct osmo_bsc_sccp_con {
+   /* list_head anchoring us to gsm_network.subscr_conns */
struct llist_head entry;
 
+   /* flag to prevent multiple simultaneous ciphering commands */
int ciphering_handled;
 
/* for audio handling */
@@ -48,9 +50,12 @@
/* SCCP connection realted */
struct bsc_msc_data *msc;
 
+   /* back-pointer to subscriber connection */
struct gsm_subscriber_connection *conn;
+   /* state related to welcome USSD */
uint8_t new_subscriber;
 
+   /* state related to osmo_bsc_filter.c */
struct bsc_filter_state filter_state;
 
/* Sigtran connection ID */

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

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


[PATCH] osmo-bsc[master]: osmo-bsc: Move user plane/voice related bits into sub-structure

2017-12-19 Thread Harald Welte

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

osmo-bsc: Move user plane/voice related bits into sub-structure

This clarifies which members of the struct are for what.

Change-Id: I618822e6f2d48adce25f9df5c25acbce7c858412
---
M include/osmocom/bsc/osmo_bsc.h
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_ctrl.c
M src/osmo-bsc/osmo_bsc_mgcp.c
M src/osmo-bsc/osmo_bsc_sigtran.c
7 files changed, 43 insertions(+), 44 deletions(-)


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

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 131007b..485c836 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -26,23 +26,23 @@
int ciphering_handled;
 
/* for audio handling */
-   uint16_t cic;
-   uint32_t rtp_ip;
-   int rtp_port;
+   struct {
+   uint16_t cic;
+   uint32_t rtp_ip;
+   int rtp_port;
+   /* RTP address of the remote end (assigned by MSC through 
assignment request) */
+   struct sockaddr_storage aoip_rtp_addr_remote;
 
-   /* RTP address of the remote end (assigned by MSC through assignment
-* request) */
-   struct sockaddr_storage aoip_rtp_addr_remote;
+   /* Local RTP address (reported back to the MSC by us with the
+* assignment complete message) */
+   struct sockaddr_storage aoip_rtp_addr_local;
 
-   /* Local RTP address (reported back to the MSC by us with the
-* assignment complete message) */
-   struct sockaddr_storage aoip_rtp_addr_local;
-
-   /* storage to keep states of the MGCP connection handler, the
-* handler is created when an assignment request is received
-* and is terminated when the assignment complete message is
-* sent */
-   struct mgcp_ctx *mgcp_ctx;
+   /* storage to keep states of the MGCP connection handler, the
+   * handler is created when an assignment request is received
+   * and is terminated when the assignment complete message is
+   * sent */
+   struct mgcp_ctx *mgcp_ctx;
+   } user_plane;
 
/* for advanced ping/pong */
int send_ping;
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index 152b818..a2a8630 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -435,7 +435,7 @@
struct msgb *resp;
return_when_not_connected(conn);
 
-   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->rtp_ip) {
+   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->user_plane.rtp_ip) {
/* NOTE: In a network that makes use of an IPA base station
 * and AoIP, we have to wait until the BTS reports its RTP
 * IP/Port combination back to BSC via RSL. Unfortunately, the
diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c
index 0c11b85..82367f0 100644
--- a/src/osmo-bsc/osmo_bsc_audio.c
+++ b/src/osmo-bsc/osmo_bsc_audio.c
@@ -57,17 +57,17 @@
 
/* we can ask it to connect now */
LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n",
-con->sccp_con->rtp_port, lchan->abis_ip.conn_id);
+con->sccp_con->user_plane.rtp_port, 
lchan->abis_ip.conn_id);
 
/* If AoIP is in use, the rtp_ip, which has been communicated
 * via the A interface as connect_ip */
-   if(con->sccp_con->rtp_ip)
-   rtp_ip = con->sccp_con->rtp_ip;
+   if(con->sccp_con->user_plane.rtp_ip)
+   rtp_ip = con->sccp_con->user_plane.rtp_ip;
else
rtp_ip = ntohl(INADDR_ANY);
 
rc = rsl_ipacc_mdcx(lchan, rtp_ip,
-   con->sccp_con->rtp_port,
+   con->sccp_con->user_plane.rtp_port,
lchan->abis_ip.rtp_payload2);
if (rc < 0) {
LOGP(DMSC, LOGL_ERROR, "Failed to send MDCX: %d\n", rc);
@@ -84,13 +84,13 @@
 * inform the logic that controls the MGW about the new
 * connection info */
LOGP(DMSC, LOGL_INFO,"RTP connection handover 
initiated...\n");
-   mgcp_handover(con->sccp_con->mgcp_ctx, con->ho_lchan);
-   } else if (is_ipaccess_bts(con->bts) && con->sccp_con->rtp_ip) {
+   mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, 
con->ho_lchan);
+   } else if (is_ipaccess_bts(con->bts) && 
con->sccp_con->user_plane.rtp_ip) {
/* NOTE: This is only relevant on AoIP networks with
 * IPA based base stations. See also osmo_bsc_api.c,
 

[PATCH] osmo-bsc[master]: remove unused 'lac' member of 'struct gsm_subscriber_connect...

2017-12-19 Thread Harald Welte

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

remove unused 'lac' member of 'struct gsm_subscriber_connection'

This field was used in write-pnly mode, i.e. set but never read.

Change-Id: I319945538fd3e3bc5cf3b9d82533641cb8ba5256
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
2 files changed, 0 insertions(+), 3 deletions(-)


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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 2e97055..3cc3794 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -96,8 +96,6 @@
 
/* buffer/cache for classmark of the ME of the subscriber */
struct gsm_classmark classmark;
-
-   uint16_t lac;
 };
 
 
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 6ff1688..9ec51af 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -261,7 +261,6 @@
conn->network = net;
conn->lchan = lchan;
conn->bts = lchan->ts->trx->bts;
-   conn->lac = conn->bts->location_area_code;
lchan->conn = conn;
llist_add_tail(&conn->entry, &net->subscr_conns);
return conn;

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

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


[PATCH] osmo-bsc[master]: cosmetic: Hide all accesses to conn->bts behind conn_get_bts()

2017-12-19 Thread Harald Welte

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

cosmetic: Hide all accesses to conn->bts behind conn_get_bts()

This is a new inline function that hides all accesses to conn->bts.

A follow-up patch will then point this to conn->lchan->ts->trx->bts
to get rid of the bts field.

Change-Id: Ib6cf7097ced34eebe80441c29ab1534f21956a33
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
M src/libbsc/bsc_vty.c
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_sigtran.c
8 files changed, 29 insertions(+), 22 deletions(-)


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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 3cc3794..45fbcd2 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -98,6 +98,10 @@
struct gsm_classmark classmark;
 };
 
+static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection 
*conn) {
+   return conn->bts;
+}
+
 
 #include "gsm_data_shared.h"
 
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 9ec51af..bd55dfc 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -214,7 +214,7 @@
 
chan_type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H;
 
-   new_lchan = lchan_alloc(conn->bts, chan_type, 0);
+   new_lchan = lchan_alloc(conn_get_bts(conn), chan_type, 0);
 
if (!new_lchan) {
LOGP(DMSC, LOGL_NOTICE, "No free channel.\n");
@@ -451,7 +451,7 @@
conn->lchan = conn->secondary_lchan;
conn->secondary_lchan = NULL;
 
-   if (is_ipaccess_bts(conn->bts) && conn->lchan->tch_mode != 
GSM48_CMODE_SIGN)
+   if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != 
GSM48_CMODE_SIGN)
rsl_ipacc_crcx(conn->lchan);
 
api->assign_compl(conn, gh->data[0],
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 7612eda..6d01109 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -1378,7 +1378,7 @@
 
/* Find the connection/lchan that we want to handover */
llist_for_each_entry(conn, &net->subscr_conns, entry) {
-   if (conn->bts->nr == bts_nr &&
+   if (conn_get_bts(conn)->nr == bts_nr &&
conn->lchan->ts->trx->nr == trx_nr &&
conn->lchan->ts->nr == ts_nr && conn->lchan->nr == ss_nr) {
vty_out(vty, "starting handover for lchan %s...%s",
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index a2a8630..1caaeee 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -115,7 +115,7 @@
req.black_list = NULL;
req.access_lists = bsc_access_lists();
req.local_lst_name = msc->acc_lst_name;
-   req.global_lst_name = conn->bts->network->bsc_data->acc_lst_name;
+   req.global_lst_name = 
conn_get_bts(conn)->network->bsc_data->acc_lst_name;
req.bsc_nr = 0;
 
rc = bsc_msg_filter_initial(gh, msgb_l3len(msg), &req,
@@ -136,7 +136,7 @@
req.black_list = NULL;
req.access_lists = bsc_access_lists();
req.local_lst_name = conn->sccp_con->msc->acc_lst_name;
-   req.global_lst_name = conn->bts->network->bsc_data->acc_lst_name;
+   req.global_lst_name = 
conn_get_bts(conn)->network->bsc_data->acc_lst_name;
req.bsc_nr = 0;
 
rc = bsc_msg_filter_data(gh, msgb_l3len(msg), &req,
@@ -228,7 +228,7 @@
if (!msc) {
LOGP(DMSC, LOGL_ERROR, "Failed to find a MSC for a 
connection.\n");
bsc_send_ussd_no_srv(conn, msg,
-
conn->bts->network->bsc_data->ussd_no_msc_txt);
+
conn_get_bts(conn)->network->bsc_data->ussd_no_msc_txt);
return -1;
}
 
@@ -287,8 +287,8 @@
 
network_code = get_network_code_for_msc(conn->sccp_con->msc);
country_code = get_country_code_for_msc(conn->sccp_con->msc);
-   lac = get_lac_for_msc(conn->sccp_con->msc, conn->bts);
-   ci = get_ci_for_msc(conn->sccp_con->msc, conn->bts);
+   lac = get_lac_for_msc(conn->sccp_con->msc, conn_get_bts(conn));
+   ci = get_ci_for_msc(conn->sccp_con->msc, conn_get_bts(conn));
 
bsc_scan_bts_msg(conn, msg);
 
@@ -383,7 +383,7 @@
/*
 * Check if the connection should be moved...
 */
-   llist_for_each_entry(msc, &conn->bts->network->bsc_data->mscs, entry) {
+   llist_for_each_entry(msc, &conn_get_bts(conn)->network->bsc_data->mscs, 
entry) {
if (msc->type != MSC_CON_TYPE_LOCAL)
continue;
if (!msc->local_pref)
@@ -435,7 +435,7 @@
struct msgb *resp;
return_when_not_connected(conn);
 
-   if (is_ipaccess_bts(conn->bts) && conn->sccp_con->user_plane.rtp_ip) {
+   if (is_ipaccess_bts(conn_get_bts(conn)) && 
conn->sccp_con->user

[PATCH] osmo-bsc[master]: gsm_data.h: Document all fields of gsm_subscriber_connection

2017-12-19 Thread Harald Welte

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

gsm_data.h: Document all fields of gsm_subscriber_connection

Change-Id: I429fe7817f075d0794645d37f5ea11b104102ba0
---
M include/osmocom/bsc/gsm_data.h
1 file changed, 14 insertions(+), 8 deletions(-)


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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1cedef0..2e97055 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -75,20 +75,26 @@
/* libbsc subscriber information (if available) */
struct bsc_subscr *bsub;
 
-   /* bsc structures */
-   struct osmo_bsc_sccp_con *sccp_con; /* BSC */
+   /* SCCP connection associatd with this subscriber_connection */
+   struct osmo_bsc_sccp_con *sccp_con;
 
/* back pointers */
struct gsm_network *network;
 
-   struct gsm_lchan *lchan; /* BSC */
-   struct gsm_lchan *ho_lchan; /* BSC */
-   struct gsm_bts *bts; /* BSC */
+   /* the primary / currently active lchan to the BTS/subscriber */
+   struct gsm_lchan *lchan;
+   /* the future/allocated but not yet used lchan during HANDOVER */
+   struct gsm_lchan *ho_lchan;
+   /* a short-hand pointer to the BTS currently serving the subscriber,
+* points to gsm_subscriber_connection.lchan->ts->trx->bts */
+   struct gsm_bts *bts;
 
-   /* for assignment handling */
-   struct osmo_timer_list T10; /* BSC */
-   struct gsm_lchan *secondary_lchan; /* BSC */
+   /* timer for assignment handling */
+   struct osmo_timer_list T10;
+   /* the future allocated but not yet used lchan during ASSIGNMENT */
+   struct gsm_lchan *secondary_lchan;
 
+   /* buffer/cache for classmark of the ME of the subscriber */
struct gsm_classmark classmark;
 
uint16_t lac;

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

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


[PATCH] osmo-bsc[master]: bsc_test.c: Use proper network/bts/lchan structures

2017-12-19 Thread Harald Welte

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

bsc_test.c: Use proper network/bts/lchan structures

don't mock them, simply call the respective functions to get
a gsm_network and a gsm_bts with all its subordinate members.

Change-Id: I8bdf009d3c7e2473dd42da02762039a19430d6ce
---
M tests/bsc/bsc_test.c
1 file changed, 4 insertions(+), 5 deletions(-)


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

diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 1d7baa1..420ef73 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -121,22 +122,20 @@
 {
int i;
 
-   struct gsm_network *net;
-   struct gsm_bts *bts;
+   struct gsm_network *net = bsc_network_init(NULL, 1, 1);
+   struct gsm_bts *bts = gsm_bts_alloc(net, 0);
struct osmo_bsc_sccp_con *sccp_con;
struct bsc_msc_data *msc;
struct gsm_subscriber_connection *conn;
 
-   net = talloc_zero(NULL, struct gsm_network);
-   bts = talloc_zero(net, struct gsm_bts);
sccp_con = talloc_zero(net, struct osmo_bsc_sccp_con);
msc = talloc_zero(net, struct bsc_msc_data);
conn = talloc_zero(net, struct gsm_subscriber_connection);
 
bts->network = net;
sccp_con->msc = msc;
-   conn->bts = bts;
conn->sccp_con = sccp_con;
+   conn->lchan = &bts->c0->ts[1].lchan[0];
 
/* start testing with proper messages */
printf("Testing BTS<->MSC message scan.\n");

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

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


[PATCH] osmo-bsc[master]: remove libosmo-sccp dependency for osmo-bsc

2017-12-19 Thread Harald Welte

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

remove libosmo-sccp dependency for osmo-bsc

libosmo-sccp is the old sccp-lite-focused SCCP implementation that we
used before libosmo-sigtran was created.  The new osmo-bsc in this
repository is using libosmo-sigtran and shouldn't be using parts of
libosmo-sccp anymore.

We only keep it around in configure.ac and Makefile.am for osmo-bsc_nat,
which is not even built in this repository anymore (or 'again yet'?)

Change-Id: I8f274be7d196cd7a5b1ec9ada949130fb06e984d
---
M include/osmocom/bsc/osmo_bsc.h
M src/libfilter/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/osmo_bsc_msc.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/osmo_bsc_vty.c
M tests/bsc/Makefile.am
9 files changed, 6 insertions(+), 25 deletions(-)


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

diff --git a/include/osmocom/bsc/osmo_bsc.h b/include/osmocom/bsc/osmo_bsc.h
index 8a5cd30..0fd29b7 100644
--- a/include/osmocom/bsc/osmo_bsc.h
+++ b/include/osmocom/bsc/osmo_bsc.h
@@ -15,7 +15,6 @@
BSC_CON_NO_MEM,
 };
 
-struct sccp_connection;
 struct bsc_msc_data;
 struct bsc_msc_connection;
 
@@ -47,10 +46,7 @@
int send_ping;
 
/* SCCP connection realted */
-   struct sccp_connection *sccp;
struct bsc_msc_data *msc;
-   struct osmo_timer_list sccp_it_timeout;
-   struct osmo_timer_list sccp_cc_timeout;
 
struct llist_head sccp_queue;
unsigned int sccp_queue_size;
diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am
index 6d3db0b..41a75bd 100644
--- a/src/libfilter/Makefile.am
+++ b/src/libfilter/Makefile.am
@@ -10,7 +10,6 @@
$(LIBOSMOGSM_CFLAGS) \
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(NULL)
 
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 4acbe56..7978852 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -11,7 +11,6 @@
$(LIBOSMOVTY_CFLAGS) \
$(LIBOSMOCTRL_CFLAGS) \
$(LIBOSMONETIF_CFLAGS) \
-   $(LIBOSMOSCCP_CFLAGS) \
$(COVERAGE_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOSIGTRAN_CFLAGS) \
@@ -45,7 +44,6 @@
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(top_builddir)/src/libcommon/libcommon.a \
-   $(LIBOSMOSCCP_LIBS) \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index c388f5b..152b818 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -29,7 +29,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #define return_when_not_connected(conn) \
@@ -296,13 +295,11 @@
resp = gsm0808_create_layer3(msg, network_code, country_code, lac, ci);
if (!resp) {
LOGP(DMSC, LOGL_DEBUG, "Failed to create layer3 message.\n");
-   sccp_connection_free(conn->sccp_con->sccp);
osmo_bsc_sigtran_del_conn(conn->sccp_con);
return BSC_API_CONN_POL_REJECT;
}
 
if (osmo_bsc_sigtran_open_conn(conn->sccp_con, resp) != 0) {
-   sccp_connection_free(conn->sccp_con->sccp);
osmo_bsc_sigtran_del_conn(conn->sccp_con);
msgb_free(resp);
return BSC_API_CONN_POL_REJECT;
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 829f207..e4c8fc5 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -43,7 +43,6 @@
 
 #include 
 
-#include 
 #include 
 
 #define _GNU_SOURCE
@@ -233,9 +232,6 @@
 
/* seed the PRNG */
srand(time(NULL));
-
-   /* initialize SCCP */
-   sccp_set_log_area(DSCCP);
 
/* Read the config */
rc = bsc_network_configure(config_file);
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 0e5777e..46be2e6 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -34,8 +34,6 @@
 
 #include 
 
-#include 
-
 #include 
 
 #include 
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index a18d4f3..7669b67 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -511,7 +510,8 @@
 
/* If unset, use default local SCCP address */
if (!msc->a.bsc_addr.presence)
-   osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, 
msc->a.sccp, SCCP_SSN_BSSAP);
+   osmo_sccp_local_addr_by_instance(&msc->a.bsc_addr, 
msc->a.sccp,
+OSMO_SCCP_SSN_BSSAP);
 
if (!osmo_sccp_check_addr(&msc->a.bsc_addr, 
OSMO_SCCP_ADDR_T_SSN

[PATCH] osmo-bsc[master]: osmo_bsc_bssap.c: Spelling fixes in comment

2017-12-19 Thread Harald Welte

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

osmo_bsc_bssap.c: Spelling fixes in comment

Change-Id: I32b2d08bf25cd2d343755ac8491e4f5f758ccee6
---
M src/osmo-bsc/osmo_bsc_bssap.c
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 4fd43aa..aea3994 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -385,7 +385,7 @@
  * a cipher we will have to send cipher mode reject to the MSC,
  * otherwise we will have to pick something that we and the MS
  * is supporting. Currently we are doing it in a rather static
- * way by picking one ecnryption or no encrytpion.
+ * way by picking one encryption or no encryption.
  */
 static int bssmap_handle_cipher_mode(struct osmo_bsc_sccp_con *conn,
 struct msgb *msg, unsigned int 
payload_length)
@@ -613,7 +613,7 @@
   get_value_string(gsm48_chan_mode_names, chan_mode),
   ct.ch_indctr, ct.ch_rate_type, osmo_hexdump(ct.perm_spch, 
ct.perm_spch_len));
 
-   /* Forward the assingment request to lower layers */
+   /* Forward the assignment request to lower layers */
if (aoip) {
/* Store network side RTP connection information, we will
 * process this address later after we have established an RTP
@@ -626,7 +626,7 @@
/* Create an assignment request using the MGCP fsm. This FSM
 * is directly started when its created (now) and will also
 * take care about the further processing (creating RTP
-* endpoints, calling gsm0808_assign_req(), rsponding to
+* endpoints, calling gsm0808_assign_req(), responding to
 * the assignment request etc... */
conn->mgcp_ctx = mgcp_assignm_req(msc->network, 
msc->network->mgw.client, conn, chan_mode, full_rate);
if (!conn->mgcp_ctx) {

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

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


[PATCH] osmo-bsc[master]: Remove unneeded .py scripts

2017-12-19 Thread Max

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

Remove unneeded .py scripts

The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for
vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py
are not BSC-specific: leftovers from repository split which are now
available in osmo-python-tests as well.

Change-Id: Ia4285b18b152b070c148228604d1e61a8adedba1
---
M Makefile.am
M configure.ac
D contrib/Makefile.am
D contrib/bsc_control.py
D contrib/ipa.py
D contrib/soap.py
D contrib/twisted_ipa.py
M tests/ctrl_test_runner.py
M tests/vty_test_runner.py
9 files changed, 2 insertions(+), 983 deletions(-)


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

diff --git a/Makefile.am b/Makefile.am
index 690deae..2f0a786 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@
include \
src \
tests \
-   contrib \
$(NULL)
 
 BUILT_SOURCES = $(top_srcdir)/.version
diff --git a/configure.ac b/configure.ac
index b7dd016..bdcf026 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,5 +167,4 @@
 tests/bssap/Makefile
 doc/Makefile
 doc/examples/Makefile
-contrib/Makefile
 Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
deleted file mode 100644
index db6d0f5..000
--- a/contrib/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = ipa.py
diff --git a/contrib/bsc_control.py b/contrib/bsc_control.py
deleted file mode 100755
index c1b09ce..000
--- a/contrib/bsc_control.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/python
-# -*- mode: python-mode; py-indent-tabs-mode: nil -*-
-"""
-/*
- * Copyright (C) 2016 sysmocom s.f.m.c. GmbH
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-"""
-
-from optparse import OptionParser
-from ipa import Ctrl
-import socket
-
-verbose = False
-
-def connect(host, port):
-if verbose:
-print "Connecting to host %s:%i" % (host, port)
-
-sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-sck.setblocking(1)
-sck.connect((host, port))
-return sck
-
-def do_set_get(sck, var, value = None):
-(r, c) = Ctrl().cmd(var, value)
-sck.send(c)
-answer = Ctrl().rem_header(sck.recv(4096))
-return (answer,) + Ctrl().verify(answer, r, var, value)
-
-def set_var(sck, var, val):
-(a, _, _) = do_set_get(sck, var, val)
-return a
-
-def get_var(sck, var):
-(_, _, v) = do_set_get(sck, var)
-return v
-
-def _leftovers(sck, fl):
-"""
-Read outstanding data if any according to flags
-"""
-try:
-data = sck.recv(1024, fl)
-except socket.error as (s_errno, strerror):
-return False
-if len(data) != 0:
-tail = data
-while True:
-(head, tail) = Ctrl().split_combined(tail)
-print "Got message:", Ctrl().rem_header(head)
-if len(tail) == 0:
-break
-return True
-return False
-
-if __name__ == '__main__':
-parser = OptionParser("Usage: %prog [options] var [value]")
-parser.add_option("-d", "--host", dest="host",
-  help="connect to HOST", metavar="HOST")
-parser.add_option("-p", "--port", dest="port", type="int",
-  help="use PORT", metavar="PORT", default=4249)
-parser.add_option("-g", "--get", action="store_true",
-  dest="cmd_get", help="perform GET operation")
-parser.add_option("-s", "--set", action="store_true",
-  dest="cmd_set", help="perform SET operation")
-parser.add_option("-v", "--verbose", action="store_true",
-  dest="verbose", help="be verbose", default=False)
-parser.add_option("-m", "--monitor", action="store_true",
-  dest="monitor", help="monitor the connection for 
traps", default=False)
-
-(options, args) = parser.parse_args()
-
-verbose = options.verbose
-
-if options.cmd_set and options.cmd_get:
-parser.error("Get and set options are mutually exclusive!")
-
-if not (options.cmd

[PATCH] osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams

2017-12-19 Thread dexter
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/4980

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

mgcp: use osmo-mgw to switch rtp streams

in the current implementation we still use osmo-bsc_mgcp, which
has many problems and is also obsoleted by osmo-mgw.

integrate osmo-mgw and re-implement the current switching using
an osmo fsm.

Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c
Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062
Closes: OS#2605
Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538
---
M include/osmocom/msc/Makefile.am
M include/osmocom/msc/gsm_data.h
M include/osmocom/msc/iucs.h
M include/osmocom/msc/msc_ifaces.h
A include/osmocom/msc/msc_mgcp.h
M src/libmsc/Makefile.am
M src/libmsc/a_iface.c
M src/libmsc/a_iface_bssap.c
M src/libmsc/gsm_04_08.c
M src/libmsc/iucs.c
M src/libmsc/iucs_ranap.c
M src/libmsc/msc_ifaces.c
A src/libmsc/msc_mgcp.c
M tests/msc_vlr/Makefile.am
M tests/msc_vlr/msc_vlr_tests.c
15 files changed, 1,317 insertions(+), 325 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/4980/14

diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am
index 1419e8e..052d830 100644
--- a/include/osmocom/msc/Makefile.am
+++ b/include/osmocom/msc/Makefile.am
@@ -39,6 +39,7 @@
mncc.h \
mncc_int.h \
msc_ifaces.h \
+   msc_mgcp.h \
network_listen.h \
oap_client.h \
openbscdefines.h \
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 696cef1..9106421 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -196,9 +196,17 @@
struct gsm_encr encr;
 
struct {
+   struct mgcp_ctx *mgcp_ctx;
unsigned int mgcp_rtp_endpoint;
-   uint16_t port_subscr;
-   uint16_t port_cn;
+
+   uint16_t local_port_ran;
+   char local_addr_ran[INET_ADDRSTRLEN];
+   uint16_t remote_port_ran;
+   char remote_addr_ran[INET_ADDRSTRLEN];
+   uint16_t local_port_cn;
+   char local_addr_cn[INET_ADDRSTRLEN];
+   uint16_t remote_port_cn;
+   char remote_addr_cn[INET_ADDRSTRLEN];
} rtp;
 
/* which Iu-CS connection, if any. */
diff --git a/include/osmocom/msc/iucs.h b/include/osmocom/msc/iucs.h
index b7d6064..a48a316 100644
--- a/include/osmocom/msc/iucs.h
+++ b/include/osmocom/msc/iucs.h
@@ -1,7 +1,10 @@
 #pragma once
 
+#include 
+
 int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg,
uint16_t *lac);
 
 struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network 
*network,
struct 
ranap_ue_conn_ctx *ue);
+int iu_rab_act_cs(struct gsm_trans *trans);
diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h
index 0592c07..ca25e9d 100644
--- a/include/osmocom/msc/msc_ifaces.h
+++ b/include/osmocom/msc/msc_ifaces.h
@@ -37,7 +37,3 @@
 enum gsm48_reject_value value);
 
 int msc_tx_common_id(struct gsm_subscriber_connection *conn);
-int msc_call_assignment(struct gsm_trans *trans);
-int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2);
-void msc_call_release(struct gsm_trans *trans);
-int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip);
diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h
new file mode 100644
index 000..2fd44ef
--- /dev/null
+++ b/include/osmocom/msc/msc_mgcp.h
@@ -0,0 +1,56 @@
+/* (C) 2017 by sysmocom - s.f.m.c. GmbH 
+ * All Rights Reserved
+ *
+ * Author: Philipp Maier
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+
+/* MGCP state handler context. This context information stores all information
+ * to handle the direction of the RTP streams via MGCP. There is one instance
+ * of this context struct per subscriber connection.
+ * (see also struct gsm_subscriber_connection) */
+struct mgcp_ctx {
+   /* FSM instance, which handles the connection switching procedure */
+   struct osmo_fsm_inst *fsm;
+
+   /* RTP endpoint number. This number number identifies the endpoint
+   

[PATCH] osmo-iuh[master]: iu: iu_helpers: add functions to decode ip/port from rab-ass

2017-12-19 Thread dexter

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

iu: iu_helpers: add functions to decode ip/port from rab-ass

add ranap_transp_assoc_decode() to decode the port information from
an  RANAP_IuTransportAssociation_t field.

add ranap_transp_layer_addr_decode() to decode the ip-address from
an RANAP_TransportLayerAddress_t field.

Change-Id: I3c1a0455c5f25cae41ee19229d6daf299e023062
---
M include/osmocom/ranap/iu_helpers.h
M src/iu_helpers.c
2 files changed, 52 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/98/5498/1

diff --git a/include/osmocom/ranap/iu_helpers.h 
b/include/osmocom/ranap/iu_helpers.h
index 109b6da..56791b8 100644
--- a/include/osmocom/ranap/iu_helpers.h
+++ b/include/osmocom/ranap/iu_helpers.h
@@ -3,5 +3,10 @@
 #include 
 #include 
 
+#include 
+#include 
+
 int ranap_bcd_decode(char *out, size_t out_len, const uint8_t *in, size_t 
in_len);
 int ranap_imsi_encode(uint8_t *out, size_t out_len, const char *in);
+int ranap_transp_assoc_decode(uint16_t *port, RANAP_IuTransportAssociation_t 
*transp_assoc);
+int ranap_transp_layer_addr_decode(char *addr, unsigned int addr_len, 
RANAP_TransportLayerAddress_t *trasp_layer_addr);
diff --git a/src/iu_helpers.c b/src/iu_helpers.c
index 2f44e93..f038da2 100644
--- a/src/iu_helpers.c
+++ b/src/iu_helpers.c
@@ -20,8 +20,11 @@
 
 #include 
 #include 
-
+#include 
+#include "asn1helpers.h"
 #include 
+#include 
+#include 
 
 /* decode a BCD-string as used inside ASN.1 encoded Iu interface protocols */
 int ranap_bcd_decode(char *out, size_t out_len, const uint8_t *in, size_t 
in_len)
@@ -70,3 +73,46 @@
}
return i;
 }
+
+/* decode a network port as used inside ASN.1 encoded Iu interface protocols */
+int ranap_transp_assoc_decode(uint16_t *port, RANAP_IuTransportAssociation_t * 
transp_assoc)
+{
+   uint32_t result;
+
+   if (!transp_assoc)
+   return -EINVAL;
+
+   result = asn1bitstr_to_u32((BIT_STRING_t *) & 
transp_assoc->choice.bindingID);
+
+   /* The lower 16 bits should be zero, otherwise the decoding may
+* have yielded some odd result */
+   if (result & 0x)
+   return -EINVAL;
+
+   *port = (uint16_t) ((result >> 16) & 0x);
+
+   if (*port == 0)
+   return -EINVAL;
+
+   return 0;
+}
+
+/* decode a network address as used inside ASN.1 encoded Iu interface 
protocols */
+int ranap_transp_layer_addr_decode(char *addr, unsigned int addr_len, 
RANAP_TransportLayerAddress_t * trasp_layer_addr)
+{
+   unsigned char *buf;
+   int len;
+
+   buf = trasp_layer_addr->buf;
+   len = trasp_layer_addr->size;
+
+   if (addr_len > INET_ADDRSTRLEN)
+   return -EINVAL;
+
+   if (buf[0] == 0x35 && len > 7)
+   snprintf(addr, addr_len, "%u.%u.%u.%u", buf[3], buf[4], buf[5], 
buf[6]);
+   else if (len > 3)
+   snprintf(addr, addr_len, "%u.%u.%u.%u", buf[0], buf[1], buf[2], 
buf[3]);
+
+   return 0;
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c1a0455c5f25cae41ee19229d6daf299e023062
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-iuh[master]: ranap_msg_factory: check IE encoder return codes

2017-12-19 Thread dexter

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

ranap_msg_factory: check IE encoder return codes

in many functions, the returncode (rc) from the IE encoder functions
is not checked.

Add a return code check and log error message (like it is already
done in the functions which already check the return code)

Change-Id: I592c0794a94c50fde5c574b1e9bc581eb28af4ae
---
M src/ranap_msg_factory.c
1 file changed, 35 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/99/5499/1

diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c
index fe7e325..9611794 100644
--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -185,6 +185,10 @@
 
/* ies -> dt */
rc = ranap_encode_directtransferies(&dt, &ies);
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding direct transfer IEs: 
%d\n", rc);
+   return NULL;
+   }
 
/* dt -> msg */
msg = 
ranap_generate_initiating_message(RANAP_ProcedureCode_id_DirectTransfer,
@@ -245,6 +249,10 @@
 
/* ies -> out */
rc = ranap_encode_securitymodecommandies(&out, &ies);
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding security mode command 
IEs: %d\n", rc);
+   return NULL;
+   }
 
/* release dynamic allocations attached to ies */

ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_IntegrityProtectionInformation, 
&ies.integrityProtectionInformation);
@@ -282,6 +290,10 @@
 
/* ies -> out */
rc = ranap_encode_securitymodecompleteies(&out, &ies);
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding security mode complete 
IEs: %d\n", rc);
+   return NULL;
+   }
 
/* out -> msg */
msg = 
ranap_generate_successful_outcome(RANAP_ProcedureCode_id_SecurityModeControl,
@@ -317,6 +329,11 @@
 
/* ies -> out */
rc = ranap_encode_commonid_ies(&out, &ies);
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding common id IEs: %d\n", 
rc);
+   return NULL;
+   }
+
/* release dynamic allocations attached to ies */
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_PermanentNAS_UE_ID, 
&ies.permanentNAS_UE_ID);
if (rc < 0)
@@ -349,8 +366,10 @@
 
/* ies -> out */
rc = ranap_encode_iu_releasecommandies(&out, &ies);
-   if (rc < 0)
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding release command IEs: 
%d\n", rc);
return NULL;
+   }
 
/* out -> msg */
msg = 
ranap_generate_initiating_message(RANAP_ProcedureCode_id_Iu_Release,
@@ -377,8 +396,10 @@
 
/* ies -> out */
rc = ranap_encode_iu_releasecompleteies(&out, &ies);
-   if (rc < 0)
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding release complete IEs: 
%d\n", rc);
return NULL;
+   }
 
/* out -> msg */
msg = 
ranap_generate_successful_outcome(RANAP_ProcedureCode_id_Iu_Release,
@@ -434,6 +455,11 @@
 
/* ies -> out */
rc = ranap_encode_pagingies(&out, &ies);
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding paging IEs: %d\n", rc);
+   return NULL;
+   }
+
/* release dynamic allocation attached to ies */
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_PermanentNAS_UE_ID, 
&ies.permanentNAS_UE_ID);
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_TemporaryUE_ID, 
&ies.temporaryUE_ID);
@@ -879,8 +905,10 @@
memcpy(&ies.cause, cause, sizeof(ies.cause));
 
rc = ranap_encode_iu_releaserequesties(&out, &ies);
-   if (rc < 0)
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding release request IEs: 
%d\n", rc);
return NULL;
+   }
 
/* encode the output into the msgb */
msg = 
ranap_generate_initiating_message(RANAP_ProcedureCode_id_Iu_ReleaseRequest,
@@ -915,8 +943,11 @@
 
/* encoe the list IEs into the output */
rc = ranap_encode_rab_releaserequesties(&out, &ies);
-   if (rc < 0)
+   if (rc < 0) {
+   LOGP(DRANAP, LOGL_ERROR, "error encoding release request IEs: 
%d\n", rc);
return NULL;
+   }
+
/* 'out' has been generated, we can release the input */
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_RANAP_RAB_ReleaseList, 
&ies.raB_ReleaseList);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I592c0794a94c50fde5c574b1e9bc581eb28af4ae
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-iuh[master]: ranap_msg_factory: remove unusued variable

2017-12-19 Thread dexter

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

ranap_msg_factory: remove unusued variable

remove variable i in ranap_new_msg_sec_mod_compl() as it is not
used (compiler warning)

Change-Id: I93d9e95109fb78bc6cc161745b9e14de8b623d4f
---
M src/ranap_msg_factory.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/00/5500/1

diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c
index 9611794..0de4ea1 100644
--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -279,7 +279,7 @@
RANAP_SecurityModeCompleteIEs_t ies;
RANAP_SecurityModeComplete_t out;
struct msgb *msg;
-   int i, rc;
+   int rc;
 
memset(&ies, 0, sizeof(ies));
memset(&out, 0, sizeof(out));

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93d9e95109fb78bc6cc161745b9e14de8b623d4f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: dexter 


python/osmo-python-tests[master]: README: mention twisted_ipa.py in scripts section, not as lib

2017-12-19 Thread Max

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie536d61c5af89a530533b22d8ecab1c804a38289
Gerrit-PatchSet: 1
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


python/osmo-python-tests[master]: scripts: add symlink to osmopy

2017-12-19 Thread Max

Patch Set 1: Code-Review+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I880c8afa8d02ef112a80cb54f649ec71902bbd4c
Gerrit-PatchSet: 1
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[PATCH] python/osmo-python-tests[master]: Ignore compilation byproducts

2017-12-19 Thread Max
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/5483

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

Ignore compilation byproducts

Change-Id: Ic04a1b9411b851547ef7ce7a9b562cb290081ca9
---
M .gitignore
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests 
refs/changes/83/5483/3

diff --git a/.gitignore b/.gitignore
index 766f495..095d598 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
 osmopython.egg-info/
+*.pyc
+build/
+dist/

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic04a1b9411b851547ef7ce7a9b562cb290081ca9
Gerrit-PatchSet: 3
Gerrit-Project: python/osmo-python-tests
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


  1   2   >