Commit Graph

12 Commits

Author SHA1 Message Date
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
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
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
Pau Espin e9b4c390b4 iu_client.c: Remove unusued variable
Change-Id: If841d403010a73722ff69617a51719421febab56
2018-01-08 11:07:26 +01:00
Neels Hofmeyr 69888c86ed iu client: store multiple LAC,RAC per RNC = fix paging for multiple RNC
Introduce a list of LAC+RAC entries for each RNC, hence allow serving more than
one LAC per OsmoHNBGW.

iu_client is used by OsmoMSC and OsmoSGSN, both will be able to page
successfully in a setup with multiple LACs (read: multiple hNodeB) connected to
an OsmoHNBGW.

Ensure that each LAC,RAC is registered with at most one RNC Id. If a LAC,RAC
shows up on a different RNC Id than before, move it over to the new RNC Id.

Future patches should probably add:

* timeouts of RNC Id / LAC,RAC validity, to remove unused entries.
* VTY/CTRL commands to introspect which RNCs and LAC,RACs are listed.
* VTY/CTRL commands to remove RNC Id / LAC,RAC entries.

Change-Id: I189f8e2663353276b1c615d2f78455dafe568045
2017-12-19 03:20:18 +01:00
Harald Welte da86fe5ae3 Fix various compiler warnings in hnb-gw code
Since we finally started to use -Wall, the related warnings became
visible.

Change-Id: I516700eab2aa7c3412dd62775c4960aed9d4b682
2017-11-21 11:08:56 +00:00
Neels Hofmeyr 1aef9a6e1f iu_client: derive local SCCP addr from sccp instance
ranap_iu_init() is passed an sccp instance that has a local primary point code.
Use this primary PC by default as the local address for IuCS and IuPS clients.

Remove the current vty command 'iu local-address point-code PC':
- It is possible that we would like to configure a differing local point code
  at some point; this should then happen via sccp address book entries, not
  parsing PC directly.
- Obtaining the local PC from the SCCP instance makes this command obsolete for
  all setups we're currently aiming at: one local PC per SCCP instance.
- There are vty doc failures in this vty command, which cause osmo-msc and
  osmo-bsc vty test failures; rather than fixing this, let's drop it entirely
  until we see a need for it (and then do it properly with the address book).

Cosmetic: prefix the local static variable with g_* like g_sccp and g_scu and
define it in the same place. No default values are needed anymore, it gets
overwritten in ranap_iu_init().

Change-Id: I3bb7fc1cd5261d214c6ba0cccfe95f637e6db087
2017-08-13 22:46:04 +00:00
Neels Hofmeyr aae68b2791 move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_client
To help split openbsc.git to separate MSC and SGSN repositories, place the
common Iu interface related code here in libosmo-ranap. Also apply various
improvements while moving (from intermittent code review).

The code depends on libosmo-ranap tightly. One reason to want this separate
from libosmo-ranap could be that it uses libosmo-sigtran, accepting an sccp
instance. However, including in libosmo-ranap is the simplest way to go. The
osmo-iuh build depends on libosmo-sigtran anyway because of OsmoHNBGW, and all
current users of libosmo-ranap also naturally link libosmo-sigtran already.

Apply prefix ranap_iu_ and RANAP_IU_ to allow smooth transition from the
openbsc.git iu_ to the libranap ranap_iu_ implementations.

Prune unneeded #include statements.

Instead of sccp_addr, store an rnc pointer in the ue_conn_ctx. To facilitate,
also:
- Move iu_rnc struct to iu_client.h (as ranap_iu_rnc).
- Instead of sccp_addr, pass rnc to ue_conn_ctx_alloc().
- Pass a local struct new_ue_conn_ctx containing the sccp_addr and conn_id up
  the RANAP handling stack in case of an InitialUE message.
- Separate the InitialUE message handling from cn_ranap_handle_co(), by moving
  to new and separate cn_ranap_handle_co_initial(), so we can still pass a
  looked-up ue_conn_ctx to all other cn_ranap_handle_co() code paths.
- Allocate the ue_conn_ctx only in ranap_handle_co_initial_ue(), not as early
  as before.
Note that we are not actually ever using the rnc pointer now present in
ue_conn_ctx. It could be used for more concise paging, to first page only the
RNC where we last saw the subscriber. So far we page all matching LAC/RACs.

Tweak error logging: use __func__ instead of writing the function names as
string constants.

In iu_client_vty.c:
- Move the asn.1 debug commands from logging over to the iu node. They are not
  specific to the logging target. They could qualify for an entirely separate
  'asn1' root node, but for simplicity place under 'iu'.
- Add the 'asn1' commands to ranap_iu_vty_config_write(), so far missing.
- remove the legacy "net." from a VTY error message, it is not known which name
  the parent node of 'iu' has.

Depends: libosmo-sccp I85b46269dbe7909e52873ace3f720f6292a4516c,
	 libosmo-sccp Ie1aedd7894acd69ddc887cd65a8a0df4b888838c
Change-Id: I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0
2017-07-31 13:20:00 +02:00