osmocom-bb[jolly/testing]: transceiver: Fix RSP SETSLOT format

2018-02-14 Thread Pau Espin Pedrol

Patch Set 1:

> Would it make sense to try to port this to master?

No idea, but probably unrelated to the fix/patch. If the answer is yes, then 
somebody can create an issue in redmine about it.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I63c81155c84fc35cff1704734fd8d2732235c5a4
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: jolly/testing
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: roox 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: Add tests for OS#2714, "close RSL connections from unknown U...

2018-02-14 Thread Stefan Sperling

Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/6406/3/bsc/BSC_Tests.ttcn
File bsc/BSC_Tests.ttcn:

Line 1244: testcase TC_rsl_unknown_unit_id() runs on test_CT {
> I think it makes sense t owrap those two into one function and call that fu
Yes, I was just being lazy and copy/pasted :)

Fixed in next patch set.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6a947d7411a016e4d7650031396cae3575756453
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: Yes


[PATCH] libosmocore[master]: fsm: allow graceful exit on FSM termination

2018-02-14 Thread dexter

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

fsm: allow graceful exit on FSM termination

The function _osmo_fsm_inst_term() terminates all child FSMs befor
it calls fi->fsm_cleanup(). This prevents the cleanup callback to
perform last actions on the child FSMs (e.g.
osmo_fsm_inst_unlink_parent()).

- Since moving the cleanup callack to the beginning of the function
  would alter the termination behavior and possibly cause malfunction
  in already existing implementation that use OSMO fsm, a new
  optional callback that is called immediately at the beginning of
  the terminatopn process is added.

Change-Id: I0fdda9fe994753f975a658c0f3fb3615949cc8bb
Closes: OS#2915
---
M TODO-RELEASE
M include/osmocom/core/fsm.h
M src/fsm.c
3 files changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/6452/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index 782ba19..928b18d 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -10,3 +10,4 @@
 core   msgb_queue_free()   add inline func to msgb.h
 coding gsm0503_rach_ext-encode()   add func to gsm0503_coding.h
 codec  ecu.c / ecu.h   implement ECU for FR (Error 
Concealment Unit)
+fsmfsmc / fsm.hadded callback for graceful 
exit => ABI changed
\ No newline at end of file
diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
index 8f550d1..1b4dcee 100644
--- a/include/osmocom/core/fsm.h
+++ b/include/osmocom/core/fsm.h
@@ -69,6 +69,8 @@
uint32_t allstate_event_mask;
/*! function pointer to be called for allstate events */
void (*allstate_action)(struct osmo_fsm_inst *fi, uint32_t event, void 
*data);
+   /*! graceful exit function, called at the beginning of termination */
+   void (*grace)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause);
/*! clean-up function, called during termination */
void (*cleanup)(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause 
cause);
/*! timer call-back for states with time-out.
diff --git a/src/fsm.c b/src/fsm.c
index d8751c9..859f7a9 100644
--- a/src/fsm.c
+++ b/src/fsm.c
@@ -279,7 +279,11 @@
 
 /*! unlink child FSM from its parent FSM.
  *  \param[in] fi Descriptor of the child FSM to unlink.
- *  \param[in] ctx New talloc context */
+ *  \param[in] ctx New talloc context
+ *
+ * Never call this function from the cleanup callback, because at that time
+ * the child FSMs will already be terminated. If unlinking should be performed
+ * on FSM termination, use the grace callback instead. */
 void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx)
 {
if (fi->proc.parent) {
@@ -293,7 +297,10 @@
 /*! change parent instance of an FSM.
  *  \param[in] fi Descriptor of the to-be-allocated FSM.
  *  \param[in] new_parent New parent FSM instance.
- *  \param[in] new_parent_term_event Event to be sent to parent when 
terminating. */
+ *  \param[in] new_parent_term_event Event to be sent to parent when 
terminating.
+ *
+ * Never call this function from the cleanup callback!
+ * (see also osmo_fsm_inst_unlink_parent()).*/
 void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi,
 struct osmo_fsm_inst *new_parent,
 uint32_t new_parent_term_event)
@@ -509,6 +516,10 @@
LOGPFSMSRC(fi, file, line, "Terminating (cause = %s)\n",
   osmo_fsm_term_cause_name(cause));
 
+   /* graceful exit (optional) */
+   if (fi->fsm->grace)
+   fi->fsm->grace(fi, cause);
+
_osmo_fsm_inst_term_children(fi, OSMO_FSM_TERM_PARENT, NULL,
 file, line);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0fdda9fe994753f975a658c0f3fb3615949cc8bb
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter 


libosmocore[master]: fsm: allow graceful exit on FSM termination

2018-02-14 Thread Harald Welte

Patch Set 1:

I think we can introduce this.  However, I'm not happy with the naming.  First, 
"grace" is different from "grace period" or "graceful" (think of "holy grace", 
...).  Second, I think it's not very indicative/explanatory of what is actually 
happening.  Withouht thinking too much about it, I think "pre_term" or even 
"term" might be a beter name.  After all, it's called from 
"osmo_fsm_inst_term". So first we call the termination code, then we terminate 
children and finally we cleanup, just before the free.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0fdda9fe994753f975a658c0f3fb3615949cc8bb
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-msc[master]: libmsc: bssap: Fix compilation warning

2018-02-14 Thread Harald Welte

Patch Set 4: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/5424/4/src/libmsc/a_iface_bssap.c
File src/libmsc/a_iface_bssap.c:

Line 313:   memcpy(msg->l3h, TLVP_VAL(tp, GSM0808_IE_LAYER_3_INFORMATION), 
msgb_l3len(msg));
I still don't get why we would want to copy the payload here.  The point of all 
of this is exactly *not* to copy the message, but simply strip anything 
before/after the Layer3 information IE, and then pass it on.  What am I missing?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8
Gerrit-PatchSet: 4
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: Yes


osmo-msc[master]: libmsc: bssap: Refactor rx paths to to avoid parse_tlv code ...

2018-02-14 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6aef9a94fa5b2e0b62a9c1744b8e18e5985f788f
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-msc[master]: libmsc: bssap: Catch TLV parse failures

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1d1951f4a5daf200e85c76fea14a35e952491d27
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmo-msc[master]: libmsc: bssap: Fix typo in log message

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I941cd7f4e9eec3e4f2786100a0e64770d5aee4a7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-msc[master]: libmsc: bssap: Fix typo in log message

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libmsc: bssap: Fix typo in log message
..


libmsc: bssap: Fix typo in log message

Change-Id: I941cd7f4e9eec3e4f2786100a0e64770d5aee4a7
---
M src/libmsc/a_iface_bssap.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index 0946a5d..ea1b926 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -245,7 +245,7 @@
 {
int rc;
 
-   LOGP(DMSC, LOGL_INFO, "Rx BSSMAP CLEAR COMPPLETE, releasing SCCP 
connection\n");
+   LOGP(DMSC, LOGL_INFO, "Rx BSSMAP CLEAR COMPLETE, releasing SCCP 
connection\n");
rc = osmo_sccp_tx_disconn(scu, a_conn_info->conn_id,
  NULL, SCCP_RELEASE_CAUSE_END_USER_ORIGINATED);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I941cd7f4e9eec3e4f2786100a0e64770d5aee4a7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmocom-bb[jolly/testing]: transceiver: Fix RSP SETSLOT format

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I63c81155c84fc35cff1704734fd8d2732235c5a4
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: jolly/testing
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: roox 
Gerrit-HasComments: No


osmo-bsc[master]: libcommon: eliminate common_vty.c

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I22ebb76742e9c5ab9dd608ac089a5c558aceeb36
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bsc[master]: libcommon: eliminate bsc_version.c

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7f48924f484e4e4b98be4ca8bee253e6ea9c0576
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bsc[master]: libcommon: eliminate debug.c

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: libcommon: eliminate socket.c

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: libcommon: eliminate talloc_ctx.c

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I344a3d07e146999e154824837ed95db2b9879356
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bsc[master]: ipaccess-proxy: don't redefine tall_bsc_ctx

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9c9c8540419876696e65a690717144d497d60fb2
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bsc[master]: libcommon: join gsm_data_shared.* into gsm_data.*

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: drop libcommon completely, move remaining files to libbsc

2018-02-14 Thread Harald Welte

Patch Set 5: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


osmo-bsc[master]: libcommon-cs: move a_reset.c into libbsc

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: libcommon-cs: move gsm_network_init() into bsc_network_init()

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: gsm_network: drop unused trans_list

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: libcommon_cs: move gsm48 bits to libbsc

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: gsm_network: drop unused subscr_epxire_timer

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: libcommon-cs: move vty bits to libbsc/bsc_vty.c

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: common_cs.h: mv gsm_encr to gsm_data.h

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: drop libcommon-cs completely

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


osmo-bsc[master]: drop unused common.h

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


[MERGED] osmo-bsc[master]: libcommon: eliminate talloc_ctx.c

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libcommon: eliminate talloc_ctx.c
..


libcommon: eliminate talloc_ctx.c

Interestingly enough, talloc_ctx_init() actually had not a single caller.

While dropping it, see to it that the few contexts that are actually used in
osmo-bsc.git are indeed initialized in all the main scopes.

Also initialize two void* ctxts as NULL explicitly, to allocate under the NULL
context in case some main scope forgets to branch it off another root context.
(That's bsc, fle and paging, all others actually come in from other libraries.)

Change-Id: I344a3d07e146999e154824837ed95db2b9879356
---
M src/ipaccess/ipaccess-proxy.c
M src/libbsc/abis_nm.c
M src/libbsc/paging.c
M src/libcommon/Makefile.am
M src/libcommon/gsm_data.c
D src/libcommon/talloc_ctx.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/bsc_nat.c
M src/utils/bs11_config.c
9 files changed, 24 insertions(+), 56 deletions(-)

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



diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index 5cf6d6d..d44cdf2 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -121,7 +121,7 @@
 };
 
 /* some of the code against we link from OpenBSC needs this */
-void *tall_bsc_ctx;
+void *tall_bsc_ctx = NULL;
 
 static char *listen_ipaddr;
 static char *bsc_ipaddr;
diff --git a/src/libbsc/abis_nm.c b/src/libbsc/abis_nm.c
index 403b94c..671c874 100644
--- a/src/libbsc/abis_nm.c
+++ b/src/libbsc/abis_nm.c
@@ -2374,7 +2374,7 @@
 
 /* BS11 SWL */
 
-void *tall_fle_ctx;
+void *tall_fle_ctx = NULL;
 
 struct abis_nm_bs11_sw {
struct gsm_bts *bts;
diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index be272f5..825d31e 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -51,7 +51,7 @@
 #include 
 #include 
 
-void *tall_paging_ctx;
+void *tall_paging_ctx = NULL;
 
 #define PAGING_TIMER 0, 50
 
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index a6ef44e..3518a55 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -22,6 +22,5 @@
 libcommon_a_SOURCES = \
gsm_data.c \
gsm_data_shared.c \
-   talloc_ctx.c \
handover_cfg.c \
$(NULL)
diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c
index 92ebbfe..3b63ad0 100644
--- a/src/libcommon/gsm_data.c
+++ b/src/libcommon/gsm_data.c
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-void *tall_bsc_ctx;
+void *tall_bsc_ctx = NULL;
 
 static LLIST_HEAD(bts_models);
 
diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c
deleted file mode 100644
index 9f64d75..000
--- a/src/libcommon/talloc_ctx.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* OpenBSC allocation contexts initialization code */
-/* (C) 2011-2016 by 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 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 .
- *
- */
-
-#include 
-#include 
-
-extern void *tall_bsc_ctx;
-extern void *tall_fle_ctx;
-extern void *tall_locop_ctx;
-extern void *tall_authciphop_ctx;
-extern void *tall_gsms_ctx;
-extern void *tall_subscr_ctx;
-extern void *tall_sub_req_ctx;
-extern void *tall_call_ctx;
-extern void *tall_paging_ctx;
-extern void *tall_sigh_ctx;
-extern void *tall_tqe_ctx;
-extern void *tall_trans_ctx;
-extern void *tall_ctr_ctx;
-
-void talloc_ctx_init(void *ctx_root)
-{
-   msgb_talloc_ctx_init(ctx_root, 0);
-   tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry");
-   tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper");
-   tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper");
-   tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms");
-   tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber");
-   tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call");
-   tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request");
-   tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler");
-   tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry");
-   tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction");
-   tall_ctr_ctx = talloc_named_const(ctx_

[MERGED] osmo-bsc[master]: ipaccess-proxy: don't redefine tall_bsc_ctx

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ipaccess-proxy: don't redefine tall_bsc_ctx
..


ipaccess-proxy: don't redefine tall_bsc_ctx

Curiously, ipaccess-proxy.c is able to define its own tall_bsc_ctx even though
the same should already be linked from gsm_data.c. Declare it extern instead
and hence use the one from gsm_data.c.

A linking error actually occured as soon as I joined gsm_data_shared.c into
gsm_data.c, which is how my attention was drawn to this. I assume that linking
didn't necessarily pull in gsm_data.c before and a separate tall_bsc_ctx was
permitted. As soon as the next commit merges those files
(Ie247bc492efb331871d970c56700595ad3f7e201), it becomes impossible to define a
second tall_bsc_ctx in ipaccess-proxy.c.

Change-Id: I9c9c8540419876696e65a690717144d497d60fb2
---
M src/ipaccess/ipaccess-proxy.c
1 file changed, 1 insertion(+), 2 deletions(-)

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



diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index d44cdf2..6a3af28 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -120,8 +120,7 @@
UDP_TO_BSC = 6,
 };
 
-/* some of the code against we link from OpenBSC needs this */
-void *tall_bsc_ctx = NULL;
+extern void *tall_bsc_ctx;
 
 static char *listen_ipaddr;
 static char *bsc_ipaddr;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9c9c8540419876696e65a690717144d497d60fb2
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


[MERGED] osmo-bsc[master]: libcommon: eliminate debug.c

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libcommon: eliminate debug.c
..


libcommon: eliminate debug.c

Provide concise log categories for each main scope.

Move the complete log categories 1:1 to osmo_bsc_main.c.

In bsc_nat.c, omit obviously unused log categories.

In tests, omit almost all log categories, except for those explicitly tested as
the expected output.

Note: should any logging occur for a log category that is omitted by accident,
such will end up being logged as DLGLOBAL, so it will show up and we can fix
it, and it will not get lost silently.

Change-Id: Ib524e49ec211662e0dfde8161495a72aa8ad76cf
---
M include/osmocom/bsc/debug.h
M src/ipaccess/ipaccess-config.c
M src/ipaccess/ipaccess-proxy.c
M src/libcommon/Makefile.am
D src/libcommon/debug.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/bsc_nat.c
M src/utils/bs11_config.c
M tests/abis/abis_test.c
M tests/bsc-nat-trie/bsc_nat_trie_test.c
M tests/bsc-nat/bsc_nat_test.c
M tests/bsc/bsc_test.c
M tests/bssap/bssap_test.c
M tests/channel/channel_test.c
M tests/gsm0408/gsm0408_test.c
M tests/nanobts_omlattr/nanobts_omlattr_test.c
M tests/subscr/bsc_subscr_test.c
17 files changed, 373 insertions(+), 243 deletions(-)

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



diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h
index 131ae8a..b9295a0 100644
--- a/include/osmocom/bsc/debug.h
+++ b/include/osmocom/bsc/debug.h
@@ -44,5 +44,3 @@
DSIGTRAN,
Debug_LastEntry,
 };
-
-extern const struct log_info log_info;
diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 957a5bb..7e8cafd 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -838,6 +838,20 @@
 
 extern void bts_model_nanobts_init();
 
+static const struct log_info_cat log_categories[] = {
+   [DNM] = {
+   .name = "DNM",
+   .description = "A-bis Network Management / O&M (NM/OML)",
+   .color = "\033[1;36m",
+   .enabled = 1, .loglevel = LOGL_INFO,
+   },
+};
+
+static const struct log_info log_info = {
+   .cat = log_categories,
+   .num_cat = ARRAY_SIZE(log_categories),
+};
+
 int main(int argc, char **argv)
 {
struct gsm_bts *bts;
diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index b45b543..40749ee 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -1200,6 +1200,20 @@
}
 }
 
+static const struct log_info_cat log_categories[] = {
+   [DMM] = {
+   .name = "DMM",
+   .description = "Layer3 Mobility Management (MM)",
+   .color = "\033[1;33m",
+   .enabled = 1, .loglevel = LOGL_NOTICE,
+   },
+};
+
+const struct log_info log_info = {
+   .cat = log_categories,
+   .num_cat = ARRAY_SIZE(log_categories),
+};
+
 int main(int argc, char **argv)
 {
int rc;
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index 1a73e6c..1f7f5c4 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -20,7 +20,6 @@
$(NULL)
 
 libcommon_a_SOURCES = \
-   debug.c \
gsm_data.c \
gsm_data_shared.c \
socket.c \
diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c
deleted file mode 100644
index b5a490b..000
--- a/src/libcommon/debug.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* OpenBSC Debugging/Logging support code */
-
-/* (C) 2008-2010 by Harald Welte 
- * (C) 2008 by Holger Hans Peter Freyther 
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-/* default categories */
-static const struct log_info_cat default_categories[] = {
-   [DRLL] = {
-   .name = "DRLL",
-   .description = "A-bis Radio Link Layer (RLL)",
-   .color = "\033[1;31m",
-   .enabled = 1, .loglevel = LOGL_NOTICE,
-   },
-   [DCC] = {
-   .name = "DCC",
-   .description = "Layer3 Call Control (CC)",
-   .color = "\033[1;32m",
-   .enabled 

[MERGED] osmo-bsc[master]: libcommon: eliminate socket.c

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libcommon: eliminate socket.c
..


libcommon: eliminate socket.c

Replace calls to make_sock() with osmo_sock_init_ofd().
Shame on me for not testing every single one in practice, I hope for peer
review to confirm that this should be correct... Read closely please!

The IPPROTO_GRE define seems to be unused (at least in osmo-bsc.git), drop it
completely.

Change-Id: Ia6e4e0e1eed3328fa25b3b90be376d532ad0e56b
---
M include/osmocom/bsc/Makefile.am
D include/osmocom/bsc/socket.h
M src/ipaccess/ipaccess-proxy.c
M src/libcommon/Makefile.am
D src/libcommon/socket.c
M src/osmo-bsc_nat/bsc_nat.c
M src/osmo-bsc_nat/bsc_ussd.c
7 files changed, 37 insertions(+), 158 deletions(-)

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



diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 699aeb3..1a43be4 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -48,7 +48,6 @@
rest_octets.h \
rs232.h \
signal.h \
-   socket.h \
system_information.h \
ussd.h \
vty.h \
diff --git a/include/osmocom/bsc/socket.h b/include/osmocom/bsc/socket.h
deleted file mode 100644
index 0fd85f1..000
--- a/include/osmocom/bsc/socket.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _BSC_SOCKET_H
-#define _BSC_SOCKET_H
-
-#include 
-
-#ifndef IPPROTO_GRE
-#define IPPROTO_GRE 47
-#endif
-
-int make_sock(struct osmo_fd *bfd, int proto,
- uint32_t ip, uint16_t port, int priv_nr,
- int (*cb)(struct osmo_fd *fd, unsigned int what), void *data);
-
-#endif /* _BSC_SOCKET_H */
diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index 40749ee..5cf6d6d 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -47,7 +47,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 /* one instance of an ip.access protocol proxy */
@@ -369,8 +369,11 @@
 
/* Create UDP socket for BTS packet injection */
udp_port = 1 + (site_id % 1000)*100 + (bts_id % 100);
-   ret = make_sock(&ipbc->udp_bts_fd, IPPROTO_UDP, INADDR_ANY, udp_port,
-   UDP_TO_BTS, udp_fd_cb, ipbc);
+   ipbc->udp_bts_fd.priv_nr = UDP_TO_BTS;
+   ipbc->udp_bts_fd.cb = udp_fd_cb;
+   ipbc->udp_bts_fd.data = ipbc;
+   ret = osmo_sock_init_ofd(&ipbc->udp_bts_fd, AF_INET, SOCK_DGRAM, 
IPPROTO_UDP,
+NULL, udp_port, OSMO_SOCK_F_BIND);
if (ret < 0)
goto err_udp_bts;
DEBUGP(DLINP, "(%u/%u/%u) Created UDP socket for injection "
@@ -378,8 +381,11 @@
 
/* Create UDP socket for BSC packet injection */
udp_port = 2 + (site_id % 1000)*100 + (bts_id % 100);
-   ret = make_sock(&ipbc->udp_bsc_fd, IPPROTO_UDP, INADDR_ANY, udp_port,
-   UDP_TO_BSC, udp_fd_cb, ipbc);
+   ipbc->udp_bsc_fd.priv_nr = UDP_TO_BSC;
+   ipbc->udp_bsc_fd.cb = udp_fd_cb;
+   ipbc->udp_bsc_fd.data = ipbc;
+   ret = osmo_sock_init_ofd(&ipbc->udp_bsc_fd, AF_INET, SOCK_DGRAM, 
IPPROTO_UDP,
+NULL, udp_port, OSMO_SOCK_F_BIND);
if (ret < 0)
goto err_udp_bsc;
DEBUGP(DLINP, "(%u/%u/%u) Created UDP socket for injection "
@@ -390,13 +396,12 @@
if (gprs_ns_ipaddr) {
struct sockaddr_in sock;
socklen_t len = sizeof(sock);
-   struct in_addr addr;
-   uint32_t ip;
 
-   inet_aton(listen_ipaddr, &addr);
-   ip = ntohl(addr.s_addr); /* make_sock() needs host byte order */
-   ret = make_sock(&ipbc->gprs_ns_fd, IPPROTO_UDP, ip, 0, 0,
-   gprs_ns_cb, ipbc);
+   ipbc->gprs_ns_fd.priv_nr = 0;
+   ipbc->gprs_ns_fd.cb = gprs_ns_cb;
+   ipbc->gprs_ns_fd.data = ipbc;
+   ret = osmo_sock_init_ofd(&ipbc->gprs_ns_fd, AF_INET, 
SOCK_DGRAM, IPPROTO_UDP,
+listen_ipaddr, 0, OSMO_SOCK_F_BIND);
if (ret < 0) {
LOGP(DLINP, LOGL_ERROR, "Creating the GPRS socket 
failed.\n");
goto err_udp_bsc;
@@ -1062,15 +1067,18 @@
osmo_timer_setup(&ipp->reconn_timer, reconn_tmr_cb, ipp);
 
/* Listen for OML connections */
-   ret = make_sock(&ipp->oml_listen_fd, IPPROTO_TCP, INADDR_ANY,
-   IPA_TCP_PORT_OML, OML_FROM_BTS, listen_fd_cb, NULL);
+   ipp->oml_listen_fd.priv_nr = OML_FROM_BTS;
+   ipp->oml_listen_fd.cb = listen_fd_cb;
+   ret = osmo_sock_init_ofd(&ipp->oml_listen_fd, AF_INET, SOCK_STREAM, 
IPPROTO_TCP,
+NULL, IPA_TCP_PORT_OML, OSMO_SOCK_F_BIND);
if (ret < 0)
return ret;
 
/* Listen for R

[MERGED] osmo-bsc[master]: libcommon: eliminate bsc_version.c

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libcommon: eliminate bsc_version.c
..


libcommon: eliminate bsc_version.c

Move the copyright string into osmo_bsc_main.c. No other users of it exist.

Change-Id: I7f48924f484e4e4b98be4ca8bee253e6ea9c0576
---
M src/libcommon/Makefile.am
D src/libcommon/bsc_version.c
M src/osmo-bsc/osmo_bsc_main.c
3 files changed, 7 insertions(+), 33 deletions(-)

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



diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index 9f7e7b9..af578a2 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -20,7 +20,6 @@
$(NULL)
 
 libcommon_a_SOURCES = \
-   bsc_version.c \
common_vty.c \
debug.c \
gsm_data.c \
diff --git a/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c
deleted file mode 100644
index f0369bf..000
--- a/src/libcommon/bsc_version.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Hold the copyright and version string */
-/* (C) 2010-2016 by Harald Welte 
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include "../../bscconfig.h"
-
-const char *openbsc_copyright =
-   "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n"
-   "Contributions by Daniel Willmann, Jan Lübbe, Stefan Schmidt\r\n"
-   "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n"
-   "License AGPLv3+: GNU AGPL version 3 or later 
\r\n"
-   "This is free software: you are free to change and redistribute it.\r\n"
-   "There is NO WARRANTY, to the extent permitted by law.\r\n";
-
-
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 3deb369..db8c4f8 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -62,7 +62,6 @@
 struct gsm_network *bsc_gsmnet = 0;
 static const char *config_file = "osmo-bsc.cfg";
 static const char *rf_ctrl = NULL;
-extern const char *openbsc_copyright;
 static int daemonize = 0;
 static struct llist_head access_lists;
 
@@ -151,6 +150,13 @@
 
 static struct vty_app_info vty_info = {
.name   = "OsmoBSC",
+   .copyright  =
+   "Copyright (C) 2008-2018 Harald Welte, Holger Freyther\r\n"
+   "Contributions by Daniel Willmann, Jan Lübbe, Stefan Schmidt\r\n"
+   "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n"
+   "License AGPLv3+: GNU AGPL version 3 or later 
\r\n"
+   "This is free software: you are free to change and redistribute it.\r\n"
+   "There is NO WARRANTY, to the extent permitted by law.\r\n",
.version= PACKAGE_VERSION,
.go_parent_cb   = bsc_vty_go_parent,
.is_config_node = bsc_vty_is_config_node,
@@ -218,7 +224,6 @@
/* enable filters */
 
/* This needs to precede handle_options() */
-   vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
bsc_vty_init(bsc_gsmnet);
bsc_msg_lst_vty_init(tall_bsc_ctx, &access_lists, BSC_NODE);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f48924f484e4e4b98be4ca8bee253e6ea9c0576
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 


[MERGED] osmo-bsc[master]: drop libcommon completely, move remaining files to libbsc

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: drop libcommon completely, move remaining files to libbsc
..


drop libcommon completely, move remaining files to libbsc

Move gsm_data.c and handover_cfg.c to libbsc, where they belong.

This leaves libcommon utterly empty, drop it.

Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
---
M configure.ac
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/libbsc/Makefile.am
R src/libbsc/gsm_data.c
R src/libbsc/handover_cfg.c
D src/libcommon/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc_nat/Makefile.am
M src/utils/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/bssap/Makefile.am
M tests/channel/Makefile.am
M tests/gsm0408/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
19 files changed, 3 insertions(+), 43 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index d756970..b2644fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,6 @@
 include/osmocom/bsc/Makefile
 src/Makefile
 src/libbsc/Makefile
-src/libcommon/Makefile
 src/libfilter/Makefile
 src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 637272d..28b070e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@
 
 # Libraries
 SUBDIRS = \
-   libcommon \
libcommon-cs \
libbsc \
libfilter \
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index b3b2b8c..0301d3a 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -30,7 +30,6 @@
 
 abisip_find_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
 
@@ -48,7 +47,6 @@
 ipaccess_config_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
 
@@ -58,6 +56,5 @@
 
 ipaccess_proxy_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index d118f44..f03b498 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -37,6 +37,7 @@
bts_unknown.c \
bts_sysmobts.c \
chan_alloc.c \
+   gsm_data.c \
handover_decision.c \
handover_logic.c \
meas_rep.c \
@@ -58,5 +59,6 @@
bsc_dyn_ts.c \
bts_ipaccess_nanobts_omlattr.c \
handover_vty.c \
+   handover_cfg.c \
$(NULL)
 
diff --git a/src/libcommon/gsm_data.c b/src/libbsc/gsm_data.c
similarity index 100%
rename from src/libcommon/gsm_data.c
rename to src/libbsc/gsm_data.c
diff --git a/src/libcommon/handover_cfg.c b/src/libbsc/handover_cfg.c
similarity index 100%
rename from src/libcommon/handover_cfg.c
rename to src/libbsc/handover_cfg.c
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
deleted file mode 100644
index 02ec0b6..000
--- a/src/libcommon/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-AM_CPPFLAGS = \
-   $(all_includes) \
-   -I$(top_srcdir)/include \
-   -I$(top_builddir) \
-   $(NULL)
-
-AM_CFLAGS = \
-   -Wall \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOVTY_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSIGTRAN_CFLAGS) \
-   $(LIBOSMOLEGACYMGCP_CFLAGS) \
-   $(COVERAGE_CFLAGS) \
-   $(NULL)
-
-noinst_LIBRARIES = \
-   libcommon.a \
-   $(NULL)
-
-libcommon_a_SOURCES = \
-   gsm_data.c \
-   handover_cfg.c \
-   $(NULL)
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 7978852..50f9c78 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -43,7 +43,6 @@
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am
index a941b58..83ef850 100644
--- a/src/osmo-bsc_nat/Makefile.am
+++ b/src/osmo-bsc_nat/Makefile.am
@@ -41,7 +41,6 @@
$(top_builddir)/src/libfilter/libfilter.a \
$(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) \
diff --git a/src/utils/Makefile

[MERGED] osmo-bsc[master]: libcommon: join gsm_data_shared.* into gsm_data.*

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libcommon: join gsm_data_shared.* into gsm_data.*
..


libcommon: join gsm_data_shared.* into gsm_data.*

The separation of gsm_data_shared.* from gsm_data.* historically allowed
compiling parts of it into osmo-bts, which we have dropped since (osmo-bts has
its own copy now). Even though gsm_data.* now becomes rather large by it,
remove the legacy separation to get rid of the "shared" naming, which is no
longer meaningful. A future patch might separate into meaningful smaller bits,
if we get the time.

Change-Id: Ie247bc492efb331871d970c56700595ad3f7e201
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/e1_config.h
M include/osmocom/bsc/gsm_data.h
D include/osmocom/bsc/gsm_data_shared.h
M src/libcommon/Makefile.am
M src/libcommon/gsm_data.c
D src/libcommon/gsm_data_shared.c
M src/utils/meas_json.c
M tests/bssap/bssap_test.c
M tests/gsm0408/gsm0408_test.c
10 files changed, 1,736 insertions(+), 1,794 deletions(-)

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



diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 1a43be4..c503a50 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -23,7 +23,6 @@
gsm_04_08_utils.h \
gsm_04_80.h \
gsm_data.h \
-   gsm_data_shared.h \
handover.h \
handover_cfg.h \
handover_decision.h \
diff --git a/include/osmocom/bsc/e1_config.h b/include/osmocom/bsc/e1_config.h
index 909e3cc..d8d23c3 100644
--- a/include/osmocom/bsc/e1_config.h
+++ b/include/osmocom/bsc/e1_config.h
@@ -1,7 +1,9 @@
 #ifndef _E1_CONFIG_H
 #define _E1_CONFIG_H
 
-#include 
+struct gsm_bts_trx_ts;
+struct gsm_bts_trx;
+struct gsm_bts;
 
 int e1_reconfig_ts(struct gsm_bts_trx_ts *ts);
 int e1_reconfig_trx(struct gsm_bts_trx *trx);
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 9a35ca9..a0f2114 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -5,6 +5,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -17,6 +18,14 @@
 #include 
 #include 
 #include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 struct mgcp_client_conf;
 struct mgcp_client;
@@ -115,7 +124,891 @@
 };
 
 
-#include "gsm_data_shared.h"
+/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 
Table 10.5.2.33b.1:
+   4-bit index is used (2# = 10#15) */
+#define SI2Q_MAX_NUM 16
+/* length in bits (for single SI2quater message) */
+#define SI2Q_MAX_LEN 160
+#define SI2Q_MIN_LEN 18
+
+struct osmo_bsc_data;
+
+struct osmo_bsc_sccp_con;
+
+/* Channel Request reason */
+enum gsm_chreq_reason_t {
+   GSM_CHREQ_REASON_EMERG,
+   GSM_CHREQ_REASON_PAG,
+   GSM_CHREQ_REASON_CALL,
+   GSM_CHREQ_REASON_LOCATION_UPD,
+   GSM_CHREQ_REASON_OTHER,
+   GSM_CHREQ_REASON_PDCH,
+};
+
+/* lchans 0..3 are SDCCH in combined channel configuration,
+   use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() 
*/
+#define CCCH_LCHAN 4
+
+#define TRX_NR_TS  8
+#define TS_MAX_LCHAN   8
+
+#define HARDCODED_ARFCN 123
+#define HARDCODED_BSIC 0x3f/* NCC = 7 / BCC = 7 */
+
+/* for multi-drop config */
+#define HARDCODED_BTS0_TS  1
+#define HARDCODED_BTS1_TS  6
+#define HARDCODED_BTS2_TS  11
+
+#define MAX_VERSION_LENGTH 64
+
+#define MAX_BTS_FEATURES 128
+
+enum gsm_hooks {
+   GSM_HOOK_NM_SWLOAD,
+   GSM_HOOK_RR_PAGING,
+   GSM_HOOK_RR_SECURITY,
+};
+
+enum gsm_paging_event {
+   GSM_PAGING_SUCCEEDED,
+   GSM_PAGING_EXPIRED,
+   GSM_PAGING_OOM,
+   GSM_PAGING_BUSY,
+};
+
+enum bts_gprs_mode {
+   BTS_GPRS_NONE = 0,
+   BTS_GPRS_GPRS = 1,
+   BTS_GPRS_EGPRS = 2,
+};
+
+struct gsm_lchan;
+struct osmo_rtp_socket;
+struct rtp_socket;
+struct bsc_api;
+
+/* Network Management State */
+struct gsm_nm_state {
+   uint8_t operational;
+   uint8_t administrative;
+   uint8_t availability;
+};
+
+struct gsm_abis_mo {
+   uint8_t obj_class;
+   uint8_t procedure_pending;
+   struct abis_om_obj_inst obj_inst;
+   const char *name;
+   struct gsm_nm_state nm_state;
+   struct tlv_parsed *nm_attr;
+   struct gsm_bts *bts;
+};
+
+/* Ericsson OM2000 Managed Object */
+struct abis_om2k_mo {
+   uint8_t class;
+   uint8_t bts;
+   uint8_t assoc_so;
+   uint8_t inst;
+} __attribute__ ((packed));
+
+struct om2k_mo {
+   struct abis_om2k_mo addr;
+   struct osmo_fsm_inst *fsm;
+};
+
+#define A38_XOR_MIN_KEY_LEN12
+#define A38_XOR_MAX_KEY_LEN16
+#define A38_COMP128_KEY_LEN16
+#define RSL_ENC_ALG_A5(x)  (x+1)
+#define MAX_EARFCN_LIST 32
+
+/* is the data link established? who established it? */
+#define LCHAN_SAPI_UNUSED  0
+#define LCHAN_SAPI_MS  1
+#define LCHA

[MERGED] osmo-bsc[master]: libcommon: eliminate common_vty.c

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libcommon: eliminate common_vty.c
..


libcommon: eliminate common_vty.c

Move bsc_vty_go_parent() to osmo_bsc_main.c and bsc_nat.c, and drop those nodes
that aren't used in the respective main scope.

Change-Id: I22ebb76742e9c5ab9dd608ac089a5c558aceeb36
---
M include/osmocom/bsc/vty.h
M src/libcommon/Makefile.am
D src/libcommon/common_vty.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/bsc_nat.c
5 files changed, 129 insertions(+), 157 deletions(-)

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



diff --git a/include/osmocom/bsc/vty.h b/include/osmocom/bsc/vty.h
index f705601..daf9750 100644
--- a/include/osmocom/bsc/vty.h
+++ b/include/osmocom/bsc/vty.h
@@ -41,8 +41,6 @@
HLR_NODE,
 };
 
-extern int bsc_vty_is_config_node(struct vty *vty, int node);
-
 struct log_info;
 int bsc_vty_init(struct gsm_network *network);
 int bsc_vty_init_extra(void);
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index af578a2..1a73e6c 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -20,7 +20,6 @@
$(NULL)
 
 libcommon_a_SOURCES = \
-   common_vty.c \
debug.c \
gsm_data.c \
gsm_data_shared.c \
diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c
deleted file mode 100644
index 82327d1..000
--- a/src/libcommon/common_vty.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* OpenBSC VTY common helpers */
-/* (C) 2009-2010 by Harald Welte 
- * (C) 2009-2010 by Holger Hans Peter Freyther
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-
-int bsc_vty_go_parent(struct vty *vty)
-{
-   switch (vty->node) {
-   case GSMNET_NODE:
-   vty->node = CONFIG_NODE;
-   vty->index = NULL;
-   break;
-   case BTS_NODE:
-   vty->node = GSMNET_NODE;
-   {
-   /* set vty->index correctly ! */
-   struct gsm_bts *bts = vty->index;
-   vty->index = bts->network;
-   vty->index_sub = NULL;
-   }
-   break;
-   case TRX_NODE:
-   vty->node = BTS_NODE;
-   {
-   /* set vty->index correctly ! */
-   struct gsm_bts_trx *trx = vty->index;
-   vty->index = trx->bts;
-   vty->index_sub = &trx->bts->description;
-   }
-   break;
-   case TS_NODE:
-   vty->node = TRX_NODE;
-   {
-   /* set vty->index correctly ! */
-   struct gsm_bts_trx_ts *ts = vty->index;
-   vty->index = ts->trx;
-   vty->index_sub = &ts->trx->description;
-   }
-   break;
-   case OML_NODE:
-   case OM2K_NODE:
-   vty->node = ENABLE_NODE;
-   /* NOTE: this only works because it's not part of the config
-* tree, where outer commands are searched via vty_go_parent()
-* and only (!) executed when a matching one is found.
-*/
-   talloc_free(vty->index);
-   vty->index = NULL;
-   break;
-   case OM2K_CON_GROUP_NODE:
-   vty->node = BTS_NODE;
-   {
-   struct con_group *cg = vty->index;
-   struct gsm_bts *bts = cg->bts;
-   vty->index = bts;
-   vty->index_sub = &bts->description;
-   }
-   break;
-   case NAT_BSC_NODE:
-   vty->node = NAT_NODE;
-   {
-   struct bsc_config *bsc_config = vty->index;
-   vty->index = bsc_config->nat;
-   }
-   break;
-   case PGROUP_NODE:
-   vty->node = NAT_NODE;
-   vty->index = NULL;
-   break;
-   case TRU

[PATCH] osmo-pcu[master]: Make osmo-pcu wait for BTS to become available at start-up t...

2018-02-14 Thread Stefan Sperling

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

Make osmo-pcu wait for BTS to become available at start-up time.

After the PCU socket becomes available, the BTS might send an
INFO_IND message with the 'ACTIVE' flag cleared. If this happens,
do not exit immediately, but keep retrying until an INFO_IND
message with the 'ACTIVE' flag arrives.

Note that this change only affects behaviour at process start-up time.
If the BTS switches from active to inactive state then osmo-pcu will
still exit. If this behaviour should be changed as well it could be
done in a follow-up patch.

Tested against osom-bsc + osmo-bts-virtual.

Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Related: OS#2689
---
M src/bts.h
M src/osmobts_sock.cpp
M src/pcu_l1_if.cpp
3 files changed, 27 insertions(+), 7 deletions(-)


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

diff --git a/src/bts.h b/src/bts.h
index 5679b98..f9f385b 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -173,6 +173,7 @@
  * we can start to compile pcu_vty.c with c++ and remove the split.
  */
 struct gprs_rlcmac_bts {
+   bool active;
uint8_t bsic;
uint8_t fc_interval;
uint16_t fc_bucket_time;
diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp
index 577d41e..9e4000a 100644
--- a/src/osmobts_sock.cpp
+++ b/src/osmobts_sock.cpp
@@ -55,7 +55,23 @@
struct llist_head upqueue;  /* queue for sending messages */
 } *pcu_sock_state = NULL;
 
-static void pcu_sock_timeout(void *_priv);
+static void pcu_sock_timeout(void *_priv)
+{
+   pcu_l1if_open();
+}
+
+static void pcu_tx_txt_retry(void *_priv)
+{
+   struct gprs_rlcmac_bts *bts = bts_main_data();
+   struct pcu_sock_state *state = pcu_sock_state;
+
+   if (bts->active)
+   return;
+
+   LOGP(DL1IF, LOGL_INFO, "Sending version %s to BTS.\n", PACKAGE_VERSION);
+   pcu_tx_txt_ind(PCU_VERSION, "%s", PACKAGE_VERSION);
+   osmo_timer_schedule(&state->timer, 5, 0);
+}
 
 int pcu_sock_send(struct msgb *msg)
 {
@@ -268,7 +284,7 @@
pcu_sock_state = state;
close(bfd->fd);
bfd->fd = -1;
-   state->timer.cb = pcu_sock_timeout;
+   osmo_timer_setup(&state->timer, pcu_sock_timeout, NULL);
osmo_timer_schedule(&state->timer, 5, 0);
return 0;
}
@@ -293,6 +309,10 @@
LOGP(DL1IF, LOGL_INFO, "Sending version %s to BTS.\n", PACKAGE_VERSION);
pcu_tx_txt_ind(PCU_VERSION, "%s", PACKAGE_VERSION);
 
+   /* Schedule a timer so we keep trying until the BTS becomes active. */
+   osmo_timer_setup(&state->timer, pcu_tx_txt_retry, NULL);
+   osmo_timer_schedule(&state->timer, 5, 0);
+
return 0;
 }
 
@@ -311,9 +331,4 @@
pcu_sock_close(state, 0);
talloc_free(state);
pcu_sock_state = NULL;
-}
-
-static void pcu_sock_timeout(void *_priv)
-{
-   pcu_l1if_open();
 }
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 7112b04..0a9803b 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -414,7 +414,10 @@
 
if (!(info_ind->flags & PCU_IF_FLAG_ACTIVE)) {
LOGP(DL1IF, LOGL_NOTICE, "BTS not available\n");
+   if (!bts->active)
+   return -EAGAIN;
 bssgp_failed:
+   bts->active = false;
/* free all TBF */
for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) {
bts->trx[trx].arfcn = info_ind->trx[trx].arfcn;
@@ -562,6 +565,7 @@
}
}
 
+   bts->active = true;
return rc;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 


[PATCH] osmo-ttcn3-hacks[master]: re-organize configuration files; add tcpdump integration

2018-02-14 Thread Harald Welte

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

re-organize configuration files; add tcpdump integration

Let's make sure we share common configuration between the test
suites and split the config file into a "default" part which is
used (but not copied) in the Docker images, and a "local" part
which is basically those overrides that the user (or docker image)
wants to do from the default.

Change-Id: I3db452e24e5238aa05254d903739c64d202e61db
---
A Common.cfg
M bsc/BSC_Tests.cfg
A bsc/BSC_Tests.default
M mgw/MGCP_Test.cfg
A mgw/MGCP_Test.default
M msc/MSC_Tests.cfg
A msc/MSC_Tests.default
A ttcn3-tcpdump-start.sh
A ttcn3-tcpdump-stop.sh
9 files changed, 180 insertions(+), 102 deletions(-)


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

diff --git a/Common.cfg b/Common.cfg
new file mode 100644
index 000..4a50420
--- /dev/null
+++ b/Common.cfg
@@ -0,0 +1,17 @@
+# common config file, relevant to all projects
+
+[DEFINE]
+TTCN3_HACKS_PATH := ".."
+TCPDUMP_START := $TTCN3_HACKS_PATH"/ttcn3-tcpdump-start.sh"
+TCPDUMP_STOP := $TTCN3_HACKS_PATH"/ttcn3-tcpdump-stop.sh"
+
+[LOGGING]
+SourceInfoFormat := Single;
+LogSourceInfo := Yes;
+LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
+#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
+#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC
+
+[EXTERNAL_COMMANDS]
+BeginTestCase := $TCPDUMP_START
+EndTestCase := $TCPDUMP_STOP
diff --git a/bsc/BSC_Tests.cfg b/bsc/BSC_Tests.cfg
index 44bbf61..0294fa0 100644
--- a/bsc/BSC_Tests.cfg
+++ b/bsc/BSC_Tests.cfg
@@ -1,49 +1,21 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./BSC_Tests.default"
+
+# Local configuration below
+
 [LOGGING]
-SourceInfoFormat := Single;
-#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
-#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC
-#FileMask := LOG_ALL | TTCN_MATCHING;
-BSSAP.FileMask := LOG_NOTHING;
-"VirtMSC-M3UA".FileMask := ERROR | WARNING;
-"VirtMSC-SCCP".FileMask := ERROR | WARNING;
-"IPA0-RSL-IPA".FileMask := ERROR | WARNING;
-"IPA0-CTRL-IPA".FileMask := ERROR | WARNING;
-mtc.FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
 
 [TESTPORT_PARAMETERS]
-#*.*.udpReuseAddress := "yes";
-*.BSCVTY.CTRL_MODE := "client"
-*.BSCVTY.CTRL_HOSTNAME := "127.0.0.1"
-*.BSCVTY.CTRL_PORTNUM := "4242"
-*.BSCVTY.CTRL_LOGIN_SKIPPED := "yes"
-*.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
-*.BSCVTY.CTRL_READMODE := "buffered"
-*.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
-*.BSCVTY.PROMPT1 := "OsmoBSC> "
 
 [MODULE_PARAMETERS]
-#mp_bsc_rsl_port := 3003;
-#mp_bsc_ctrl_port := 4249;
-#mp_bsc_ip   := "127.0.0.1";
-#mp_test_ip   := "127.0.0.1";
-
-#BSC_Tests.mp_bssap_cfg := {
-#  sccp_service_type := "mtp3_itu",
-#  sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" },
-#  own_pc := 185,
-#  own_ssn := 254,
-#  peer_pc := 187,
-#  peer_ssn := 254,
-#  sio := '83'O
-#};
-
-#mp_ipa_mgcp_uses_osmo_ext := true;
-Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBSC";
 
 [MAIN_CONTROLLER]
 
 [EXECUTE]
-BSC_Tests.control
+#BSC_Tests.control
 #BSC_Tests.TC_chan_act_noreply
 #BSC_Tests.TC_chan_act_ack_noest
 #BSC_Tests.TC_chan_act_ack_est_ind_noreply
diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default
new file mode 100644
index 000..baa3b54
--- /dev/null
+++ b/bsc/BSC_Tests.default
@@ -0,0 +1,23 @@
+[LOGGING]
+BSSAP.FileMask := LOG_NOTHING;
+"VirtMSC-M3UA".FileMask := ERROR | WARNING;
+"VirtMSC-SCCP".FileMask := ERROR | WARNING;
+"IPA0-RSL-IPA".FileMask := ERROR | WARNING;
+"IPA0-CTRL-IPA".FileMask := ERROR | WARNING;
+mtc.FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
+
+[TESTPORT_PARAMETERS]
+*.BSCVTY.CTRL_MODE := "client"
+*.BSCVTY.CTRL_HOSTNAME := "127.0.0.1"
+*.BSCVTY.CTRL_PORTNUM := "4242"
+*.BSCVTY.CTRL_LOGIN_SKIPPED := "yes"
+*.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
+*.BSCVTY.CTRL_READMODE := "buffered"
+*.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
+*.BSCVTY.PROMPT1 := "OsmoBSC> "
+
+[MODULE_PARAMETERS]
+Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBSC";
+
+[EXECUTE]
+BSC_Tests.control
diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index da45761..b936fe1 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -1,40 +1,39 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./MSC_Tests.default"
+
+# Local configuration below
+
 [LOGGING]
-SourceInfoFormat := Single;
-#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
-#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC
-FileMask := LOG_ALL | TTCN_MATCHING;
 
 [TESTPORT_PARAMETERS]
-#*.*.udpReuseAddress := "yes";
 
 [MODULE_PARAMETERS]
-mp_local_udp_port := 2727;
-mp_local_ip:= "127.0.0.1";
-mp_remote_udp_port := 2427;

osmo-ttcn3-hacks[master]: re-organize configuration files; add tcpdump integration

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3db452e24e5238aa05254d903739c64d202e61db
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: re-organize configuration files; add tcpdump integration

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: re-organize configuration files; add tcpdump integration
..


re-organize configuration files; add tcpdump integration

Let's make sure we share common configuration between the test
suites and split the config file into a "default" part which is
used (but not copied) in the Docker images, and a "local" part
which is basically those overrides that the user (or docker image)
wants to do from the default.

Change-Id: I3db452e24e5238aa05254d903739c64d202e61db
---
A Common.cfg
M bsc/BSC_Tests.cfg
A bsc/BSC_Tests.default
M mgw/MGCP_Test.cfg
A mgw/MGCP_Test.default
M msc/MSC_Tests.cfg
A msc/MSC_Tests.default
A ttcn3-tcpdump-start.sh
A ttcn3-tcpdump-stop.sh
9 files changed, 180 insertions(+), 102 deletions(-)

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



diff --git a/Common.cfg b/Common.cfg
new file mode 100644
index 000..4a50420
--- /dev/null
+++ b/Common.cfg
@@ -0,0 +1,17 @@
+# common config file, relevant to all projects
+
+[DEFINE]
+TTCN3_HACKS_PATH := ".."
+TCPDUMP_START := $TTCN3_HACKS_PATH"/ttcn3-tcpdump-start.sh"
+TCPDUMP_STOP := $TTCN3_HACKS_PATH"/ttcn3-tcpdump-stop.sh"
+
+[LOGGING]
+SourceInfoFormat := Single;
+LogSourceInfo := Yes;
+LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
+#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
+#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC
+
+[EXTERNAL_COMMANDS]
+BeginTestCase := $TCPDUMP_START
+EndTestCase := $TCPDUMP_STOP
diff --git a/bsc/BSC_Tests.cfg b/bsc/BSC_Tests.cfg
index 44bbf61..0294fa0 100644
--- a/bsc/BSC_Tests.cfg
+++ b/bsc/BSC_Tests.cfg
@@ -1,49 +1,21 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./BSC_Tests.default"
+
+# Local configuration below
+
 [LOGGING]
-SourceInfoFormat := Single;
-#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
-#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC
-#FileMask := LOG_ALL | TTCN_MATCHING;
-BSSAP.FileMask := LOG_NOTHING;
-"VirtMSC-M3UA".FileMask := ERROR | WARNING;
-"VirtMSC-SCCP".FileMask := ERROR | WARNING;
-"IPA0-RSL-IPA".FileMask := ERROR | WARNING;
-"IPA0-CTRL-IPA".FileMask := ERROR | WARNING;
-mtc.FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
 
 [TESTPORT_PARAMETERS]
-#*.*.udpReuseAddress := "yes";
-*.BSCVTY.CTRL_MODE := "client"
-*.BSCVTY.CTRL_HOSTNAME := "127.0.0.1"
-*.BSCVTY.CTRL_PORTNUM := "4242"
-*.BSCVTY.CTRL_LOGIN_SKIPPED := "yes"
-*.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
-*.BSCVTY.CTRL_READMODE := "buffered"
-*.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
-*.BSCVTY.PROMPT1 := "OsmoBSC> "
 
 [MODULE_PARAMETERS]
-#mp_bsc_rsl_port := 3003;
-#mp_bsc_ctrl_port := 4249;
-#mp_bsc_ip   := "127.0.0.1";
-#mp_test_ip   := "127.0.0.1";
-
-#BSC_Tests.mp_bssap_cfg := {
-#  sccp_service_type := "mtp3_itu",
-#  sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" },
-#  own_pc := 185,
-#  own_ssn := 254,
-#  peer_pc := 187,
-#  peer_ssn := 254,
-#  sio := '83'O
-#};
-
-#mp_ipa_mgcp_uses_osmo_ext := true;
-Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBSC";
 
 [MAIN_CONTROLLER]
 
 [EXECUTE]
-BSC_Tests.control
+#BSC_Tests.control
 #BSC_Tests.TC_chan_act_noreply
 #BSC_Tests.TC_chan_act_ack_noest
 #BSC_Tests.TC_chan_act_ack_est_ind_noreply
diff --git a/bsc/BSC_Tests.default b/bsc/BSC_Tests.default
new file mode 100644
index 000..baa3b54
--- /dev/null
+++ b/bsc/BSC_Tests.default
@@ -0,0 +1,23 @@
+[LOGGING]
+BSSAP.FileMask := LOG_NOTHING;
+"VirtMSC-M3UA".FileMask := ERROR | WARNING;
+"VirtMSC-SCCP".FileMask := ERROR | WARNING;
+"IPA0-RSL-IPA".FileMask := ERROR | WARNING;
+"IPA0-CTRL-IPA".FileMask := ERROR | WARNING;
+mtc.FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
+
+[TESTPORT_PARAMETERS]
+*.BSCVTY.CTRL_MODE := "client"
+*.BSCVTY.CTRL_HOSTNAME := "127.0.0.1"
+*.BSCVTY.CTRL_PORTNUM := "4242"
+*.BSCVTY.CTRL_LOGIN_SKIPPED := "yes"
+*.BSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes"
+*.BSCVTY.CTRL_READMODE := "buffered"
+*.BSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes"
+*.BSCVTY.PROMPT1 := "OsmoBSC> "
+
+[MODULE_PARAMETERS]
+Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoBSC";
+
+[EXECUTE]
+BSC_Tests.control
diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg
index da45761..b936fe1 100644
--- a/mgw/MGCP_Test.cfg
+++ b/mgw/MGCP_Test.cfg
@@ -1,40 +1,39 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./MSC_Tests.default"
+
+# Local configuration below
+
 [LOGGING]
-SourceInfoFormat := Single;
-#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC;
-#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC
-FileMask := LOG_ALL | TTCN_MATCHING;
 
 [

osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come a...

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come a...

2018-02-14 Thread Harald Welte

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

BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come active

We don't have a good way to make the BSSMAP code wait for the lower
SIGTRAN layers to be up and running.  To avoid the RESET being
sent before the lower layers are up, introduce a sleep of 1s.

This is ugly, but appears to work for now.  A more proper solution
is more than welcome.

Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
---
M library/BSSMAP_Emulation.ttcn
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn
index b1c6b81..67d9e98 100644
--- a/library/BSSMAP_Emulation.ttcn
+++ b/library/BSSMAP_Emulation.ttcn
@@ -523,6 +523,7 @@
f_expect_table_init();
 
if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) {
+   f_sleep(1.0);   /* HACK to wait for M3UA/ASP to be ACTIVE */
f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local);
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come a...

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come 
active
..


BSSMAP_Emulation: Sleep 1s to wait for M3UA/AS/ASP to come active

We don't have a good way to make the BSSMAP code wait for the lower
SIGTRAN layers to be up and running.  To avoid the RESET being
sent before the lower layers are up, introduce a sleep of 1s.

This is ugly, but appears to work for now.  A more proper solution
is more than welcome.

Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
---
M library/BSSMAP_Emulation.ttcn
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn
index b1c6b81..67d9e98 100644
--- a/library/BSSMAP_Emulation.ttcn
+++ b/library/BSSMAP_Emulation.ttcn
@@ -523,6 +523,7 @@
f_expect_table_init();
 
if (isvalue(ops.sccp_addr_peer) and isvalue(ops.sccp_addr_local)) {
+   f_sleep(1.0);   /* HACK to wait for M3UA/ASP to be ACTIVE */
f_bssap_reset(ops.sccp_addr_peer, ops.sccp_addr_local);
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a43b3e381405f3af30b3ffe04bc50e64ec66f57
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-pcu[master]: Make osmo-pcu wait for BTS to become available at start-up t...

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-pcu[master]: Make osmo-pcu wait for BTS to become available at start-up t...

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Make osmo-pcu wait for BTS to become available at start-up time.
..


Make osmo-pcu wait for BTS to become available at start-up time.

After the PCU socket becomes available, the BTS might send an
INFO_IND message with the 'ACTIVE' flag cleared. If this happens,
do not exit immediately, but keep retrying until an INFO_IND
message with the 'ACTIVE' flag arrives.

Note that this change only affects behaviour at process start-up time.
If the BTS switches from active to inactive state then osmo-pcu will
still exit. If this behaviour should be changed as well it could be
done in a follow-up patch.

Tested against osom-bsc + osmo-bts-virtual.

Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Related: OS#2689
---
M src/bts.h
M src/osmobts_sock.cpp
M src/pcu_l1_if.cpp
3 files changed, 27 insertions(+), 7 deletions(-)

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



diff --git a/src/bts.h b/src/bts.h
index 5679b98..f9f385b 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -173,6 +173,7 @@
  * we can start to compile pcu_vty.c with c++ and remove the split.
  */
 struct gprs_rlcmac_bts {
+   bool active;
uint8_t bsic;
uint8_t fc_interval;
uint16_t fc_bucket_time;
diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp
index 577d41e..9e4000a 100644
--- a/src/osmobts_sock.cpp
+++ b/src/osmobts_sock.cpp
@@ -55,7 +55,23 @@
struct llist_head upqueue;  /* queue for sending messages */
 } *pcu_sock_state = NULL;
 
-static void pcu_sock_timeout(void *_priv);
+static void pcu_sock_timeout(void *_priv)
+{
+   pcu_l1if_open();
+}
+
+static void pcu_tx_txt_retry(void *_priv)
+{
+   struct gprs_rlcmac_bts *bts = bts_main_data();
+   struct pcu_sock_state *state = pcu_sock_state;
+
+   if (bts->active)
+   return;
+
+   LOGP(DL1IF, LOGL_INFO, "Sending version %s to BTS.\n", PACKAGE_VERSION);
+   pcu_tx_txt_ind(PCU_VERSION, "%s", PACKAGE_VERSION);
+   osmo_timer_schedule(&state->timer, 5, 0);
+}
 
 int pcu_sock_send(struct msgb *msg)
 {
@@ -268,7 +284,7 @@
pcu_sock_state = state;
close(bfd->fd);
bfd->fd = -1;
-   state->timer.cb = pcu_sock_timeout;
+   osmo_timer_setup(&state->timer, pcu_sock_timeout, NULL);
osmo_timer_schedule(&state->timer, 5, 0);
return 0;
}
@@ -293,6 +309,10 @@
LOGP(DL1IF, LOGL_INFO, "Sending version %s to BTS.\n", PACKAGE_VERSION);
pcu_tx_txt_ind(PCU_VERSION, "%s", PACKAGE_VERSION);
 
+   /* Schedule a timer so we keep trying until the BTS becomes active. */
+   osmo_timer_setup(&state->timer, pcu_tx_txt_retry, NULL);
+   osmo_timer_schedule(&state->timer, 5, 0);
+
return 0;
 }
 
@@ -311,9 +331,4 @@
pcu_sock_close(state, 0);
talloc_free(state);
pcu_sock_state = NULL;
-}
-
-static void pcu_sock_timeout(void *_priv)
-{
-   pcu_l1if_open();
 }
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 7112b04..0a9803b 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -414,7 +414,10 @@
 
if (!(info_ind->flags & PCU_IF_FLAG_ACTIVE)) {
LOGP(DL1IF, LOGL_NOTICE, "BTS not available\n");
+   if (!bts->active)
+   return -EAGAIN;
 bssgp_failed:
+   bts->active = false;
/* free all TBF */
for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) {
bts->trx[trx].arfcn = info_ind->trx[trx].arfcn;
@@ -562,6 +565,7 @@
}
}
 
+   bts->active = true;
return rc;
 }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-pcu[master]: Make osmo-pcu wait for BTS to become available at start-up t...

2018-02-14 Thread Pau Espin Pedrol

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/6453/1/src/osmobts_sock.cpp
File src/osmobts_sock.cpp:

Line 288:   osmo_timer_schedule(&state->timer, 5, 0);
Do we actually need to wait 5 seconds now that we can reeschedule it in case it 
fails? we could this way speedup.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic42a5601a43b81d260721fef5d9fa52447f9d309
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: Yes


[PATCH] osmo-ttcn3-hacks[master]: ggsn: Switch over to new shared/common configuration file la...

2018-02-14 Thread Harald Welte

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

ggsn: Switch over to new shared/common configuration file layout

Change-Id: I491819c8bad8efa45cee161ea6f47c3f97941a17
---
M ggsn_tests/GGSN_Tests.cfg
A ggsn_tests/GGSN_Tests.default
2 files changed, 24 insertions(+), 29 deletions(-)


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

diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg
index 67fcbd4..b7c0988 100644
--- a/ggsn_tests/GGSN_Tests.cfg
+++ b/ggsn_tests/GGSN_Tests.cfg
@@ -1,38 +1,17 @@
-[LOGGING]
-SourceInfoFormat := Single;
-ConsoleMask := DEBUG | LOG_ALL | MATCHING | DEBUG_TESTPORT
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./GGSN_Tests.default"
 
-LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
-#*.JUnitLogger.filename_stem := "MyJunitLogFile"
+# Local configuration below
+
+[LOGGING]
 *.JUnitLogger.testsuite_name := "osmo-ttcn3-hacks/ggsn_tests"
 
 
 [TESTPORT_PARAMETERS]
-*.*.lazy_conn_id_handling := "YES"
-system.*.lazy_conn_id_handling := "YES"
 
 [MODULE_PARAMETERS]
-GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1"
-GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1"
-GGSN_Tests.m_ggsn_ip_gtpc := "127.0.0.2"
-GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2"
-GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1"
-GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8"
-GGSN_Tests.m_ggsn_ip6_dns1 := "2001:4860:4860::"
-GGSN_Tests.m_ggsn_ip6_dns2 := "2001:4860:4860::8844"
 
 [EXECUTE]
-#GGSN_Tests.TC_dummy
-GGSN_Tests.TC_pdp4_act_deact
-GGSN_Tests.TC_pdp4_act_deact_ipcp
-GGSN_Tests.TC_pdp4_act_deact_pcodns
-GGSN_Tests.TC_pdp4_act_deact_gtpu_access
-GGSN_Tests.TC_pdp6_clients_interact
-
-GGSN_Tests.TC_pdp6_act_deact
-GGSN_Tests.TC_pdp6_act_deact_pcodns
-GGSN_Tests.TC_pdp6_act_deact_icmp6
-GGSN_Tests.TC_pdp6_act_deact_gtpu_access
-GGSN_Tests.TC_pdp4_clients_interact
-
-GGSN_Tests.TC_echo_req_resp
diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default
new file mode 100644
index 000..7b9fe69
--- /dev/null
+++ b/ggsn_tests/GGSN_Tests.default
@@ -0,0 +1,16 @@
+[LOGGING]
+
+[TESTPORT_PARAMETERS]
+
+[MODULE_PARAMETERS]
+GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1"
+GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1"
+GGSN_Tests.m_ggsn_ip_gtpc := "127.0.0.2"
+GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2"
+GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1"
+GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8"
+GGSN_Tests.m_ggsn_ip6_dns1 := "2001:4860:4860::"
+GGSN_Tests.m_ggsn_ip6_dns2 := "2001:4860:4860::8844"
+
+[EXECUTE]
+GGSN_Tests.control

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I491819c8bad8efa45cee161ea6f47c3f97941a17
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


osmo-ttcn3-hacks[master]: ggsn: Switch over to new shared/common configuration file la...

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I491819c8bad8efa45cee161ea6f47c3f97941a17
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: ggsn: Switch over to new shared/common configuration file la...

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: ggsn: Switch over to new shared/common configuration file layout
..


ggsn: Switch over to new shared/common configuration file layout

Change-Id: I491819c8bad8efa45cee161ea6f47c3f97941a17
---
M ggsn_tests/GGSN_Tests.cfg
A ggsn_tests/GGSN_Tests.default
2 files changed, 24 insertions(+), 29 deletions(-)

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



diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg
index 67fcbd4..b7c0988 100644
--- a/ggsn_tests/GGSN_Tests.cfg
+++ b/ggsn_tests/GGSN_Tests.cfg
@@ -1,38 +1,17 @@
-[LOGGING]
-SourceInfoFormat := Single;
-ConsoleMask := DEBUG | LOG_ALL | MATCHING | DEBUG_TESTPORT
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./GGSN_Tests.default"
 
-LoggerPlugins := { JUnitLogger := "libjunitlogger2" }
-#*.JUnitLogger.filename_stem := "MyJunitLogFile"
+# Local configuration below
+
+[LOGGING]
 *.JUnitLogger.testsuite_name := "osmo-ttcn3-hacks/ggsn_tests"
 
 
 [TESTPORT_PARAMETERS]
-*.*.lazy_conn_id_handling := "YES"
-system.*.lazy_conn_id_handling := "YES"
 
 [MODULE_PARAMETERS]
-GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1"
-GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1"
-GGSN_Tests.m_ggsn_ip_gtpc := "127.0.0.2"
-GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2"
-GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1"
-GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8"
-GGSN_Tests.m_ggsn_ip6_dns1 := "2001:4860:4860::"
-GGSN_Tests.m_ggsn_ip6_dns2 := "2001:4860:4860::8844"
 
 [EXECUTE]
-#GGSN_Tests.TC_dummy
-GGSN_Tests.TC_pdp4_act_deact
-GGSN_Tests.TC_pdp4_act_deact_ipcp
-GGSN_Tests.TC_pdp4_act_deact_pcodns
-GGSN_Tests.TC_pdp4_act_deact_gtpu_access
-GGSN_Tests.TC_pdp6_clients_interact
-
-GGSN_Tests.TC_pdp6_act_deact
-GGSN_Tests.TC_pdp6_act_deact_pcodns
-GGSN_Tests.TC_pdp6_act_deact_icmp6
-GGSN_Tests.TC_pdp6_act_deact_gtpu_access
-GGSN_Tests.TC_pdp4_clients_interact
-
-GGSN_Tests.TC_echo_req_resp
diff --git a/ggsn_tests/GGSN_Tests.default b/ggsn_tests/GGSN_Tests.default
new file mode 100644
index 000..7b9fe69
--- /dev/null
+++ b/ggsn_tests/GGSN_Tests.default
@@ -0,0 +1,16 @@
+[LOGGING]
+
+[TESTPORT_PARAMETERS]
+
+[MODULE_PARAMETERS]
+GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1"
+GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1"
+GGSN_Tests.m_ggsn_ip_gtpc := "127.0.0.2"
+GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2"
+GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1"
+GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8"
+GGSN_Tests.m_ggsn_ip6_dns1 := "2001:4860:4860::"
+GGSN_Tests.m_ggsn_ip6_dns2 := "2001:4860:4860::8844"
+
+[EXECUTE]
+GGSN_Tests.control

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I491819c8bad8efa45cee161ea6f47c3f97941a17
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


Build failure of network:osmocom:nightly/libosmo-abis in Debian_9.0/aarch64

2018-02-14 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/libosmo-abis/Debian_9.0/aarch64

Package network:osmocom:nightly/libosmo-abis failed to build in 
Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly libosmo-abis

Last lines of build log:
[ ***  ] A start job is running for 
dev-disk...2d0.device (4min 53s / no limit)
[***   ] A start job is running for 
dev-disk...2d0.device (4min 54s / no limit)
[**] A start job is running for 
dev-disk...2d0.device (4min 54s / no limit)
[* ] A start job is running for dev-disk...2d0.device 
(4min 55s / no limit)
[**] A start job is running for 
dev-disk...2d0.device (4min 55s / no limit)
[***   ] A start job is running for 
dev-disk...2d0.device (4min 56s / no limit)
[ ***  ] A start job is running for 
dev-disk...2d0.device (4min 56s / no limit)
[  *** ] A start job is running for 
dev-disk...2d0.device (4min 57s / no limit)
[   ***] A start job is running for 
dev-disk...2d0.device (4min 57s / no limit)
[**] A start job is running for 
dev-disk...2d0.device (4min 58s / no limit)
[ *] A start job is running for dev-disk...2d0.device (4min 
58s / no limit)
[**] A start job is running for 
dev-disk...2d0.device (4min 59s / no limit)
[   ***] A start job is running for 
dev-disk...2d0.device (4min 59s / no limit)
[  *** ] A start job is running for 
dev-disk...io\x2d0.device (5min / no limit)
[ ***  ] A start job is running for 
dev-disk...io\x2d0.device (5min / no limit)
[***   ] A start job is running for 
dev-disk...x2d0.device (5min 1s / no limit)
[**] A start job is running for 
dev-disk...x2d0.device (5min 1s / no limit)
[* ] A start job is running for dev-disk...x2d0.device 
(5min 2s / no limit)
[**] A start job is running for 
dev-disk...x2d0.device (5min 2s / no limit)
[***   ] A start job is running for 
dev-disk...x2d0.device (5min 3s / no limit)### WATCHDOG TRIGGERED, KILLING VM 
###
[  316s] /var/cache/obs/worker/root_3/root:  8147
[  316s] qemu-system-aarch64: terminating on signal 15 from pid 8497
[  316s] qemu-system-aarch64: Failed to unlink socket 
/var/cache/obs/worker/root_3/root.monitor: Permission denied
[  316s] ### VM INTERACTION END ###
[  316s] /var/run/obs/worker/3/build/build-vm: line 458: kill: (8142) - No such 
process
[  316s] No buildstatus set, either the base system is broken 
(kernel/initrd/udev/glibc/bash/perl)
[  316s] or the build host has a kernel or hardware problem...

gave up after 10 failed build attempts...

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


Build failure of network:osmocom:nightly/osmo-pcap in Debian_9.0/aarch64

2018-02-14 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcap/Debian_9.0/aarch64

Package network:osmocom:nightly/osmo-pcap failed to build in Debian_9.0/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-pcap

Last lines of build log:
[**] A start job is running for 
dev-disk…\x2d0.device (4min 59s / no limit)
[***   ] A start job is running for 
dev-disk…rtio\x2d0.device (5min / no limit)
[ ***  ] A start job is running for 
dev-disk…rtio\x2d0.device (5min / no limit)
[  *** ] A start job is running for 
dev-disk…o\x2d0.device (5min 1s / no limit)
[   ***] A start job is running for 
dev-disk…o\x2d0.device (5min 1s / no limit)
[**] A start job is running for 
dev-disk…o\x2d0.device (5min 2s / no limit)
[ *] A start job is running for dev-disk…o\x2d0.device (5min 
2s / no limit)
[**] A start job is running for 
dev-disk…o\x2d0.device (5min 3s / no limit)
[   ***] A start job is running for 
dev-disk…o\x2d0.device (5min 3s / no limit)
[  *** ] A start job is running for 
dev-disk…o\x2d0.device (5min 4s / no limit)
[ ***  ] A start job is running for 
dev-disk…o\x2d0.device (5min 4s / no limit)
[***   ] A start job is running for 
dev-disk…o\x2d0.device (5min 5s / no limit)
[**] A start job is running for 
dev-disk…o\x2d0.device (5min 5s / no limit)
[* ] A start job is running for dev-disk…o\x2d0.device 
(5min 6s / no limit)
[**] A start job is running for 
dev-disk…o\x2d0.device (5min 6s / no limit)
[***   ] A start job is running for 
dev-disk…o\x2d0.device (5min 7s / no limit)
[ ***  ] A start job is running for 
dev-disk…o\x2d0.device (5min 7s / no limit)
[  *** ] A start job is running for 
dev-disk…o\x2d0.device (5min 8s / no limit)
[   ***] A start job is running for 
dev-disk…o\x2d0.device (5min 8s / no limit)### WATCHDOG TRIGGERED, KILLING VM 
###
[  328s] /var/cache/obs/worker/root_4/root: 14478
[  328s] qemu-system-aarch64: terminating on signal 15 from pid 14802 ()
[  328s] qemu-system-aarch64: Failed to unlink socket 
/var/cache/obs/worker/root_4/root.monitor: Permission denied
[  328s] ### VM INTERACTION END ###
[  328s] /var/run/obs/worker/4/build/build-vm: line 458: kill: (14473) - No 
such process
[  328s] /var/run/obs/worker/4/build/build-vm: line 917: warning: command 
substitution: ignored null byte in input
[  328s] No buildstatus set, either the base system is broken 
(kernel/initrd/udev/glibc/bash/perl)
[  328s] or the build host has a kernel or hardware problem...

gave up after 12 failed build attempts...

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


[PATCH] osmo-bsc[master]: libcommon-cs: move gsm_network_init() into bsc_network_init()

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6438

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

libcommon-cs: move gsm_network_init() into bsc_network_init()

Some part of the network init was common between libbsc and libmsc in the old
openbsc.git repository. Now osmo-bsc.git is independent with its own copy of
the gsm_network initialization. So move it over to libbsc.

Change-Id: I8968787a5f0b078619264f0cb42349a9bc7943af
---
M include/osmocom/bsc/common_cs.h
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs.c
3 files changed, 15 insertions(+), 38 deletions(-)


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

diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index c2e8515..432d4d5 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -16,10 +16,6 @@
uint8_t key[MAX_A5_KEY_LEN];
 };
 
-struct gsm_network *gsm_network_init(void *ctx,
-uint16_t country_code,
-uint16_t network_code);
-
 int common_cs_vty_init(struct gsm_network *network,
  int (* config_write_net )(struct vty *));
 struct gsm_network *gsmnet_from_vty(struct vty *v);
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 435c0ce..4fa59ed 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -45,7 +45,21 @@
 {
struct gsm_network *net;
 
-   net = gsm_network_init(ctx, country_code, network_code);
+   net = talloc_zero(ctx, struct gsm_network);
+   if (!net)
+   return NULL;
+
+   net->country_code = country_code;
+   net->network_code = network_code;
+
+   /* Use 30 min periodic update interval as sane default */
+   net->t3212 = 5;
+
+   INIT_LLIST_HEAD(&net->trans_list);
+   INIT_LLIST_HEAD(&net->subscr_conns);
+
+   net->bsc_subscribers = talloc_zero(net, struct llist_head);
+   INIT_LLIST_HEAD(net->bsc_subscribers);
 
net->bsc_data = talloc_zero(net, struct osmo_bsc_data);
if (!net->bsc_data) {
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index 39df45e..0520e96 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -30,39 +30,6 @@
 #include 
 #include 
 
-/* Warning: if bsc_network_init() is not called, some of the members of
- * gsm_network are not initialized properly and must not be used! (In
- * particular the llist heads and stats counters.)
- * The long term aim should be to have entirely separate structs for libbsc and
- * libmsc with some common general items.
- */
-struct gsm_network *gsm_network_init(void *ctx,
-uint16_t country_code,
-uint16_t network_code)
-{
-   struct gsm_network *net;
-
-   net = talloc_zero(ctx, struct gsm_network);
-   if (!net)
-   return NULL;
-
-   net->country_code = country_code;
-   net->network_code = network_code;
-
-   /* Use 30 min periodic update interval as sane default */
-   net->t3212 = 5;
-
-   INIT_LLIST_HEAD(&net->trans_list);
-   INIT_LLIST_HEAD(&net->subscr_conns);
-
-   net->bsc_subscribers = talloc_zero(net, struct llist_head);
-   INIT_LLIST_HEAD(net->bsc_subscribers);
-
-   net->dyn_ts_allow_tch_f = true;
-
-   return net;
-}
-
 struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
 {
struct msgb *msg;

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

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


[PATCH] osmo-bsc[master]: gsm_network: drop unused trans_list

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6439

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

gsm_network: drop unused trans_list

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


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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index a0f2114..1d12f3d 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1144,12 +1144,6 @@
 
struct rate_ctr_group *bsc_ctrs;
 
-   /*
-* TODO: Move the trans_list into the subscriber connection and
-* create a pending list for MT transactions. These exist before
-* we have a subscriber connection.
-*/
-   struct llist_head trans_list;
struct bsc_api *bsc_api;
 
unsigned int num_bts;
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 4fa59ed..c5c7c5e 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -55,7 +55,6 @@
/* Use 30 min periodic update interval as sane default */
net->t3212 = 5;
 
-   INIT_LLIST_HEAD(&net->trans_list);
INIT_LLIST_HEAD(&net->subscr_conns);
 
net->bsc_subscribers = talloc_zero(net, struct llist_head);

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

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


[MERGED] osmo-bsc[master]: gsm_network: drop unused subscr_epxire_timer

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: gsm_network: drop unused subscr_epxire_timer
..


gsm_network: drop unused subscr_epxire_timer

Change-Id: I2e34ffb35e244472f8bfc993facc8d6e130f10d9
---
M include/osmocom/bsc/gsm_data.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/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index fc745a2..3da4fff 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1169,9 +1169,6 @@
int T3122;
int T3141;
 
-   /* timer to expire old location updates */
-   struct osmo_timer_list subscr_expire_timer;
-
enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T];
 
/* Use a TCH for handling requests of type paging any */

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

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


[PATCH] osmo-bsc[master]: common_cs.h: mv gsm_encr to gsm_data.h

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6442

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

common_cs.h: mv gsm_encr to gsm_data.h

This leaves common_cs.h practically empty. Leave its removal to the next patch,
which removes libcommon-cs entirely
(I07d4a48af3154ee4d904686f230a51b8b8a94ff9).

Change-Id: Ic3233f03580aa8c0ab178dfd33e68ecab5b9f042
---
M include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_data.h
2 files changed, 8 insertions(+), 8 deletions(-)


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

diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index f751a43..b6a8ed8 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -7,11 +7,3 @@
 struct gsm_network;
 
 struct vty;
-
-#define MAX_A5_KEY_LEN (128/8)
-
-struct gsm_encr {
-   uint8_t alg_id;
-   uint8_t key_len;
-   uint8_t key[MAX_A5_KEY_LEN];
-};
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1d12f3d..8af594f 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -300,6 +300,14 @@
LCHAN_SAPI_S_ERROR,
 };
 
+#define MAX_A5_KEY_LEN (128/8)
+
+struct gsm_encr {
+   uint8_t alg_id;
+   uint8_t key_len;
+   uint8_t key[MAX_A5_KEY_LEN];
+};
+
 struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;

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

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


[MERGED] osmo-bsc[master]: libcommon_cs: move gsm48 bits to libbsc

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: libcommon_cs: move gsm48 bits to libbsc
..


libcommon_cs: move gsm48 bits to libbsc

These functions were originally shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copies, so move them into libbsc.

Change-Id: Ie411c2ce8008accee54782a442d6361e50777a54
---
M include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_04_08_utils.h
M src/libbsc/gsm_04_08_utils.c
M src/libcommon-cs/common_cs.c
M src/libfilter/bsc_msg_filter.c
M src/osmo-bsc/osmo_bsc_filter.c
6 files changed, 65 insertions(+), 63 deletions(-)

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



diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index 432d4d5..dccc7b5 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -19,9 +19,3 @@
 int common_cs_vty_init(struct gsm_network *network,
  int (* config_write_net )(struct vty *));
 struct gsm_network *gsmnet_from_vty(struct vty *v);
-
-struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
-int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type);
-int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
-   char *mi_string, uint8_t *mi_type);
-struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
diff --git a/include/osmocom/bsc/gsm_04_08_utils.h 
b/include/osmocom/bsc/gsm_04_08_utils.h
index 625f173..34979ab 100644
--- a/include/osmocom/bsc/gsm_04_08_utils.h
+++ b/include/osmocom/bsc/gsm_04_08_utils.h
@@ -22,6 +22,12 @@
 int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
 enum gsm48_reject_value value);
 
+struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
+int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type);
+int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
+   char *mi_string, uint8_t *mi_type);
+struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
+
 #define GSM48_ALLOC_SIZE2048
 #define GSM48_ALLOC_HEADROOM256
 
diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c
index 85eb7b5..3004e5d 100644
--- a/src/libbsc/gsm_04_08_utils.c
+++ b/src/libbsc/gsm_04_08_utils.c
@@ -636,3 +636,60 @@
 
return gsm0808_submit_dtap(conn, msg, 0, 0);
 }
+
+struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
+{
+   struct msgb *msg;
+   struct gsm48_hdr *gh;
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ");
+   if (!msg)
+   return NULL;
+
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+   gh->proto_discr = GSM48_PDISC_MM;
+   gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
+   gh->data[0] = value;
+
+   return msg;
+}
+
+struct msgb *gsm48_create_loc_upd_rej(uint8_t cause)
+{
+   struct gsm48_hdr *gh;
+   struct msgb *msg;
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ");
+   if (!msg)
+   return NULL;
+
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+   gh->proto_discr = GSM48_PDISC_MM;
+   gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT;
+   gh->data[0] = cause;
+   return msg;
+}
+
+int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type)
+{
+   /* Check the size for the classmark */
+   if (length < 1 + *classmark2_lv)
+   return -1;
+
+   uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1;
+   if (length < 2 + *classmark2_lv + mi_lv[0])
+   return -2;
+
+   *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK;
+   return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv);
+}
+
+int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
+   char *mi_string, uint8_t *mi_type)
+{
+   static const uint32_t classmark_offset =
+   offsetof(struct gsm48_pag_resp, classmark2);
+   uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2;
+   return gsm48_extract_mi(classmark2_lv, length - classmark_offset,
+   mi_string, mi_type);
+}
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index 0520e96..9307f63 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -30,59 +30,3 @@
 #include 
 #include 
 
-struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
-{
-   struct msgb *msg;
-   struct gsm48_hdr *gh;
-
-   msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ");
-   if (!msg)
-   return NULL;
-
-   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
-   gh->proto_discr = GSM48_PDISC_MM;
-   gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
-   gh->data[0] = va

[MERGED] osmo-bsc[master]: gsm_network: drop unused trans_list

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: gsm_network: drop unused trans_list
..


gsm_network: drop unused trans_list

Change-Id: I7910ce8098d5431e41409bf09429ae4221efb360
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/net_init.c
2 files changed, 0 insertions(+), 7 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 a0f2114..1d12f3d 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1144,12 +1144,6 @@
 
struct rate_ctr_group *bsc_ctrs;
 
-   /*
-* TODO: Move the trans_list into the subscriber connection and
-* create a pending list for MT transactions. These exist before
-* we have a subscriber connection.
-*/
-   struct llist_head trans_list;
struct bsc_api *bsc_api;
 
unsigned int num_bts;
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 4fa59ed..c5c7c5e 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -55,7 +55,6 @@
/* Use 30 min periodic update interval as sane default */
net->t3212 = 5;
 
-   INIT_LLIST_HEAD(&net->trans_list);
INIT_LLIST_HEAD(&net->subscr_conns);
 
net->bsc_subscribers = talloc_zero(net, struct llist_head);

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

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


[MERGED] osmo-bsc[master]: common_cs.h: mv gsm_encr to gsm_data.h

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: common_cs.h: mv gsm_encr to gsm_data.h
..


common_cs.h: mv gsm_encr to gsm_data.h

This leaves common_cs.h practically empty. Leave its removal to the next patch,
which removes libcommon-cs entirely
(I07d4a48af3154ee4d904686f230a51b8b8a94ff9).

Change-Id: Ic3233f03580aa8c0ab178dfd33e68ecab5b9f042
---
M include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_data.h
2 files changed, 8 insertions(+), 8 deletions(-)

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



diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index f751a43..b6a8ed8 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -7,11 +7,3 @@
 struct gsm_network;
 
 struct vty;
-
-#define MAX_A5_KEY_LEN (128/8)
-
-struct gsm_encr {
-   uint8_t alg_id;
-   uint8_t key_len;
-   uint8_t key[MAX_A5_KEY_LEN];
-};
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1d12f3d..8af594f 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -300,6 +300,14 @@
LCHAN_SAPI_S_ERROR,
 };
 
+#define MAX_A5_KEY_LEN (128/8)
+
+struct gsm_encr {
+   uint8_t alg_id;
+   uint8_t key_len;
+   uint8_t key[MAX_A5_KEY_LEN];
+};
+
 struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;

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

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


[PATCH] osmo-bsc[master]: libcommon-cs: move a_reset.c into libbsc

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6437

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

libcommon-cs: move a_reset.c into libbsc

a_reset.c was originally used by both libmsc and libbsc in the old openbsc.git
repository. Now osmo-msc.git has its own copy, and the idea of sharing
libcommon-cs is no longer applicable. Move it to libbsc where it belongs.

Change-Id: I30e4b5dab9c6d761d20a3a0e5b9ec2d65e64ebc5
---
M src/libbsc/Makefile.am
R src/libbsc/a_reset.c
M src/libcommon-cs/Makefile.am
3 files changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index f03b498..e68ada8 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -27,6 +27,7 @@
abis_om2000.c \
abis_om2000_vty.c \
abis_rsl.c \
+   a_reset.c \
bsc_rll.c \
bsc_subscriber.c \
paging.c \
diff --git a/src/libcommon-cs/a_reset.c b/src/libbsc/a_reset.c
similarity index 100%
rename from src/libcommon-cs/a_reset.c
rename to src/libbsc/a_reset.c
diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am
index 8cca1d7..e549509 100644
--- a/src/libcommon-cs/Makefile.am
+++ b/src/libcommon-cs/Makefile.am
@@ -17,6 +17,5 @@
 noinst_LIBRARIES = libcommon-cs.a
 
 libcommon_cs_a_SOURCES = \
-   a_reset.c \
common_cs.c \
common_cs_vty.c

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

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


[PATCH] osmo-bsc[master]: libcommon_cs: move gsm48 bits to libbsc

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6440

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

libcommon_cs: move gsm48 bits to libbsc

These functions were originally shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copies, so move them into libbsc.

Change-Id: Ie411c2ce8008accee54782a442d6361e50777a54
---
M include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_04_08_utils.h
M src/libbsc/gsm_04_08_utils.c
M src/libcommon-cs/common_cs.c
M src/libfilter/bsc_msg_filter.c
M src/osmo-bsc/osmo_bsc_filter.c
6 files changed, 65 insertions(+), 63 deletions(-)


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

diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index 432d4d5..dccc7b5 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -19,9 +19,3 @@
 int common_cs_vty_init(struct gsm_network *network,
  int (* config_write_net )(struct vty *));
 struct gsm_network *gsmnet_from_vty(struct vty *v);
-
-struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
-int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type);
-int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
-   char *mi_string, uint8_t *mi_type);
-struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
diff --git a/include/osmocom/bsc/gsm_04_08_utils.h 
b/include/osmocom/bsc/gsm_04_08_utils.h
index 625f173..34979ab 100644
--- a/include/osmocom/bsc/gsm_04_08_utils.h
+++ b/include/osmocom/bsc/gsm_04_08_utils.h
@@ -22,6 +22,12 @@
 int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
 enum gsm48_reject_value value);
 
+struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
+int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type);
+int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
+   char *mi_string, uint8_t *mi_type);
+struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
+
 #define GSM48_ALLOC_SIZE2048
 #define GSM48_ALLOC_HEADROOM256
 
diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c
index 85eb7b5..3004e5d 100644
--- a/src/libbsc/gsm_04_08_utils.c
+++ b/src/libbsc/gsm_04_08_utils.c
@@ -636,3 +636,60 @@
 
return gsm0808_submit_dtap(conn, msg, 0, 0);
 }
+
+struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
+{
+   struct msgb *msg;
+   struct gsm48_hdr *gh;
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ");
+   if (!msg)
+   return NULL;
+
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+   gh->proto_discr = GSM48_PDISC_MM;
+   gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
+   gh->data[0] = value;
+
+   return msg;
+}
+
+struct msgb *gsm48_create_loc_upd_rej(uint8_t cause)
+{
+   struct gsm48_hdr *gh;
+   struct msgb *msg;
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ");
+   if (!msg)
+   return NULL;
+
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+   gh->proto_discr = GSM48_PDISC_MM;
+   gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT;
+   gh->data[0] = cause;
+   return msg;
+}
+
+int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type)
+{
+   /* Check the size for the classmark */
+   if (length < 1 + *classmark2_lv)
+   return -1;
+
+   uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1;
+   if (length < 2 + *classmark2_lv + mi_lv[0])
+   return -2;
+
+   *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK;
+   return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv);
+}
+
+int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
+   char *mi_string, uint8_t *mi_type)
+{
+   static const uint32_t classmark_offset =
+   offsetof(struct gsm48_pag_resp, classmark2);
+   uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2;
+   return gsm48_extract_mi(classmark2_lv, length - classmark_offset,
+   mi_string, mi_type);
+}
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index 0520e96..9307f63 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -30,59 +30,3 @@
 #include 
 #include 
 
-struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
-{
-   struct msgb *msg;
-   struct gsm48_hdr *gh;
-
-   msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ");
-   if (!msg)
-   return NULL;
-
-   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
-   gh->proto_discr = GSM48_PDISC_MM;
-   gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
-   gh->data[0] = value;
-
-   return msg;
-}
-
-str

[PATCH] osmo-bsc[master]: libcommon-cs: move vty bits to libbsc/bsc_vty.c

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6441

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

libcommon-cs: move vty bits to libbsc/bsc_vty.c

The gsm_network VTY was partly shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copy, so merge all of it into
bsc_vty.c.

This leaves common_cs_vty.c practically empty; leave removal of the file to
later, when we drop the entire libcommon-cs in
I07d4a48af3154ee4d904686f230a51b8b8a94ff9.

Note that gsmnet_from_vty() is also already declared in bsc/vty.h.

Change-Id: I6f3a596f31762b48afed39a85a343c400826300f
---
M include/osmocom/bsc/common_cs.h
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
3 files changed, 197 insertions(+), 209 deletions(-)


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

diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index dccc7b5..f751a43 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -15,7 +15,3 @@
uint8_t key_len;
uint8_t key[MAX_A5_KEY_LEN];
 };
-
-int common_cs_vty_init(struct gsm_network *network,
- int (* config_write_net )(struct vty *));
-struct gsm_network *gsmnet_from_vty(struct vty *v);
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index a719358..1407061 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -115,6 +115,12 @@
{ 0, NULL }
 };
 
+struct cmd_node net_node = {
+   GSMNET_NODE,
+   "%s(config-net)# ",
+   1,
+};
+
 struct cmd_node bts_node = {
BTS_NODE,
"%s(config-net-bts)# ",
@@ -132,6 +138,20 @@
"%s(config-net-bts-trx-ts)# ",
1,
 };
+
+static struct gsm_network *vty_global_gsm_network = NULL;
+
+struct gsm_network *gsmnet_from_vty(struct vty *v)
+{
+   /* It can't hurt to force callers to continue to pass the vty instance
+* to this function, in case we'd like to retrieve the global
+* gsm_network instance from the vty at some point in the future. But
+* until then, just return the global pointer, which should have been
+* initialized by common_cs_vty_init().
+*/
+   OSMO_ASSERT(vty_global_gsm_network);
+   return vty_global_gsm_network;
+}
 
 static int dummy_config_write(struct vty *v)
 {
@@ -4269,6 +4289,167 @@
return CMD_SUCCESS;
 }
 
+#define NETWORK_STR "Configure the GSM network\n"
+#define CODE_CMD_STR "Code commands\n"
+#define NAME_CMD_STR "Name Commands\n"
+#define NAME_STR "Name to use\n"
+
+DEFUN(cfg_net,
+  cfg_net_cmd,
+  "network", NETWORK_STR)
+{
+   vty->index = gsmnet_from_vty(vty);
+   vty->node = GSMNET_NODE;
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_ncc,
+  cfg_net_ncc_cmd,
+  "network country code <1-999>",
+  "Set the GSM network country code\n"
+  "Country commands\n"
+  CODE_CMD_STR
+  "Network Country Code to use\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+   gsmnet->country_code = atoi(argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_mnc,
+  cfg_net_mnc_cmd,
+  "mobile network code <0-999>",
+  "Set the GSM mobile network code\n"
+  "Network Commands\n"
+  CODE_CMD_STR
+  "Mobile Network Code to use\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+   gsmnet->network_code = atoi(argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_encryption,
+  cfg_net_encryption_cmd,
+  "encryption a5 (0|1|2|3)",
+   "Encryption options\n"
+   "A5 encryption\n" "A5/0: No encryption\n"
+   "A5/1: Encryption\n" "A5/2: Export-grade Encryption\n"
+   "A5/3: 'New' Secure Encryption\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+   gsmnet->a5_encryption = atoi(argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_dyn_ts_allow_tch_f,
+  cfg_net_dyn_ts_allow_tch_f_cmd,
+  "dyn_ts_allow_tch_f (0|1)",
+  "Allow or disallow allocating TCH/F on TCH_F_TCH_H_PDCH timeslots\n"
+  "Disallow TCH/F on TCH_F_TCH_H_PDCH (default)\n"
+  "Allow TCH/F on TCH_F_TCH_H_PDCH\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+   gsmnet->dyn_ts_allow_tch_f = atoi(argv[0]) ? true : false;
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_timezone,
+  cfg_net_timezone_cmd,
+  "timezone <-19-19> (0|15|30|45)",
+  "Set the Timezone Offset of the network\n"
+  "Timezone offset (hours)\n"
+  "Timezone offset (00 minutes)\n"
+  "Timezone offset (15 minutes)\n"
+  "Timezone offset (30 minutes)\n"
+  "Timezone offset (45 minutes)\n"
+  )
+{
+   struct gsm_network *net = vty->index;
+   int tzhr = atoi(argv[0]);
+   int tzmn = atoi(argv[1]);
+
+   net->tz.hr = tzhr;
+   net->tz.mn = tzmn;
+   net->tz.dst = 0;
+   net->tz.override = 1;
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_n

[MERGED] osmo-bsc[master]: libcommon-cs: move gsm_network_init() into bsc_network_init()

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: libcommon-cs: move gsm_network_init() into bsc_network_init()
..


libcommon-cs: move gsm_network_init() into bsc_network_init()

Some part of the network init was common between libbsc and libmsc in the old
openbsc.git repository. Now osmo-bsc.git is independent with its own copy of
the gsm_network initialization. So move it over to libbsc.

Change-Id: I8968787a5f0b078619264f0cb42349a9bc7943af
---
M include/osmocom/bsc/common_cs.h
M src/libbsc/net_init.c
M src/libcommon-cs/common_cs.c
3 files changed, 15 insertions(+), 38 deletions(-)

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



diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index c2e8515..432d4d5 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -16,10 +16,6 @@
uint8_t key[MAX_A5_KEY_LEN];
 };
 
-struct gsm_network *gsm_network_init(void *ctx,
-uint16_t country_code,
-uint16_t network_code);
-
 int common_cs_vty_init(struct gsm_network *network,
  int (* config_write_net )(struct vty *));
 struct gsm_network *gsmnet_from_vty(struct vty *v);
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index 435c0ce..4fa59ed 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -45,7 +45,21 @@
 {
struct gsm_network *net;
 
-   net = gsm_network_init(ctx, country_code, network_code);
+   net = talloc_zero(ctx, struct gsm_network);
+   if (!net)
+   return NULL;
+
+   net->country_code = country_code;
+   net->network_code = network_code;
+
+   /* Use 30 min periodic update interval as sane default */
+   net->t3212 = 5;
+
+   INIT_LLIST_HEAD(&net->trans_list);
+   INIT_LLIST_HEAD(&net->subscr_conns);
+
+   net->bsc_subscribers = talloc_zero(net, struct llist_head);
+   INIT_LLIST_HEAD(net->bsc_subscribers);
 
net->bsc_data = talloc_zero(net, struct osmo_bsc_data);
if (!net->bsc_data) {
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index 39df45e..0520e96 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -30,39 +30,6 @@
 #include 
 #include 
 
-/* Warning: if bsc_network_init() is not called, some of the members of
- * gsm_network are not initialized properly and must not be used! (In
- * particular the llist heads and stats counters.)
- * The long term aim should be to have entirely separate structs for libbsc and
- * libmsc with some common general items.
- */
-struct gsm_network *gsm_network_init(void *ctx,
-uint16_t country_code,
-uint16_t network_code)
-{
-   struct gsm_network *net;
-
-   net = talloc_zero(ctx, struct gsm_network);
-   if (!net)
-   return NULL;
-
-   net->country_code = country_code;
-   net->network_code = network_code;
-
-   /* Use 30 min periodic update interval as sane default */
-   net->t3212 = 5;
-
-   INIT_LLIST_HEAD(&net->trans_list);
-   INIT_LLIST_HEAD(&net->subscr_conns);
-
-   net->bsc_subscribers = talloc_zero(net, struct llist_head);
-   INIT_LLIST_HEAD(net->bsc_subscribers);
-
-   net->dyn_ts_allow_tch_f = true;
-
-   return net;
-}
-
 struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
 {
struct msgb *msg;

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

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


[PATCH] osmo-bsc[master]: gsm_network: drop unused subscr_epxire_timer

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6445

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

gsm_network: drop unused subscr_epxire_timer

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


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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index fc745a2..3da4fff 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1169,9 +1169,6 @@
int T3122;
int T3141;
 
-   /* timer to expire old location updates */
-   struct osmo_timer_list subscr_expire_timer;
-
enum gsm_chan_t ctype_by_chreq[_NUM_CHREQ_T];
 
/* Use a TCH for handling requests of type paging any */

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

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


[MERGED] osmo-bsc[master]: libcommon-cs: move vty bits to libbsc/bsc_vty.c

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: libcommon-cs: move vty bits to libbsc/bsc_vty.c
..


libcommon-cs: move vty bits to libbsc/bsc_vty.c

The gsm_network VTY was partly shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copy, so merge all of it into
bsc_vty.c.

This leaves common_cs_vty.c practically empty; leave removal of the file to
later, when we drop the entire libcommon-cs in
I07d4a48af3154ee4d904686f230a51b8b8a94ff9.

Note that gsmnet_from_vty() is also already declared in bsc/vty.h.

Change-Id: I6f3a596f31762b48afed39a85a343c400826300f
---
M include/osmocom/bsc/common_cs.h
M src/libbsc/bsc_vty.c
M src/libcommon-cs/common_cs_vty.c
3 files changed, 197 insertions(+), 209 deletions(-)

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



diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index dccc7b5..f751a43 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -15,7 +15,3 @@
uint8_t key_len;
uint8_t key[MAX_A5_KEY_LEN];
 };
-
-int common_cs_vty_init(struct gsm_network *network,
- int (* config_write_net )(struct vty *));
-struct gsm_network *gsmnet_from_vty(struct vty *v);
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index a719358..1407061 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -115,6 +115,12 @@
{ 0, NULL }
 };
 
+struct cmd_node net_node = {
+   GSMNET_NODE,
+   "%s(config-net)# ",
+   1,
+};
+
 struct cmd_node bts_node = {
BTS_NODE,
"%s(config-net-bts)# ",
@@ -132,6 +138,20 @@
"%s(config-net-bts-trx-ts)# ",
1,
 };
+
+static struct gsm_network *vty_global_gsm_network = NULL;
+
+struct gsm_network *gsmnet_from_vty(struct vty *v)
+{
+   /* It can't hurt to force callers to continue to pass the vty instance
+* to this function, in case we'd like to retrieve the global
+* gsm_network instance from the vty at some point in the future. But
+* until then, just return the global pointer, which should have been
+* initialized by common_cs_vty_init().
+*/
+   OSMO_ASSERT(vty_global_gsm_network);
+   return vty_global_gsm_network;
+}
 
 static int dummy_config_write(struct vty *v)
 {
@@ -4269,6 +4289,167 @@
return CMD_SUCCESS;
 }
 
+#define NETWORK_STR "Configure the GSM network\n"
+#define CODE_CMD_STR "Code commands\n"
+#define NAME_CMD_STR "Name Commands\n"
+#define NAME_STR "Name to use\n"
+
+DEFUN(cfg_net,
+  cfg_net_cmd,
+  "network", NETWORK_STR)
+{
+   vty->index = gsmnet_from_vty(vty);
+   vty->node = GSMNET_NODE;
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_ncc,
+  cfg_net_ncc_cmd,
+  "network country code <1-999>",
+  "Set the GSM network country code\n"
+  "Country commands\n"
+  CODE_CMD_STR
+  "Network Country Code to use\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+   gsmnet->country_code = atoi(argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_mnc,
+  cfg_net_mnc_cmd,
+  "mobile network code <0-999>",
+  "Set the GSM mobile network code\n"
+  "Network Commands\n"
+  CODE_CMD_STR
+  "Mobile Network Code to use\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+   gsmnet->network_code = atoi(argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_encryption,
+  cfg_net_encryption_cmd,
+  "encryption a5 (0|1|2|3)",
+   "Encryption options\n"
+   "A5 encryption\n" "A5/0: No encryption\n"
+   "A5/1: Encryption\n" "A5/2: Export-grade Encryption\n"
+   "A5/3: 'New' Secure Encryption\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+
+   gsmnet->a5_encryption = atoi(argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_dyn_ts_allow_tch_f,
+  cfg_net_dyn_ts_allow_tch_f_cmd,
+  "dyn_ts_allow_tch_f (0|1)",
+  "Allow or disallow allocating TCH/F on TCH_F_TCH_H_PDCH timeslots\n"
+  "Disallow TCH/F on TCH_F_TCH_H_PDCH (default)\n"
+  "Allow TCH/F on TCH_F_TCH_H_PDCH\n")
+{
+   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
+   gsmnet->dyn_ts_allow_tch_f = atoi(argv[0]) ? true : false;
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_net_timezone,
+  cfg_net_timezone_cmd,
+  "timezone <-19-19> (0|15|30|45)",
+  "Set the Timezone Offset of the network\n"
+  "Timezone offset (hours)\n"
+  "Timezone offset (00 minutes)\n"
+  "Timezone offset (15 minutes)\n"
+  "Timezone offset (30 minutes)\n"
+  "Timezone offset (45 minutes)\n"
+  )
+{
+   struct gsm_network *net = vty->index;
+   int tzhr = atoi(argv[0]);
+   int tzmn = atoi(argv[1]);
+
+   net->tz.hr = tzhr;
+   net->tz.mn = tzmn;
+   net->tz.dst = 0;
+   net->tz.override = 1;
+
+

[PATCH] osmo-bsc[master]: drop unused common.h

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6444

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

drop unused common.h

Change-Id: I7cf4076d7e36ae71d88e70a86d5c2d0640c1146f
---
M include/osmocom/bsc/Makefile.am
D include/osmocom/bsc/common.h
M include/osmocom/bsc/gsm_data.h
3 files changed, 0 insertions(+), 8 deletions(-)


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

diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index f975947..b996070 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -14,7 +14,6 @@
bss.h \
bts_ipaccess_nanobts_omlattr.h \
chan_alloc.h \
-   common.h \
common_bsc.h \
ctrl.h \
debug.h \
diff --git a/include/osmocom/bsc/common.h b/include/osmocom/bsc/common.h
deleted file mode 100644
index d91b3d3..000
--- a/include/osmocom/bsc/common.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-enum nsap_addr_enc {
-   NSAP_ADDR_ENC_X213,
-   NSAP_ADDR_ENC_V4RAW,
-};
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index d1a901e..fc745a2 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -15,7 +15,6 @@
 
 #include 
 
-#include 
 #include 
 
 #include 

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

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


[PATCH] osmo-bsc[master]: drop libcommon-cs completely

2018-02-14 Thread Neels Hofmeyr
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/6443

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

drop libcommon-cs completely

Change-Id: I07d4a48af3154ee4d904686f230a51b8b8a94ff9
---
M configure.ac
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/common_bsc.h
D include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_data.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/libbsc/Makefile.am
M src/libbsc/bsc_vty.c
M src/libbsc/net_init.c
D src/libcommon-cs/Makefile.am
D src/libcommon-cs/common_cs.c
D src/libcommon-cs/common_cs_vty.c
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc_nat/Makefile.am
M src/osmo-bsc_nat/bsc_nat.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/bsc-nat/Makefile.am
M tests/bsc/Makefile.am
M tests/bssap/Makefile.am
M tests/channel/Makefile.am
M tests/gsm0408/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
26 files changed, 2 insertions(+), 114 deletions(-)


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

diff --git a/configure.ac b/configure.ac
index b2644fe..dac222f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,7 +150,6 @@
 src/Makefile
 src/libbsc/Makefile
 src/libfilter/Makefile
-src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
 src/ipaccess/Makefile
 src/utils/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index c503a50..f975947 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -16,7 +16,6 @@
chan_alloc.h \
common.h \
common_bsc.h \
-   common_cs.h \
ctrl.h \
debug.h \
e1_config.h \
diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h
index 32e5097..d3c7ff5 100644
--- a/include/osmocom/bsc/common_bsc.h
+++ b/include/osmocom/bsc/common_bsc.h
@@ -1,7 +1,6 @@
 #pragma once
 
 #include 
-#include 
 
 struct gsm_network *bsc_network_init(void *ctx,
 uint16_t country_code,
diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
deleted file mode 100644
index b6a8ed8..000
--- a/include/osmocom/bsc/common_cs.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-#include 
-#include 
-
-struct msgb;
-struct gsm_network;
-
-struct vty;
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 8af594f..d1a901e 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -17,7 +17,6 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/src/Makefile.am b/src/Makefile.am
index 28b070e..fc9bf8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@
 
 # Libraries
 SUBDIRS = \
-   libcommon-cs \
libbsc \
libfilter \
$(NULL)
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index 0301d3a..a6195b9 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -46,7 +46,6 @@
 # FIXME: resolve the bogus dependencies patched around here:
 ipaccess_config_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(OSMO_LIBS) \
$(NULL)
 
diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index e68ada8..e8e69c7 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -19,8 +19,6 @@
libbsc.a \
$(NULL)
 
-libbsc_a_LIBADD = $(top_builddir)/src/libcommon-cs/libcommon-cs.a
-
 libbsc_a_SOURCES = \
abis_nm.c \
abis_nm_vty.c \
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 1407061..f1cbb54 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -56,7 +56,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index c5c7c5e..90f668f 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -17,7 +17,6 @@
  *
  */
 
-#include 
 #include 
 #include 
 #include 
diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am
deleted file mode 100644
index e549509..000
--- a/src/libcommon-cs/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-AM_CPPFLAGS = \
-   $(all_includes) \
-   -I$(top_srcdir)/include \
-   -I$(top_builddir) \
-   $(NULL)
-
-AM_CFLAGS = \
-   -Wall \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOVTY_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSIGTRAN_CFLAGS) \
-   $(COVERAGE_CFLAGS) \
-   $(NULL)
-
-noinst_LIBRARIES = libcommon-cs.a
-
-libcommon_cs_a_SOURCES = \
-   common_cs.c \
-   common_cs_vty.c
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
deleted file mode 100644
index 9307f63..000
--- a/src/libcommon-cs/common_cs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Code used by both libbsc and libmsc (comm

[MERGED] osmo-bsc[master]: drop unused common.h

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: drop unused common.h
..


drop unused common.h

Change-Id: I7cf4076d7e36ae71d88e70a86d5c2d0640c1146f
---
M include/osmocom/bsc/Makefile.am
D include/osmocom/bsc/common.h
M include/osmocom/bsc/gsm_data.h
3 files changed, 0 insertions(+), 8 deletions(-)

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



diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index f975947..b996070 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -14,7 +14,6 @@
bss.h \
bts_ipaccess_nanobts_omlattr.h \
chan_alloc.h \
-   common.h \
common_bsc.h \
ctrl.h \
debug.h \
diff --git a/include/osmocom/bsc/common.h b/include/osmocom/bsc/common.h
deleted file mode 100644
index d91b3d3..000
--- a/include/osmocom/bsc/common.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#pragma once
-
-enum nsap_addr_enc {
-   NSAP_ADDR_ENC_X213,
-   NSAP_ADDR_ENC_V4RAW,
-};
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index d1a901e..fc745a2 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -15,7 +15,6 @@
 
 #include 
 
-#include 
 #include 
 
 #include 

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

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


[MERGED] osmo-bsc[master]: drop libcommon-cs completely

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: drop libcommon-cs completely
..


drop libcommon-cs completely

Change-Id: I07d4a48af3154ee4d904686f230a51b8b8a94ff9
---
M configure.ac
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/common_bsc.h
D include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_data.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/libbsc/Makefile.am
M src/libbsc/bsc_vty.c
M src/libbsc/net_init.c
D src/libcommon-cs/Makefile.am
D src/libcommon-cs/common_cs.c
D src/libcommon-cs/common_cs_vty.c
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc_nat/Makefile.am
M src/osmo-bsc_nat/bsc_nat.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/bsc-nat/Makefile.am
M tests/bsc/Makefile.am
M tests/bssap/Makefile.am
M tests/channel/Makefile.am
M tests/gsm0408/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
26 files changed, 2 insertions(+), 114 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index b2644fe..dac222f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,7 +150,6 @@
 src/Makefile
 src/libbsc/Makefile
 src/libfilter/Makefile
-src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
 src/ipaccess/Makefile
 src/utils/Makefile
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index c503a50..f975947 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -16,7 +16,6 @@
chan_alloc.h \
common.h \
common_bsc.h \
-   common_cs.h \
ctrl.h \
debug.h \
e1_config.h \
diff --git a/include/osmocom/bsc/common_bsc.h b/include/osmocom/bsc/common_bsc.h
index 32e5097..d3c7ff5 100644
--- a/include/osmocom/bsc/common_bsc.h
+++ b/include/osmocom/bsc/common_bsc.h
@@ -1,7 +1,6 @@
 #pragma once
 
 #include 
-#include 
 
 struct gsm_network *bsc_network_init(void *ctx,
 uint16_t country_code,
diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
deleted file mode 100644
index b6a8ed8..000
--- a/include/osmocom/bsc/common_cs.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-#include 
-#include 
-
-struct msgb;
-struct gsm_network;
-
-struct vty;
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 8af594f..d1a901e 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -17,7 +17,6 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff --git a/src/Makefile.am b/src/Makefile.am
index 28b070e..fc9bf8e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@
 
 # Libraries
 SUBDIRS = \
-   libcommon-cs \
libbsc \
libfilter \
$(NULL)
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index 0301d3a..a6195b9 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -46,7 +46,6 @@
 # FIXME: resolve the bogus dependencies patched around here:
 ipaccess_config_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(OSMO_LIBS) \
$(NULL)
 
diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index e68ada8..e8e69c7 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -19,8 +19,6 @@
libbsc.a \
$(NULL)
 
-libbsc_a_LIBADD = $(top_builddir)/src/libcommon-cs/libcommon-cs.a
-
 libbsc_a_SOURCES = \
abis_nm.c \
abis_nm_vty.c \
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 1407061..f1cbb54 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -56,7 +56,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index c5c7c5e..90f668f 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -17,7 +17,6 @@
  *
  */
 
-#include 
 #include 
 #include 
 #include 
diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am
deleted file mode 100644
index e549509..000
--- a/src/libcommon-cs/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-AM_CPPFLAGS = \
-   $(all_includes) \
-   -I$(top_srcdir)/include \
-   -I$(top_builddir) \
-   $(NULL)
-
-AM_CFLAGS = \
-   -Wall \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOVTY_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSIGTRAN_CFLAGS) \
-   $(COVERAGE_CFLAGS) \
-   $(NULL)
-
-noinst_LIBRARIES = libcommon-cs.a
-
-libcommon_cs_a_SOURCES = \
-   common_cs.c \
-   common_cs_vty.c
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
deleted file mode 100644
index 9307f63..000
--- a/src/libcommon-cs/common_cs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Code used by bot

[MERGED] osmo-bsc[master]: libcommon-cs: move a_reset.c into libbsc

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: libcommon-cs: move a_reset.c into libbsc
..


libcommon-cs: move a_reset.c into libbsc

a_reset.c was originally used by both libmsc and libbsc in the old openbsc.git
repository. Now osmo-msc.git has its own copy, and the idea of sharing
libcommon-cs is no longer applicable. Move it to libbsc where it belongs.

Change-Id: I30e4b5dab9c6d761d20a3a0e5b9ec2d65e64ebc5
---
M src/libbsc/Makefile.am
R src/libbsc/a_reset.c
M src/libcommon-cs/Makefile.am
3 files changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index f03b498..e68ada8 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -27,6 +27,7 @@
abis_om2000.c \
abis_om2000_vty.c \
abis_rsl.c \
+   a_reset.c \
bsc_rll.c \
bsc_subscriber.c \
paging.c \
diff --git a/src/libcommon-cs/a_reset.c b/src/libbsc/a_reset.c
similarity index 100%
rename from src/libcommon-cs/a_reset.c
rename to src/libbsc/a_reset.c
diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am
index 8cca1d7..e549509 100644
--- a/src/libcommon-cs/Makefile.am
+++ b/src/libcommon-cs/Makefile.am
@@ -17,6 +17,5 @@
 noinst_LIBRARIES = libcommon-cs.a
 
 libcommon_cs_a_SOURCES = \
-   a_reset.c \
common_cs.c \
common_cs_vty.c

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

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


[PATCH] osmo-msc[master]: remove unused "authorized-regexp" VTY command

2018-02-14 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6416

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

remove unused "authorized-regexp" VTY command

This is another left-over VTY command from the OsmoNITB days.

If such functionality is desired, it must be implemented in OsmoHLR,
but not here.

Related: OS#2528
Change-Id: Icf0897c47388e49ba7886b55acc728a6f7d213fe
---
M include/osmocom/msc/gsm_data.h
M src/libcommon-cs/common_cs.c
M src/libcommon-cs/common_cs_vty.c
M tests/msc_vlr/msc_vlr_test_authen_reuse.err
M tests/msc_vlr/msc_vlr_test_call.err
M tests/msc_vlr/msc_vlr_test_gsm_authen.err
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
M tests/msc_vlr/msc_vlr_test_hlr_reject.err
M tests/msc_vlr/msc_vlr_test_hlr_timeout.err
M tests/msc_vlr/msc_vlr_test_ms_timeout.err
M tests/msc_vlr/msc_vlr_test_no_authen.err
M tests/msc_vlr/msc_vlr_test_reject_concurrency.err
M tests/msc_vlr/msc_vlr_test_rest.err
M tests/msc_vlr/msc_vlr_test_umts_authen.err
M tests/msc_vlr/msc_vlr_tests.c
M tests/vty_test_runner.py
16 files changed, 72 insertions(+), 101 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/16/6416/4

diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 0548b80..9701288 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -236,8 +236,6 @@
char *name_long;
char *name_short;
enum gsm_auth_policy auth_policy;
-   regex_t authorized_regexp;
-   char *authorized_reg_str;
/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
uint8_t a5_encryption_mask;
bool authentication_required;
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index cebaf39..a2f5cb3 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -44,14 +44,8 @@
 {
struct gsm_network *net;
 
-   const char *default_regexp = ".*";
-
net = talloc_zero(ctx, struct gsm_network);
if (!net)
-   return NULL;
-
-   if (gsm_parse_reg(net, &net->authorized_regexp, 
&net->authorized_reg_str, 1,
- &default_regexp) != 0)
return NULL;
 
net->country_code = country_code;
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index e5972f1..2fbe09c 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -121,22 +121,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_authorize_regexp, cfg_net_authorize_regexp_cmd,
-  "authorized-regexp REGEXP",
-  "Set regexp for IMSI which will be used for authorization decision\n"
-  "Regular expression, IMSIs matching it are allowed to use the network\n")
-{
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-   if (gsm_parse_reg(gsmnet, &gsmnet->authorized_regexp,
- &gsmnet->authorized_reg_str, argc, argv) != 0) {
-   vty_out(vty, "%%Failed to parse the authorized-regexp: '%s'%s",
-   argv[0], VTY_NEWLINE);
-   return CMD_WARNING;
-   }
-
-   return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
   cfg_net_encryption_cmd,
   "encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>]",
@@ -307,7 +291,6 @@
install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd);
-   install_element(GSMNET_NODE, &cfg_net_authorize_regexp_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_authentication_cmd);
install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd);
diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err 
b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
index 010f594..c676f51 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
@@ -424,7 +424,7 @@
 = [1] test_auth_use_twice_geran(90170004620): SUCCESS
 
 full talloc report on 'msgb' (total  0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 8
+talloc_total_blocks(tall_bsc_ctx) == 7
 
 = [2] test_auth_use_twice_utran(90170004620)...
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -878,7 +878,7 @@
 = [2] test_auth_use_twice_utran(90170004620): SUCCESS
 
 full talloc report on 'msgb' (total  0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 8
+talloc_total_blocks(tall_bsc_ctx) == 7
 
 = [3] test_auth_use_infinitely_geran(90170004620)...
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -1399,7 +1399,7 @@
 = [3] test_auth_use_infinitely_geran(90170004620): SUCCESS
 
 full talloc report on 'msgb' (total  0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 8
+talloc_total_blocks(tall_bsc_ctx) == 7
 
 = [4] test_auth_use_infi

osmo-msc[master]: remove unused "auth policy" VTY command

2018-02-14 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


osmo-msc[master]: remove unused "authorized-regexp" VTY command

2018-02-14 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


osmo-msc[master]: remove dead code (gsm_parse_reg)

2018-02-14 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


[MERGED] osmo-msc[master]: remove unused "auth policy" VTY command

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: remove unused "auth policy" VTY command
..


remove unused "auth policy" VTY command

This is yet another unsused bit from the OsmoNITB legacy.

Related: OS#2528
Change-Id: I825e659da529257e5edec94d9d59f0e10c1b4c63
---
M doc/examples/osmo-msc/osmo-msc.cfg
M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg
M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg
M include/osmocom/msc/gsm_data.h
M src/libcommon-cs/common_cs_vty.c
M src/libcommon/gsm_data.c
M src/libmsc/msc_vty.c
M tests/vty_test_runner.py
8 files changed, 0 insertions(+), 60 deletions(-)

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



diff --git a/doc/examples/osmo-msc/osmo-msc.cfg 
b/doc/examples/osmo-msc/osmo-msc.cfg
index 4cccebe..91c9eee 100644
--- a/doc/examples/osmo-msc/osmo-msc.cfg
+++ b/doc/examples/osmo-msc/osmo-msc.cfg
@@ -9,7 +9,6 @@
  mobile network code 1
  short name OsmoMSC
  long name OsmoMSC
- auth policy closed
  encryption a5 0
  rrlp mode none
  mm info 1
diff --git a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg 
b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg
index ea92912..0b9fd2a 100644
--- a/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg
+++ b/doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg
@@ -9,7 +9,6 @@
  mobile network code 1
  short name OsmoMSC
  long name OsmoMSC
- auth policy closed
  encryption a5 0
  rrlp mode none
  mm info 1
diff --git a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg 
b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg
index 7026293..44ac3f8 100644
--- a/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg
+++ b/doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg
@@ -9,7 +9,6 @@
  mobile network code 1
  short name OsmoMSC
  long name OsmoMSC
- auth policy closed
  encryption a5 0
  rrlp mode none
  mm info 1
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 9701288..67b657a 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -207,13 +207,6 @@
msc_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 MSC_PAGING_RESPONSE_TIMER_DEFAULT 10
 
 struct gsm_tz {
@@ -235,7 +228,6 @@
uint16_t network_code;
char *name_long;
char *name_short;
-   enum gsm_auth_policy auth_policy;
/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
uint8_t a5_encryption_mask;
bool authentication_required;
@@ -371,9 +363,6 @@
 
 extern void *tall_bsc_ctx;
 extern int ipacc_rtp_direct;
-
-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);
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index 2fbe09c..01c6b35 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -103,24 +103,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_auth_policy,
-  cfg_net_auth_policy_cmd,
-  "auth policy (closed|accept-all|regexp|token)",
-   "Authentication (not cryptographic)\n"
-   "Set the GSM network authentication policy\n"
-   "Require the MS to be activated in HLR\n"
-   "Accept all MS, whether in HLR or not\n"
-   "Use regular expression for IMSI authorization decision\n"
-   "Use SMS-token based authentication\n")
-{
-   enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]);
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-
-   gsmnet->auth_policy = policy;
-
-   return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
   cfg_net_encryption_cmd,
   "encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>]",
@@ -290,7 +272,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_auth_policy_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_authentication_cmd);
install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd);
diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c
index 66b6e29..a0ca81a 100644
--- a/src/libcommon/gsm_data.c
+++ b/src/libcommon/gsm_data.c
@@ -36,24 +36,6 @@
 
 void *tall_bsc_ctx;
 
-static const struct value_string auth_policy_names[] = {
-   { GSM_AUTH_POLICY_CLOSED,   "closed" },
-   { GSM_AUTH_POLICY_ACCEPT_ALL,   "accept-all" },
-   

[MERGED] osmo-msc[master]: remove dead code (gsm_parse_reg)

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: remove dead code (gsm_parse_reg)
..


remove dead code (gsm_parse_reg)

Change-Id: I47b0260561a9c2bad65c50c8164873e4c23d61b7
---
M include/osmocom/msc/gsm_data_shared.h
M src/libcommon/gsm_data.c
2 files changed, 0 insertions(+), 32 deletions(-)

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



diff --git a/include/osmocom/msc/gsm_data_shared.h 
b/include/osmocom/msc/gsm_data_shared.h
index af7d89d..32c336b 100644
--- a/include/osmocom/msc/gsm_data_shared.h
+++ b/include/osmocom/msc/gsm_data_shared.h
@@ -1,7 +1,6 @@
 #ifndef _GSM_DATA_SHAREDH
 #define _GSM_DATA_SHAREDH
 
-#include 
 #include 
 #include 
 
@@ -40,11 +39,5 @@
GSM_PAGING_OOM,
GSM_PAGING_BUSY,
 };
-
-/*
- * help with parsing regexps
- */
-int gsm_parse_reg(void *ctx, regex_t *reg, char **str,
-   int argc, const char **argv) __attribute__ 
((warn_unused_result));
 
 #endif
diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c
index a0ca81a..f7795b2 100644
--- a/src/libcommon/gsm_data.c
+++ b/src/libcommon/gsm_data.c
@@ -54,31 +54,6 @@
return get_value_string(rrlp_mode_names, mode);
 }
 
-int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char 
**argv)
-{
-   int ret;
-
-   ret = 0;
-   if (*str) {
-   talloc_free(*str);
-   *str = NULL;
-   }
-   regfree(reg);
-
-   if (argc > 0) {
-   *str = talloc_strdup(ctx, argv[0]);
-   ret = regcomp(reg, argv[0], 0);
-
-   /* handle compilation failures */
-   if (ret != 0) {
-   talloc_free(*str);
-   *str = NULL;
-   }
-   }
-
-   return ret;
-}
-
 bool classmark_is_r99(struct gsm_classmark *cm)
 {
int rev_lev = 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47b0260561a9c2bad65c50c8164873e4c23d61b7
Gerrit-PatchSet: 3
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-msc[master]: remove unused "authorized-regexp" VTY command

2018-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: remove unused "authorized-regexp" VTY command
..


remove unused "authorized-regexp" VTY command

This is another left-over VTY command from the OsmoNITB days.

If such functionality is desired, it must be implemented in OsmoHLR,
but not here.

Related: OS#2528
Change-Id: Icf0897c47388e49ba7886b55acc728a6f7d213fe
---
M include/osmocom/msc/gsm_data.h
M src/libcommon-cs/common_cs.c
M src/libcommon-cs/common_cs_vty.c
M tests/msc_vlr/msc_vlr_test_authen_reuse.err
M tests/msc_vlr/msc_vlr_test_call.err
M tests/msc_vlr/msc_vlr_test_gsm_authen.err
M tests/msc_vlr/msc_vlr_test_gsm_ciph.err
M tests/msc_vlr/msc_vlr_test_hlr_reject.err
M tests/msc_vlr/msc_vlr_test_hlr_timeout.err
M tests/msc_vlr/msc_vlr_test_ms_timeout.err
M tests/msc_vlr/msc_vlr_test_no_authen.err
M tests/msc_vlr/msc_vlr_test_reject_concurrency.err
M tests/msc_vlr/msc_vlr_test_rest.err
M tests/msc_vlr/msc_vlr_test_umts_authen.err
M tests/msc_vlr/msc_vlr_tests.c
M tests/vty_test_runner.py
16 files changed, 72 insertions(+), 101 deletions(-)

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



diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 0548b80..9701288 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -236,8 +236,6 @@
char *name_long;
char *name_short;
enum gsm_auth_policy auth_policy;
-   regex_t authorized_regexp;
-   char *authorized_reg_str;
/* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */
uint8_t a5_encryption_mask;
bool authentication_required;
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index cebaf39..a2f5cb3 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -44,14 +44,8 @@
 {
struct gsm_network *net;
 
-   const char *default_regexp = ".*";
-
net = talloc_zero(ctx, struct gsm_network);
if (!net)
-   return NULL;
-
-   if (gsm_parse_reg(net, &net->authorized_regexp, 
&net->authorized_reg_str, 1,
- &default_regexp) != 0)
return NULL;
 
net->country_code = country_code;
diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c
index e5972f1..2fbe09c 100644
--- a/src/libcommon-cs/common_cs_vty.c
+++ b/src/libcommon-cs/common_cs_vty.c
@@ -121,22 +121,6 @@
return CMD_SUCCESS;
 }
 
-DEFUN(cfg_net_authorize_regexp, cfg_net_authorize_regexp_cmd,
-  "authorized-regexp REGEXP",
-  "Set regexp for IMSI which will be used for authorization decision\n"
-  "Regular expression, IMSIs matching it are allowed to use the network\n")
-{
-   struct gsm_network *gsmnet = gsmnet_from_vty(vty);
-   if (gsm_parse_reg(gsmnet, &gsmnet->authorized_regexp,
- &gsmnet->authorized_reg_str, argc, argv) != 0) {
-   vty_out(vty, "%%Failed to parse the authorized-regexp: '%s'%s",
-   argv[0], VTY_NEWLINE);
-   return CMD_WARNING;
-   }
-
-   return CMD_SUCCESS;
-}
-
 DEFUN(cfg_net_encryption,
   cfg_net_encryption_cmd,
   "encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>]",
@@ -307,7 +291,6 @@
install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd);
-   install_element(GSMNET_NODE, &cfg_net_authorize_regexp_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_net_authentication_cmd);
install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd);
diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err 
b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
index 010f594..c676f51 100644
--- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err
+++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err
@@ -424,7 +424,7 @@
 = [1] test_auth_use_twice_geran(90170004620): SUCCESS
 
 full talloc report on 'msgb' (total  0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 8
+talloc_total_blocks(tall_bsc_ctx) == 7
 
 = [2] test_auth_use_twice_utran(90170004620)...
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -878,7 +878,7 @@
 = [2] test_auth_use_twice_utran(90170004620): SUCCESS
 
 full talloc report on 'msgb' (total  0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 8
+talloc_total_blocks(tall_bsc_ctx) == 7
 
 = [3] test_auth_use_infinitely_geran(90170004620)...
 - Location Update request causes a GSUP Send Auth Info request to HLR
@@ -1399,7 +1399,7 @@
 = [3] test_auth_use_infinitely_geran(90170004620): SUCCESS
 
 full talloc report on 'msgb' (total  0 bytes in   1 blocks)
-talloc_total_blocks(tall_bsc_ctx) == 8
+talloc_total_bl

[ABANDON] osmo-bsc[master]: temp dev: make osmo-bsc_nat compile

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has abandoned this change.

Change subject: temp dev: make osmo-bsc_nat compile
..


Abandoned

this one shouldn't have been submitted

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I165499762956b95ebd77c7670dc0ba0d03df59c6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


[ABANDON] osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has abandoned this change.

Change subject: HO: Implement load based handover, as handover_decision_2.c
..


Abandoned

being split in smaller patches, soon to be resubmitted

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 


[ABANDON] osmo-bsc[master]: HO: intra-cell assignment: always use Handover Command, not ...

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has abandoned this change.

Change subject: HO: intra-cell assignment: always use Handover Command, not 
Assignment
..


Abandoned

the new version of ho2 patches will refrain from modifying this in the first 
place

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e
Gerrit-PatchSet: 7
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


gapk[master]: Add basic CI integration

2018-02-14 Thread Max

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib4b36df8f010cd7e035fe5a8b846632541b655f5
Gerrit-PatchSet: 1
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: No


[MERGED] gapk[master]: Add basic CI integration

2018-02-14 Thread Max
Max has submitted this change and it was merged.

Change subject: Add basic CI integration
..


Add basic CI integration

Change-Id: Ib4b36df8f010cd7e035fe5a8b846632541b655f5
---
A contrib/jenkins.sh
1 file changed, 42 insertions(+), 0 deletions(-)

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



diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
new file mode 100755
index 000..ba4e7af
--- /dev/null
+++ b/contrib/jenkins.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# jenkins build helper script for jenkins.osmocom.org
+
+if ! [ -x "$(command -v osmo-build-dep.sh)" ]; then
+   echo "Error: We need to have scripts/osmo-deps.sh from 
http://git.osmocom.org/osmo-ci/ in PATH !"
+   exit 2
+fi
+
+set -ex
+
+base="$PWD"
+deps="$base/deps"
+inst="$deps/install"
+export deps inst
+
+osmo-clean-workspace.sh
+
+mkdir "$deps" || true
+
+osmo-build-dep.sh libosmocore "" ac_cv_path_DOXYGEN=false
+
+verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
+
+export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
+export LD_LIBRARY_PATH="$inst/lib"
+
+set +x
+echo
+echo
+echo
+echo " === gapk ==="
+echo
+set -x
+
+cd "$base"
+autoreconf --install --force
+./configure
+$MAKE $PARALLEL_MAKE
+LD_LIBRARY_PATH="$inst/lib" $MAKE check || cat-testlogs.sh
+LD_LIBRARY_PATH="$inst/lib" DISTCHECK_CONFIGURE_FLAGS="" $MAKE distcheck || 
cat-testlogs.sh
+
+osmo-clean-workspace.sh

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4b36df8f010cd7e035fe5a8b846632541b655f5
Gerrit-PatchSet: 1
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: tnt 


[PATCH] osmo-gsm-tester[master]: templates: osmo-msc: Remove unused option auth policy

2018-02-14 Thread Pau Espin Pedrol

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

templates: osmo-msc: Remove unused option auth policy

Commit osmo-msc 098aa71e83a86200a18088927b4753909f5ed518 removes this
option from default configuration as it is really not used in osmo-msc,
it comes from osmo-nitb times.

Change-Id: I928379ebabfc776f33b9f345d92a7a4a533fe25f
---
M example/defaults.conf
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
2 files changed, 0 insertions(+), 2 deletions(-)


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

diff --git a/example/defaults.conf b/example/defaults.conf
index 7468722..c110dde 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -21,7 +21,6 @@
 mnc: 70
 short_name: osmo-gsm-tester-msc
 long_name: osmo-gsm-tester-msc
-auth_policy: closed
 encryption: a5_0
 authentication: optional
 
diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
index 55533a5..e54e8c8 100644
--- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
@@ -13,7 +13,6 @@
  mobile network code ${msc.net.mnc}
  short name ${msc.net.short_name}
  long name ${msc.net.long_name}
- auth policy ${msc.net.auth_policy}
  encryption ${msc.net.encryption}
  authentication ${msc.net.authentication}
 cs7 instance 0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I928379ebabfc776f33b9f345d92a7a4a533fe25f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-gsm-tester[master]: templates: osmo-msc: Remove unused option reject cause

2018-02-14 Thread Pau Espin Pedrol

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

templates: osmo-msc: Remove unused option reject cause

Commit osmo-msc 27b40c601c41fde70446ad553629494234c07662 removes this
option from default configuration as it is really not used in osmo-msc,
it comes from osmo-nitb times.

Change-Id: Iac1948113514414e7573f3bbfb3ce82e6c49adb6
---
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
index 149833a..55533a5 100644
--- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
@@ -14,7 +14,6 @@
  short name ${msc.net.short_name}
  long name ${msc.net.long_name}
  auth policy ${msc.net.auth_policy}
- location updating reject cause 13
  encryption ${msc.net.encryption}
  authentication ${msc.net.authentication}
 cs7 instance 0

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac1948113514414e7573f3bbfb3ce82e6c49adb6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 


[PATCH] osmo-bsc[master]: libcommon: eliminate bsc_version.c

2018-02-14 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6428

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

libcommon: eliminate bsc_version.c

Move the copyright string into osmo_bsc_main.c. No other users of it exist.

Change-Id: I7f48924f484e4e4b98be4ca8bee253e6ea9c0576
---
M src/libcommon/Makefile.am
D src/libcommon/bsc_version.c
M src/osmo-bsc/osmo_bsc_main.c
3 files changed, 7 insertions(+), 33 deletions(-)


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

diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index 9f7e7b9..af578a2 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -20,7 +20,6 @@
$(NULL)
 
 libcommon_a_SOURCES = \
-   bsc_version.c \
common_vty.c \
debug.c \
gsm_data.c \
diff --git a/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c
deleted file mode 100644
index f0369bf..000
--- a/src/libcommon/bsc_version.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Hold the copyright and version string */
-/* (C) 2010-2016 by Harald Welte 
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include "../../bscconfig.h"
-
-const char *openbsc_copyright =
-   "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n"
-   "Contributions by Daniel Willmann, Jan Lübbe, Stefan Schmidt\r\n"
-   "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n"
-   "License AGPLv3+: GNU AGPL version 3 or later 
\r\n"
-   "This is free software: you are free to change and redistribute it.\r\n"
-   "There is NO WARRANTY, to the extent permitted by law.\r\n";
-
-
diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 3deb369..db8c4f8 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -62,7 +62,6 @@
 struct gsm_network *bsc_gsmnet = 0;
 static const char *config_file = "osmo-bsc.cfg";
 static const char *rf_ctrl = NULL;
-extern const char *openbsc_copyright;
 static int daemonize = 0;
 static struct llist_head access_lists;
 
@@ -151,6 +150,13 @@
 
 static struct vty_app_info vty_info = {
.name   = "OsmoBSC",
+   .copyright  =
+   "Copyright (C) 2008-2018 Harald Welte, Holger Freyther\r\n"
+   "Contributions by Daniel Willmann, Jan Lübbe, Stefan Schmidt\r\n"
+   "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n"
+   "License AGPLv3+: GNU AGPL version 3 or later 
\r\n"
+   "This is free software: you are free to change and redistribute it.\r\n"
+   "There is NO WARRANTY, to the extent permitted by law.\r\n",
.version= PACKAGE_VERSION,
.go_parent_cb   = bsc_vty_go_parent,
.is_config_node = bsc_vty_is_config_node,
@@ -218,7 +224,6 @@
/* enable filters */
 
/* This needs to precede handle_options() */
-   vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
bsc_vty_init(bsc_gsmnet);
bsc_msg_lst_vty_init(tall_bsc_ctx, &access_lists, BSC_NODE);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7f48924f484e4e4b98be4ca8bee253e6ea9c0576
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


osmo-gsm-tester[master]: templates: osmo-msc: Remove unused option auth policy

2018-02-14 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: templates: osmo-msc: Remove unused option auth policy

2018-02-14 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: templates: osmo-msc: Remove unused option auth policy
..


templates: osmo-msc: Remove unused option auth policy

Commit osmo-msc 098aa71e83a86200a18088927b4753909f5ed518 removes this
option from default configuration as it is really not used in osmo-msc,
it comes from osmo-nitb times.

Change-Id: I928379ebabfc776f33b9f345d92a7a4a533fe25f
---
M example/defaults.conf
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
2 files changed, 0 insertions(+), 2 deletions(-)

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



diff --git a/example/defaults.conf b/example/defaults.conf
index 7468722..c110dde 100644
--- a/example/defaults.conf
+++ b/example/defaults.conf
@@ -21,7 +21,6 @@
 mnc: 70
 short_name: osmo-gsm-tester-msc
 long_name: osmo-gsm-tester-msc
-auth_policy: closed
 encryption: a5_0
 authentication: optional
 
diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
index 55533a5..e54e8c8 100644
--- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
@@ -13,7 +13,6 @@
  mobile network code ${msc.net.mnc}
  short name ${msc.net.short_name}
  long name ${msc.net.long_name}
- auth policy ${msc.net.auth_policy}
  encryption ${msc.net.encryption}
  authentication ${msc.net.authentication}
 cs7 instance 0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I928379ebabfc776f33b9f345d92a7a4a533fe25f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


osmo-gsm-tester[master]: templates: osmo-msc: Remove unused option reject cause

2018-02-14 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-gsm-tester[master]: templates: osmo-msc: Remove unused option reject cause

2018-02-14 Thread Pau Espin Pedrol
Pau Espin Pedrol has submitted this change and it was merged.

Change subject: templates: osmo-msc: Remove unused option reject cause
..


templates: osmo-msc: Remove unused option reject cause

Commit osmo-msc 27b40c601c41fde70446ad553629494234c07662 removes this
option from default configuration as it is really not used in osmo-msc,
it comes from osmo-nitb times.

Change-Id: Iac1948113514414e7573f3bbfb3ce82e6c49adb6
---
M src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl 
b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
index 149833a..55533a5 100644
--- a/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
+++ b/src/osmo_gsm_tester/templates/osmo-msc.cfg.tmpl
@@ -14,7 +14,6 @@
  short name ${msc.net.short_name}
  long name ${msc.net.long_name}
  auth policy ${msc.net.auth_policy}
- location updating reject cause 13
  encryption ${msc.net.encryption}
  authentication ${msc.net.authentication}
 cs7 instance 0

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac1948113514414e7573f3bbfb3ce82e6c49adb6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 


[PATCH] osmo-bsc[master]: libcommon: eliminate common_vty.c

2018-02-14 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6429

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

libcommon: eliminate common_vty.c

Move bsc_vty_go_parent() to osmo_bsc_main.c and bsc_nat.c, and drop those nodes
that aren't used in the respective main scope.

Change-Id: I22ebb76742e9c5ab9dd608ac089a5c558aceeb36
---
M include/osmocom/bsc/vty.h
M src/libcommon/Makefile.am
D src/libcommon/common_vty.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc_nat/bsc_nat.c
5 files changed, 129 insertions(+), 157 deletions(-)


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

diff --git a/include/osmocom/bsc/vty.h b/include/osmocom/bsc/vty.h
index f705601..daf9750 100644
--- a/include/osmocom/bsc/vty.h
+++ b/include/osmocom/bsc/vty.h
@@ -41,8 +41,6 @@
HLR_NODE,
 };
 
-extern int bsc_vty_is_config_node(struct vty *vty, int node);
-
 struct log_info;
 int bsc_vty_init(struct gsm_network *network);
 int bsc_vty_init_extra(void);
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index af578a2..1a73e6c 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -20,7 +20,6 @@
$(NULL)
 
 libcommon_a_SOURCES = \
-   common_vty.c \
debug.c \
gsm_data.c \
gsm_data_shared.c \
diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c
deleted file mode 100644
index 82327d1..000
--- a/src/libcommon/common_vty.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* OpenBSC VTY common helpers */
-/* (C) 2009-2010 by Harald Welte 
- * (C) 2009-2010 by Holger Hans Peter Freyther
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-
-int bsc_vty_go_parent(struct vty *vty)
-{
-   switch (vty->node) {
-   case GSMNET_NODE:
-   vty->node = CONFIG_NODE;
-   vty->index = NULL;
-   break;
-   case BTS_NODE:
-   vty->node = GSMNET_NODE;
-   {
-   /* set vty->index correctly ! */
-   struct gsm_bts *bts = vty->index;
-   vty->index = bts->network;
-   vty->index_sub = NULL;
-   }
-   break;
-   case TRX_NODE:
-   vty->node = BTS_NODE;
-   {
-   /* set vty->index correctly ! */
-   struct gsm_bts_trx *trx = vty->index;
-   vty->index = trx->bts;
-   vty->index_sub = &trx->bts->description;
-   }
-   break;
-   case TS_NODE:
-   vty->node = TRX_NODE;
-   {
-   /* set vty->index correctly ! */
-   struct gsm_bts_trx_ts *ts = vty->index;
-   vty->index = ts->trx;
-   vty->index_sub = &ts->trx->description;
-   }
-   break;
-   case OML_NODE:
-   case OM2K_NODE:
-   vty->node = ENABLE_NODE;
-   /* NOTE: this only works because it's not part of the config
-* tree, where outer commands are searched via vty_go_parent()
-* and only (!) executed when a matching one is found.
-*/
-   talloc_free(vty->index);
-   vty->index = NULL;
-   break;
-   case OM2K_CON_GROUP_NODE:
-   vty->node = BTS_NODE;
-   {
-   struct con_group *cg = vty->index;
-   struct gsm_bts *bts = cg->bts;
-   vty->index = bts;
-   vty->index_sub = &bts->description;
-   }
-   break;
-   case NAT_BSC_NODE:
-   vty->node = NAT_NODE;
-   {
-   struct bsc_config *bsc_config = vty->index;
-   vty->index = bsc_config->nat;
-   }
-   break;
-   case PGROUP_NODE:
-   vty->node = NAT_NODE;
-   vty->index = NULL;
-   break;
-   case TRUNK_NODE:
-   vty->node = MGCP_NODE;
-   vty->index = NULL;
-   break;
-   

[PATCH] osmo-bsc[master]: libcommon_cs: move gsm48 bits to libbsc

2018-02-14 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6440

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

libcommon_cs: move gsm48 bits to libbsc

These functions were originally shared between libmsc and libbsc in the old
openbsc.git; now osmo-bsc.git has its own copies, so move them into libbsc.

Change-Id: Ie411c2ce8008accee54782a442d6361e50777a54
---
M include/osmocom/bsc/common_cs.h
M include/osmocom/bsc/gsm_04_08_utils.h
M src/libbsc/gsm_04_08_utils.c
M src/libcommon-cs/common_cs.c
M src/libfilter/bsc_msg_filter.c
M src/osmo-bsc/osmo_bsc_filter.c
6 files changed, 65 insertions(+), 63 deletions(-)


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

diff --git a/include/osmocom/bsc/common_cs.h b/include/osmocom/bsc/common_cs.h
index 432d4d5..dccc7b5 100644
--- a/include/osmocom/bsc/common_cs.h
+++ b/include/osmocom/bsc/common_cs.h
@@ -19,9 +19,3 @@
 int common_cs_vty_init(struct gsm_network *network,
  int (* config_write_net )(struct vty *));
 struct gsm_network *gsmnet_from_vty(struct vty *v);
-
-struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
-int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type);
-int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
-   char *mi_string, uint8_t *mi_type);
-struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
diff --git a/include/osmocom/bsc/gsm_04_08_utils.h 
b/include/osmocom/bsc/gsm_04_08_utils.h
index 625f173..34979ab 100644
--- a/include/osmocom/bsc/gsm_04_08_utils.h
+++ b/include/osmocom/bsc/gsm_04_08_utils.h
@@ -22,6 +22,12 @@
 int gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
 enum gsm48_reject_value value);
 
+struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value);
+int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type);
+int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
+   char *mi_string, uint8_t *mi_type);
+struct msgb *gsm48_create_loc_upd_rej(uint8_t cause);
+
 #define GSM48_ALLOC_SIZE2048
 #define GSM48_ALLOC_HEADROOM256
 
diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c
index 85eb7b5..3004e5d 100644
--- a/src/libbsc/gsm_04_08_utils.c
+++ b/src/libbsc/gsm_04_08_utils.c
@@ -636,3 +636,60 @@
 
return gsm0808_submit_dtap(conn, msg, 0, 0);
 }
+
+struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
+{
+   struct msgb *msg;
+   struct gsm48_hdr *gh;
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ");
+   if (!msg)
+   return NULL;
+
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+   gh->proto_discr = GSM48_PDISC_MM;
+   gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
+   gh->data[0] = value;
+
+   return msg;
+}
+
+struct msgb *gsm48_create_loc_upd_rej(uint8_t cause)
+{
+   struct gsm48_hdr *gh;
+   struct msgb *msg;
+
+   msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ");
+   if (!msg)
+   return NULL;
+
+   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
+   gh->proto_discr = GSM48_PDISC_MM;
+   gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT;
+   gh->data[0] = cause;
+   return msg;
+}
+
+int gsm48_extract_mi(uint8_t *classmark2_lv, int length, char *mi_string, 
uint8_t *mi_type)
+{
+   /* Check the size for the classmark */
+   if (length < 1 + *classmark2_lv)
+   return -1;
+
+   uint8_t *mi_lv = classmark2_lv + *classmark2_lv + 1;
+   if (length < 2 + *classmark2_lv + mi_lv[0])
+   return -2;
+
+   *mi_type = mi_lv[1] & GSM_MI_TYPE_MASK;
+   return gsm48_mi_to_string(mi_string, GSM48_MI_SIZE, mi_lv+1, *mi_lv);
+}
+
+int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
+   char *mi_string, uint8_t *mi_type)
+{
+   static const uint32_t classmark_offset =
+   offsetof(struct gsm48_pag_resp, classmark2);
+   uint8_t *classmark2_lv = (uint8_t *) &resp->classmark2;
+   return gsm48_extract_mi(classmark2_lv, length - classmark_offset,
+   mi_string, mi_type);
+}
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c
index 0520e96..9307f63 100644
--- a/src/libcommon-cs/common_cs.c
+++ b/src/libcommon-cs/common_cs.c
@@ -30,59 +30,3 @@
 #include 
 #include 
 
-struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value)
-{
-   struct msgb *msg;
-   struct gsm48_hdr *gh;
-
-   msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ");
-   if (!msg)
-   return NULL;
-
-   gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
-   gh->proto_discr = GSM48_PDISC_MM;
-   gh->msg_type = GSM48_MT_MM_CM_SERV_REJ;
-   gh->data[0] = value;
-
-   return msg;
-}
-
-struct msgb *gsm4

[PATCH] osmo-msc[master]: libmsc: bssap: Catch TLV parse failures

2018-02-14 Thread Pau Espin Pedrol

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

libmsc: bssap: Catch TLV parse failures

Change-Id: I6aef9a94fa5b2e0b62a9c1744b8e18e5985f788f
---
M src/libmsc/a_iface_bssap.c
1 file changed, 49 insertions(+), 9 deletions(-)


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

diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c
index 0946a5d..e0cbf03 100644
--- a/src/libmsc/a_iface_bssap.c
+++ b/src/libmsc/a_iface_bssap.c
@@ -224,6 +224,10 @@
LOGPCONN(conn, LOGL_INFO, "Rx BSSMAP CLEAR REQUEST\n");
 
tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   if (rc < 0) {
+   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- discarding 
message!\n");
+   return -EINVAL;
+   }
if (!TLVP_PRESENT(&tp, GSM0808_IE_CAUSE)) {
LOGP(DBSSAP, LOGL_ERROR, "Cause code is missing -- discarding 
message!\n");
return -EINVAL;
@@ -276,7 +280,11 @@
 
LOGP(DBSSAP, LOGL_INFO, "Rx BSSMAP COMPLETE L3 INFO (conn_id=%i)\n", 
a_conn_info->conn_id);
 
-   tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) 
- 1, 0, 0);
+   if (rc < 0) {
+   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- discarding 
message!\n");
+   return -EINVAL;
+   }
if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER)) {
LOGP(DBSSAP, LOGL_ERROR, "Mandatory CELL IDENTIFIER not present 
-- discarding message!\n");
return -EINVAL;
@@ -339,10 +347,15 @@
const uint8_t *cm3 = NULL;
uint8_t cm2_len = 0;
uint8_t cm3_len = 0;
+   int rc;
 
LOGPCONN(conn, LOGL_DEBUG, "Rx BSSMAP CLASSMARK UPDATE\n");
 
-   tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) 
- 1, 0, 0);
+   if (rc < 0) {
+   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- discarding 
message!\n");
+   return -EINVAL;
+   }
if (!TLVP_PRESENT(&tp, GSM0808_IE_CLASSMARK_INFORMATION_T2)) {
LOGPCONN(conn, LOGL_ERROR, "Mandatory Classmark Information 
Type 2 not present -- discarding message!\n");
return -EINVAL;
@@ -374,10 +387,15 @@
 
struct tlv_parsed tp;
uint8_t alg_id = 1;
+   int rc;
 
LOGPCONN(conn, LOGL_DEBUG, "Rx BSSMAP CIPHER MODE COMPLETE\n");
 
-   tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) 
- 1, 0, 0);
+   if (rc < 0) {
+   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- discarding 
message!\n");
+   return -EINVAL;
+   }
 
if (TLVP_PRESENT(&tp, GSM0808_IE_CHOSEN_ENCR_ALG)) {
alg_id = TLVP_VAL(&tp, GSM0808_IE_CHOSEN_ENCR_ALG)[0] - 1;
@@ -401,10 +419,15 @@
 {
struct tlv_parsed tp;
uint8_t cause;
+   int rc;
 
LOGPCONN(conn, LOGL_NOTICE, "RX BSSMAP CIPHER MODE REJECT\n");
 
-   tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) 
- 1, 0, 0);
+   if (rc < 0) {
+   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- discarding 
message!\n");
+   return -EINVAL;
+   }
if (!TLVP_PRESENT(&tp, BSS_MAP_MSG_CIPHER_MODE_REJECT)) {
LOGPCONN(conn, LOGL_ERROR, "Cause code is missing -- discarding 
message!\n");
return -EINVAL;
@@ -426,10 +449,15 @@
uint8_t cause;
uint8_t *rr_cause_ptr = NULL;
uint8_t rr_cause;
+   int rc;
 
LOGPCONN(conn, LOGL_NOTICE, "Rx BSSMAP ASSIGNMENT FAILURE message\n");
 
-   tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) 
- 1, 0, 0);
+   if (rc < 0) {
+   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- discarding 
message!\n");
+   return -EINVAL;
+   }
if (!TLVP_PRESENT(&tp, GSM0808_IE_CAUSE)) {
LOGPCONN(conn, LOGL_ERROR, "Cause code is missing -- discarding 
message!\n");
return -EINVAL;
@@ -458,19 +486,28 @@
 {
struct tlv_parsed tp;
uint8_t dlci;
+   int rc;
 
LOGPCONN(conn, LOGL_NOTICE, "Rx BSSMAP SAPI-N-REJECT message\n");
 
/* Note: The MSC code seems not to care about the cause code, but by
 * the specification it is mandatory, so we check its presence. See
 * also 3GPP TS 48.008 3.2.1.34 SAPI "n" REJECT */
-   tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, msgb_l3len(msg) - 1, 
0, 0);
+   rc = tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l3h + 1, 

[PATCH] osmo-bsc[master]: drop libcommon completely

2018-02-14 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6436

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

drop libcommon completely

Change-Id: Ifa3486f04cdd5fda1e92630dfc1a5f670773bc14
---
M configure.ac
M src/Makefile.am
M src/ipaccess/Makefile.am
D src/libcommon/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc_nat/Makefile.am
M src/utils/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/bssap/Makefile.am
M tests/channel/Makefile.am
M tests/gsm0408/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
16 files changed, 1 insertion(+), 41 deletions(-)


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

diff --git a/configure.ac b/configure.ac
index d756970..b2644fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,6 @@
 include/osmocom/bsc/Makefile
 src/Makefile
 src/libbsc/Makefile
-src/libcommon/Makefile
 src/libfilter/Makefile
 src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 637272d..28b070e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@
 
 # Libraries
 SUBDIRS = \
-   libcommon \
libcommon-cs \
libbsc \
libfilter \
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index b3b2b8c..0301d3a 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -30,7 +30,6 @@
 
 abisip_find_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
 
@@ -48,7 +47,6 @@
 ipaccess_config_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
 
@@ -58,6 +56,5 @@
 
 ipaccess_proxy_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
deleted file mode 100644
index 6d39cb5..000
--- a/src/libcommon/Makefile.am
+++ /dev/null
@@ -1,23 +0,0 @@
-AM_CPPFLAGS = \
-   $(all_includes) \
-   -I$(top_srcdir)/include \
-   -I$(top_builddir) \
-   $(NULL)
-
-AM_CFLAGS = \
-   -Wall \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOVTY_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSIGTRAN_CFLAGS) \
-   $(LIBOSMOLEGACYMGCP_CFLAGS) \
-   $(COVERAGE_CFLAGS) \
-   $(NULL)
-
-noinst_LIBRARIES = \
-   libcommon.a \
-   $(NULL)
-
-libcommon_a_SOURCES = \
-   $(NULL)
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 7978852..50f9c78 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -43,7 +43,6 @@
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am
index a941b58..83ef850 100644
--- a/src/osmo-bsc_nat/Makefile.am
+++ b/src/osmo-bsc_nat/Makefile.am
@@ -41,7 +41,6 @@
$(top_builddir)/src/libfilter/libfilter.a \
$(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) \
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 78d4965..354f2b2 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -49,7 +49,6 @@
 bs11_config_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOABIS_LIBS) \
@@ -115,7 +114,7 @@
$(NULL)
 
 meas_json_LDADD = \
-   $(top_builddir)/src/libcommon/libcommon.a \
+   $(top_builddir)/src/libbsc/libbsc.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(NULL)
diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am
index 137321c..1e982af 100644
--- a/tests/abis/Makefile.am
+++ b/tests/abis/Makefile.am
@@ -26,7 +26,6 @@
 
 abis_test_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOABIS_LIBS) \
diff --git a/tests/bsc-nat-trie/Makefile.am b/tests/bsc-nat-trie/Makefile.am
index d20bd0a..4afa1a4 100644
--- a/tests/bsc-nat-trie/Makefile.am
+++ b/tests/bsc-nat-trie/Makefi

[PATCH] osmo-bsc[master]: libcommon: move remaining files to libbsc

2018-02-14 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6435

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

libcommon: move remaining files to libbsc

Move gsm_data.c and handover_cfg.c to libbsc, where they belong.

This leaves libcommon utterly empty, and it will be dropped in a subsequent
patch (Ifa3486f04cdd5fda1e92630dfc1a5f670773bc14).

Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
---
M src/libbsc/Makefile.am
R src/libbsc/gsm_data.c
R src/libbsc/handover_cfg.c
M src/libcommon/Makefile.am
4 files changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index d118f44..f03b498 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -37,6 +37,7 @@
bts_unknown.c \
bts_sysmobts.c \
chan_alloc.c \
+   gsm_data.c \
handover_decision.c \
handover_logic.c \
meas_rep.c \
@@ -58,5 +59,6 @@
bsc_dyn_ts.c \
bts_ipaccess_nanobts_omlattr.c \
handover_vty.c \
+   handover_cfg.c \
$(NULL)
 
diff --git a/src/libcommon/gsm_data.c b/src/libbsc/gsm_data.c
similarity index 100%
rename from src/libcommon/gsm_data.c
rename to src/libbsc/gsm_data.c
diff --git a/src/libcommon/handover_cfg.c b/src/libbsc/handover_cfg.c
similarity index 100%
rename from src/libcommon/handover_cfg.c
rename to src/libbsc/handover_cfg.c
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
index 02ec0b6..6d39cb5 100644
--- a/src/libcommon/Makefile.am
+++ b/src/libcommon/Makefile.am
@@ -20,6 +20,4 @@
$(NULL)
 
 libcommon_a_SOURCES = \
-   gsm_data.c \
-   handover_cfg.c \
$(NULL)

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


gapk[master]: Ignore build products

2018-02-14 Thread Vadim Yanitskiy

Patch Set 1:

> Patch Set 1: Code-Review+2

Harald? This change isn't ready I think.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I24be6fdbd17c7877d7a9a87081107dc5a3cd2fe8
Gerrit-PatchSet: 1
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: No


gapk[master]: Ignore build products

2018-02-14 Thread Vadim Yanitskiy

Patch Set 1:

> Must be leftover from earlier compilation.

Shouldn't be here now.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I24be6fdbd17c7877d7a9a87081107dc5a3cd2fe8
Gerrit-PatchSet: 1
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 
Gerrit-HasComments: No


[PATCH] osmo-bsc[master]: drop libcommon completely, move remaining files to libbsc

2018-02-14 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/6435

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

drop libcommon completely, move remaining files to libbsc

Move gsm_data.c and handover_cfg.c to libbsc, where they belong.

This leaves libcommon utterly empty, drop it.

Change-Id: I6178061fa30c7e1a4c22c29d3c8f508b1033569f
---
M configure.ac
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/libbsc/Makefile.am
R src/libbsc/gsm_data.c
R src/libbsc/handover_cfg.c
D src/libcommon/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc_nat/Makefile.am
M src/utils/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/bssap/Makefile.am
M tests/channel/Makefile.am
M tests/gsm0408/Makefile.am
M tests/nanobts_omlattr/Makefile.am
M tests/subscr/Makefile.am
19 files changed, 3 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/35/6435/5

diff --git a/configure.ac b/configure.ac
index d756970..b2644fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,6 @@
 include/osmocom/bsc/Makefile
 src/Makefile
 src/libbsc/Makefile
-src/libcommon/Makefile
 src/libfilter/Makefile
 src/libcommon-cs/Makefile
 src/osmo-bsc/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 637272d..28b070e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,6 @@
 
 # Libraries
 SUBDIRS = \
-   libcommon \
libcommon-cs \
libbsc \
libfilter \
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index b3b2b8c..0301d3a 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -30,7 +30,6 @@
 
 abisip_find_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
 
@@ -48,7 +47,6 @@
 ipaccess_config_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
 
@@ -58,6 +56,5 @@
 
 ipaccess_proxy_LDADD = \
$(top_builddir)/src/libbsc/libbsc.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(OSMO_LIBS) \
$(NULL)
diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am
index d118f44..f03b498 100644
--- a/src/libbsc/Makefile.am
+++ b/src/libbsc/Makefile.am
@@ -37,6 +37,7 @@
bts_unknown.c \
bts_sysmobts.c \
chan_alloc.c \
+   gsm_data.c \
handover_decision.c \
handover_logic.c \
meas_rep.c \
@@ -58,5 +59,6 @@
bsc_dyn_ts.c \
bts_ipaccess_nanobts_omlattr.c \
handover_vty.c \
+   handover_cfg.c \
$(NULL)
 
diff --git a/src/libcommon/gsm_data.c b/src/libbsc/gsm_data.c
similarity index 100%
rename from src/libcommon/gsm_data.c
rename to src/libbsc/gsm_data.c
diff --git a/src/libcommon/handover_cfg.c b/src/libbsc/handover_cfg.c
similarity index 100%
rename from src/libcommon/handover_cfg.c
rename to src/libbsc/handover_cfg.c
diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am
deleted file mode 100644
index 02ec0b6..000
--- a/src/libcommon/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-AM_CPPFLAGS = \
-   $(all_includes) \
-   -I$(top_srcdir)/include \
-   -I$(top_builddir) \
-   $(NULL)
-
-AM_CFLAGS = \
-   -Wall \
-   $(LIBOSMOCORE_CFLAGS) \
-   $(LIBOSMOGSM_CFLAGS) \
-   $(LIBOSMOVTY_CFLAGS) \
-   $(LIBOSMOABIS_CFLAGS) \
-   $(LIBOSMOSIGTRAN_CFLAGS) \
-   $(LIBOSMOLEGACYMGCP_CFLAGS) \
-   $(COVERAGE_CFLAGS) \
-   $(NULL)
-
-noinst_LIBRARIES = \
-   libcommon.a \
-   $(NULL)
-
-libcommon_a_SOURCES = \
-   gsm_data.c \
-   handover_cfg.c \
-   $(NULL)
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 7978852..50f9c78 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -43,7 +43,6 @@
$(top_builddir)/src/libfilter/libfilter.a \
$(top_builddir)/src/libbsc/libbsc.a \
$(top_builddir)/src/libcommon-cs/libcommon-cs.a \
-   $(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOVTY_LIBS) \
diff --git a/src/osmo-bsc_nat/Makefile.am b/src/osmo-bsc_nat/Makefile.am
index a941b58..83ef850 100644
--- a/src/osmo-bsc_nat/Makefile.am
+++ b/src/osmo-bsc_nat/Makefile.am
@@ -41,7 +41,6 @@
$(top_builddir)/src/libfilter/libfilter.a \
$(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) \
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 78d4965..354f2b2 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -49,7 +49,6 @@
 b

[ABANDON] osmo-bsc[master]: drop libcommon completely

2018-02-14 Thread Neels Hofmeyr
Neels Hofmeyr has abandoned this change.

Change subject: drop libcommon completely
..


Abandoned

merged with previous patch ("libcommon: move remaining files to libbsc") as an 
easy way out of the hundredth build failure which I can't be bothered to 
resolve anymore

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

Gerrit-MessageType: abandon
Gerrit-Change-Id: Ifa3486f04cdd5fda1e92630dfc1a5f670773bc14
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder


[PATCH] gapk[master]: Ignore build products

2018-02-14 Thread Max
Hello Vadim Yanitskiy, Harald Welte,

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

https://gerrit.osmocom.org/6383

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

Ignore build products

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


  git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/83/6383/2

diff --git a/.gitignore b/.gitignore
index 298604e..0de9da7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,3 +51,4 @@
 # temporary/backup files
 *.*~
 .*.swp
+/compile

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I24be6fdbd17c7877d7a9a87081107dc5a3cd2fe8
Gerrit-PatchSet: 2
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 


[PATCH] gapk[master]: Ignore build products

2018-02-14 Thread Max
Hello Vadim Yanitskiy, Harald Welte,

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

https://gerrit.osmocom.org/6383

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

Ignore build products

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


  git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/83/6383/3

diff --git a/.gitignore b/.gitignore
index 298604e..ffef58f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,3 +51,6 @@
 # temporary/backup files
 *.*~
 .*.swp
+/compile
+.dirstamp
+

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I24be6fdbd17c7877d7a9a87081107dc5a3cd2fe8
Gerrit-PatchSet: 3
Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: tnt 


osmo-msc[master]: libmsc: bssap: Catch TLV parse failures

2018-02-14 Thread Harald Welte

Patch Set 1: Code-Review-1

(1 comment)

Sorry, I think it's ugly to have the same code copy+pasted everywhere.  Can't 
we simply do the TLV parsing at a common/shared point and hand the 
already-parsed tlv_parsed into the indiividual functions?  This way there's 
reduction of code duplication and only one place where we need to check for the 
tlv parser result.

https://gerrit.osmocom.org/#/c/6448/1/src/libmsc/a_iface_bssap.c
File src/libmsc/a_iface_bssap.c:

Line 228:   LOGP(DBSSAP, LOGL_ERROR, "Failed parsing TLV -- 
discarding message!\n");
makes sense to hexdump the message.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6aef9a94fa5b2e0b62a9c1744b8e18e5985f788f
Gerrit-PatchSet: 1
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: Yes


[PATCH] osmocom-bb[jolly/testing]: transceiver: Fix RSP SETSLOT format

2018-02-14 Thread Pau Espin Pedrol

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

transceiver: Fix RSP SETSLOT format

According to osmo-trx README:
SETSLOT sets the format of the uplink timeslots in the ARFCN.
The  indicates the timeslot of interest.
The  indicates the type of channel that occupies the timeslot.
A chantype of zero indicates the timeslot is off.
CMD SETSLOT  
RSP SETSLOT   

Change-Id: I63c81155c84fc35cff1704734fd8d2732235c5a4
Related: OS#2944
---
M src/host/layer23/src/transceiver/trx.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/49/6449/1

diff --git a/src/host/layer23/src/transceiver/trx.c 
b/src/host/layer23/src/transceiver/trx.c
index 8432dca..3f51928 100644
--- a/src/host/layer23/src/transceiver/trx.c
+++ b/src/host/layer23/src/transceiver/trx.c
@@ -340,7 +340,7 @@
if (trx->l1l[tn])
l1ctl_tx_bts_mode(trx->l1l[tn], 1, trx->type, trx->bsic, 
trx->arfcn, trx->gain, trx->l1l[tn]->tx_mask, trx->l1l[tn]->rx_mask, 
trx->handover);
 
-   return _trx_ctrl_send_resp(trx, cmd, "%d %d", 0, type);
+   return _trx_ctrl_send_resp(trx, cmd, "%d %d %d", 0, tn, type);
 }
 
 static int

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63c81155c84fc35cff1704734fd8d2732235c5a4
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: jolly/testing
Gerrit-Owner: Pau Espin Pedrol 


  1   2   >