Commit Graph

441 Commits

Author SHA1 Message Date
Pau Espin 67d32a0386 Bump version: 0.5.0.23-11a1 → 0.6.0
Change-Id: I5f42c0ad1a930004415f097d984e1fd1b2d277e6
2020-01-03 17:04:15 +01:00
Vadim Yanitskiy 11a1639b2d osmo-hnbgw: make sure osmo_ss7_init() executed successfully
Change-Id: Ia9ecf903e79b282aa4fa88a291424681d0fe9d89
Fixes: CID#206089
2020-01-01 14:05:57 +01:00
Harald Welte cc0914d018 exit(2) on unsupported positional arguments on command line
Change-Id: Id33caf93325074f9e5b2b322ac497b1c21c3f406
2019-12-03 21:53:08 +01:00
Alexander Couzens 9fb8cac6dc iu_client: ranap_iu_tx_release() change default cause code to Success
The cause code no remaining rab should be only used when closing the
Iu connection on this specific reason. Change default to NAS Success
Release which is a usual release.

Change-Id: Icf3f06b0de7dcda9f967ae29863054ef813c75e5
2019-10-08 13:02:11 +02:00
Alexander Couzens a6eb09d6db iu_client: pass return value of osmo_sccp_user_sap_down() towards the caller
osmo_sccp_user_sap_down return 0 on success, negative values on failure

Change-Id: I3b7c2296eb8b26f0881cee643b834336daab86ea
2019-10-03 20:30:31 +02:00
Harald Welte e844bf7828 sabp: Generate C/H files for SABP; create libosmo-sabp
This uses the (modified) Osmocom asn1c on the (modified) SABP ASN.1
syntax to generate C code + header files for SABP parsing/encoding.

It also adds some helper code for message encoding and decoding as well
as a new libosmo-sabp shared library which can be used by programs to
implement SABP related functionality.

Change-Id: Ib9580d1af96354398da4c9f97b28a0e23d56e275
2019-09-23 20:23:51 +02:00
Pau Espin 965d53348e hnbgw: Add libosmoctrl's VTY CTRL command initialization
Otherwise, the "ctrl" VTY node is not available and CTRL ip address
cannot be set.

Change-Id: I73f64b951690ec23f829c4855b2caeefa66ad35d
2019-09-20 17:21:23 +02:00
Alexander Couzens 32fc82a803 iu_client: introduce UE field free_on_release
Allow to free UE ctx when receiving a Iu Release Complete.
In preparation of ranap_iu_tx_release_free() it requires
a field to free the Iu ctx on it's own without depending
on the upstream user.

Change-Id: Iac41cd3cce3232d01b2f7ede0cc46226c2cfb6c0
2019-09-16 13:57:50 +00:00
Alexander Couzens ff79699b48 iu_client: introduce ranap_iu_tx_release_free()
ranap_iu_tx_release_free is a fire and forget function to release
gracefully if possible. It first sends a Iu Release Command. After
a certain timeout the connection will be released.

Change-Id: I349e2c61ba0131e233b7ab927dfced0bd461dd8f
2019-09-15 20:42:30 +02:00
Alexander Couzens 8e2a0ee8e2 iu_client: allow to control the notifications
The iu_client is informing the library user about global event.
In prepration to the tx_iu_release_free() call allow to
disable upstream notificatiosn

Change-Id: Ic93ef6fd54c995405e9c37a5e0c53f81a89850b7
2019-09-12 01:34:37 +02:00
Alexander Couzens 790212fcaf iu_client: introduce a guard around global_iu_event_cb
As preparation to enable and disable notifications for a specific ue connection,
add a slim proxy before calling global_iu_event_cb

Change-Id: I49a3402a871d6dccd343cda49f8a7f82bffe150b
2019-09-10 19:10:50 +02:00
Alexander Couzens efdd80dc0a iu_client: emit RANAP_IU_EVENT_LINK_INVALIDATED on SCCP disconnect indication
Change-Id: I168b5c67336c4d1cb9fcebb9c26a7cf2fc46e420
2019-09-03 18:44:34 +02:00
Alexander Couzens 609994d146 iu_client: introduce ranap_iu_free_ue() to free the UE connections
When freeing the UE connection object, disconnect the SCCP connection.

Change-Id: I6812edb4da487507ccf9f483de801c1c65c4b72b
2019-09-03 18:44:27 +02:00
Alexander Couzens 4ae261b89b iu_client: sccp_sap_up: don't decode empty disconnect indications
Change-Id: I1fea8f19433d908583de71d8d2401bbb8c0c7900
2019-09-03 18:40:57 +02:00
Alexander Couzens 87482b335c iu_client: ensure UE is not NULL on CO primitives
When ue_conn_ctx_find() can not find a UE it returns NULL.

Change-Id: I63222fda6778417b1c986cb05772fecc51c43bb5
2019-09-03 16:42:07 +02:00
Alexander Couzens 80307924f1 iu_client: sccp_sap_up: set rc early
Allows to skip assignment later.

Change-Id: Idd803774612719df144bef569fb734289aa31282
2019-09-03 16:42:06 +02:00
Vadim Yanitskiy dab16ff3f5 hnbgw_vty.c: fix: properly pass pointer to g_hnb_gw
Otherwise the process hangs if the user enters:

  $ show hnb NAME

hnbgw_vty.c: In function ‘show_one_hnb’:
hnbgw_vty.c:234:2: warning: passing argument 1 of
                   ‘hnb_context_by_identity_info’
		   from incompatible pointer type
		   [enabled by default]
iuh/hnbgw.h:154:21: note: expected ‘struct hnb_gw *’
                    but argument is of type ‘struct hnb_gw **’

Change-Id: I42fdb10af5f6427886b5797325830dfc212af30f
2019-08-23 00:30:40 +02:00
Pau Espin 505fa9eae7 Bump version: 0.4.0.14-92ea-dirty → 0.5.0
Change-Id: I53c1743eda203bf075f93f891e336ca4ec6866a8
2019-08-07 21:23:57 +02:00
Pau Espin 92ea15a53f Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.

Change-Id: I31a286bebe3229671d9960ae32a753d260a26b1d
Related: OS#4138
2019-08-05 14:49:35 +02:00
Thorsten Alteholz 445bdccffa spelling stuff found by lintian
Change-Id: I8434640701746d5db8707472d1d26c313e0814e9
2019-07-16 21:48:47 +02:00
Harald Welte 11b1ddee21 ranap_msg_factory: Fix criticality of PDUs
Seveal of our RANAP messages were using criticality values at the
PDU level differing from what RANAP_PDU_Descriptions.asn states
for the respective procedures.  Let's fix that.

This was discovered while working on the initial IuCS TTCN3 tests,
where the receive templates require the criticality to match.

Change-Id: I98eec0bdc0d0cb1b9284bd5d042b1f4403abef95
2019-04-20 22:53:49 +02:00
Harald Welte 8fa35b840c iu_client: Implement transmission of ResetAcknowledge
When receiving an Iu Reset, respond with Iu ResetAcknowledge.

Closes: OS#3944
Change-Id: Ia09752983a7e2a952aa144635924edbffd894058
2019-04-20 21:13:12 +02:00
Oliver Smith f601526970 tests: use -no-install libtool flag to avoid ./lt-* scripts
This ensures that the rpath of the generated binaries is set to use only
the just-compiled so-files and not any system-wide installed libraries
while avoiding the ugly shell script wrapper.

Change-Id: I92c7391631becc09d277981179c23f2e4dba3b54
2019-03-19 13:46:08 +01:00
Neels Hofmeyr e22027ae2a osmo-hnbgw: reply with RESET ACK when receiving a RESET
Rationale: current osmo-msc refactoring introduces RESET handling on IuCS.

In particular, it makes osmo-hnbgw be able to operate with an (upcoming)
osmo-msc that has strict RESET handling: it will send a RESET and require a
RESET ACK if it sees a new IuCS peer sending messages without prior RESET.

Even though a workaround to ignore missing RESET messages on IuCS will also be
in place in the new osmo-msc, this is a first small step towards more sane
RESET handling in osmo-hnbgw.

Related: OS#3820
Change-Id: I02bc74ef9fef61f4490b4d4dc3ce6c0a6d965909
2019-03-08 05:10:48 +01:00
Neels Hofmeyr 39d7b5c646 osmo-hnbgw: logging tweaks
Log about:
- sending RESET messages to CN;
- accepting a new hNodeB peer on HNBAP.

Change-Id: I317831dbc6c463e4d4dcde9e6716431e026c4398
2019-03-08 05:10:48 +01:00
Neels Hofmeyr f8d5f37c20 osmo-hnbgw: set a proper talloc ctx for logging
Change-Id: I006103d8d7fb15e2612fff619879940d8405e045
2019-03-04 22:41:14 +01:00
Neels Hofmeyr 3c839966b6 osmo-hnbgw: fix cmdline: do not force-disable colored logging
Un-jam the commandline option to disable color: it is so far stuck in
--disable-color and overrides everything so that we never see any colored
logging from osmo-hnbgw, whichever cmdline or cfg we pass.

Change-Id: I00400b626925fa9da707ad6679d8448941dbfa98
2019-03-04 22:38:59 +01:00
Harald Welte 92a88ee73f Bump version: 0.3.0.10-9e66-dirty → 0.4.0
Change-Id: Ib2943b7fd0a1f7ca79f761116cba30aa3aa29b88
2019-01-20 21:46:06 +01:00
Stefan Sperling 319c28581e add a VTY command which shows a specific HNB
Add the 'show hnb NAME' VTY command which displays just
one specific HNB, addressed by its identity string.
This augments the functionality provided by 'show hnb all'.

Change-Id: Iab12aa4ab090b72c472358b84daf6919b30747f6
Related: OS#2774
2018-10-31 12:18:02 +01:00
Harald Welte 9aad185151 hnbgw_tx_hnb_register_rej(): Missing return statement
Change-Id: I0bdee8ede9ffdc16c16a4f5723acb7b4bceb2158
Fixes: Coverity CID#188869
2018-10-21 11:46:14 +02:00
Neels Hofmeyr a770f6967b fix transport layer addr again, for nano3g
The nano3G sends the RAB Assignment Response's Transport Layer Address in X.213
NSAP padded to 20 bytes (160bit). Do not interpret it as 4-byte IP address,
which currently breaks nano3G voice calls (wrong RTP IP address).

Recent commit I2cd1b2d8e1c1ae707cfc0dc7961a2b31ecdf29e0 fixed decoding of X.213
NSAP that is exactly seven bytes, but broke decoding of the padded version from
the nano3G.

A proper X.213 NSAP decoding would still be more welcome than this patching
back and forth, but this is (another) quick fix without spending too much time
on it.

Related: OS#3420
Change-Id: I0ad8bce6fcfd3829394c39490058c1ab85cdfde3
2018-09-30 23:35:35 +02:00
Neels Hofmeyr b876b421e3 hnbgw: vty: add SCCP related vty commands
Depends: I214ea51fc6bfa2a9a4dd7c34b43add0c77ffe22e (libosmo-sccp)
Change-Id: I2f81e078d7a26dd39f8ff9d0f9273ee1a3434232
2018-09-27 03:35:15 +02:00
Neels Hofmeyr 236d1d4865 fix decoding of incoming X.213 NSAP addr
Fix ranap_transp_layer_addr_decode() to test == 7 instead of > 7: If a femto
cell sends its Transport Layer Address as X.213 NSAP IPv4, we receive 3 header
bytes and four IP-address bytes, so the length is exactly 7.

This function is very vague on numerous other decoding details, but this patch
only fixes the vital length check that makes 3G usable with X.213 NSAP.

Related: OS#3420
Change-Id: I2cd1b2d8e1c1ae707cfc0dc7961a2b31ecdf29e0
2018-08-20 17:31:58 +02:00
Alexander Couzens ad4ea3b10e hnbgw: remove close_cb() to fix a crash when releasing a hnbgw
The read callback should catch all errors already.
Previous when a read fails it:

* hnb_context_release() -> osmo_stream_srv_destroy() -> hnb_context_release()
On the second hnb_context_release() the hnbgw will crash because calling
llist_del() twice on the same object.

Fixes: OS#3416
Change-Id: Ic84b2184b7fc850c0de2acacf179e86771e17510
2018-07-24 19:08:19 +02:00
Pau Espin ba941e553d Bump version: 0.2.0.57-cf5f-dirty → 0.3.0
Change-Id: Id5d2f749bca46e8b81cc2934447707e3db80ea18
2018-05-03 18:29:14 +02:00
Neels Hofmeyr cf5fbea78f cosmetic: use osmo_plmn_id instead of mcc,mnc
It's cosmetic since the MCC and MNC in the PLMN aren't actually used,
currently. It makes sense to do it properly anyway, while I'm still in the
3-digit MNC topic, for the future.

Change-Id: I29ebcddd45fe3079f8883589a83cc7216a535475
2018-03-21 15:55:18 +01:00
Neels Hofmeyr 3050864b73 hnb-test: log accurate three-digit MNC with leading zeros
Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore)
Change-Id: Ie3dd206bca2f38a0ef7ee7f9d3b6bf2eacc899a4
2018-02-28 19:26:07 +01:00
Stefan Sperling c964a2cfa1 ensure unique CellIDs in HNB-GW
If we receive a HNB-REGISTER-REQ with a cell ID which is already used
by another registered NNB, log an error and send HNB-REGISTER-REJECT.

Tested manually by running two 'hnb-test' programs concurrently (they
need to listen on different telnet ports; this port is hard-coded so
I compiled two different hnb-test binaries).
Then I issued the 'hnbap hnb register' command on the telnet interface
of each, and verified that the correct action is logged by osmo-hnbgw.
Both hnb-test programs can connect, but only one of them can register
at a time. Killing a registered 'hnb-test' program terminates its
connection and allows the previously rejected one to register.

The new rejection log message looks like this:
 hnbgw_hnbap.c:429 rejecting HNB-REGISTER-REQ with duplicate cell
 identity MCC=901,MNC=99,LAC=49406,RAC=66,SAC=43947,CID=182250155
 from (r=127.0.0.1:42828<->l=127.0.0.1:29169)

This change depends on a new API in libosmo-netif, which is added in
https://gerrit.osmocom.org/#/c/6844/

Change-Id: Iffd441eb2b6b75dfbe001b49b01bea015ca6e11c
Depends: I8ed78fe39c463e9018756700d13ee5ebe003b57f
Related: OS#2789
2018-02-22 20:29:06 +00:00
Neels Hofmeyr 2293df070c hnbap: log errors on decoding/encoding HNB-REGISTER msgs
Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1
2018-01-18 19:01:09 +01:00
Neels Hofmeyr 8a2b6e2b6f cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome
HNBAP isn't really that important to osmo-hnbgw operation, all we do is service
the few requests so that the other side is happy and uses our Iuh.
Nevertheless, could at least log if an UnsuccessfulOutcome was received.

Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1
2018-01-15 23:40:38 +01:00
Neels Hofmeyr 02296af07d hnbgw_hnbap: fix missing return in rx [un]successful outcome
Fixes: CID#57732 CID#57733
Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832
2018-01-15 23:30:57 +01:00
Neels Hofmeyr e3644ac476 hnbgw_cn: rx ranap: set rc in all cases
There don't seem to be any evaluations of the rc, nevertheless return
well-defined values.

Fixes: CID#181968
Change-Id: I59295388564e5d270da32db6e7488755231f8a11
2018-01-15 23:28:08 +01:00
Neels Hofmeyr 6814d22d5f hnbgw_rua: fix dereference of unset pointer
In the UNITDATA case, there is no map, so a) initialize map as NULL and b)
print the RUA ctx id directly from local var context_id instead.

Fixes: CID#181969
Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe
2018-01-15 23:28:08 +01:00
Neels Hofmeyr 70d3ece487 hnbgw_rua.c: log: fix integer format for cN_DomainIndicator
Fixes: CID#135219
Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0
2018-01-15 23:28:00 +01:00
Pau Espin e9b4c390b4 iu_client.c: Remove unusued variable
Change-Id: If841d403010a73722ff69617a51719421febab56
2018-01-08 11:07:26 +01:00
Max bfeea6713b Expand ctrl interface
Add commands to get number of connected HNBs and identity string of
connected HNB based on Cell ID.

Change-Id: I3a2d6fa3d6d0829ccee4ecc0998d9299c97820e9
2017-12-31 11:02:07 +00:00
Max ef727410b2 Add control interface
* add libosmoctrl dependency
* bind control interface

Change-Id: I4637e88da00bac1ab0237c29ac73806d024863ba
2017-12-31 11:02:07 +00:00
Max 1e57ba503e Use proper package version
Use actual application version instead of hardcoded "0".

Change-Id: I8711b9d819454d810291d57b97119d9fe4a47f8e
2017-12-28 12:27:41 +01:00
Harald Welte f8b73b15c0 hnbgw_vty.c: Fix "-Werror=format-security" failure in vty_out()
We have to use a format string, we cannot directly print "name".

Fixes a build error on our OBS builds:
hnbgw_vty.c:156:5: error: format not a string literal and no format arguments [-Werror=format-security]
which was introduced in Change-Id I3c937306a011715e163a40bc8ef8ec7e8d4e5d08
about one week ago.

Change-Id: I042989c2b7b379284b2ee5fea3bd8f8ce406b09e
2017-12-26 21:41:16 +01:00
Harald Welte 8e88d37cec hnbgw_vty.c: cosmetic: Fix non-tab-indented code
This was introduced a week ago in Change-Id
I3c937306a011715e163a40bc8ef8ec7e8d4e5d08 and is now cleaned up.

Change-Id: Iaadf941aa7f1c5ae05eb02b51cc646b7b5587ba3
2017-12-26 21:41:16 +01:00