aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2024-03-27constify {hnbap_rua}_cause_str() argumentHarald Welte2-2/+2
ranap_cause_str() already had a const input argument, but the HNBAP and RUA equivalents for some reason had a non-const input. Change-Id: I7db92b51847c282d23d568970dfd2bedecdea486
2024-03-15Add ranap_decode_rab_releaseditemies_fromlist()Harald Welte1-0/+5
This function is analogous to existing ranap_decode_*_itemies_fromlist() which we already had. This is needed in an upcoming osmo-hnbgw patchset where we need to parse the ReleasedItems in order to track RAB release progess in order to gather KPIs on RAB release. Change-Id: I328819c650fc6cefe735093a846277b4f03e6b29
2023-05-11add ranap_new_msg_reset2() with GlobalRNC-IDNeels Hofmeyr1-0/+3
So far we are omitting the GlobalRNC-ID from all of our RANAP RESET messages, because clearly, in 3GPP TS 25.413 9.1.39, the Global RNC-ID is listed as optional. OTOH, section 8.26.2.1 says "The RNC shall include the Global RNC-ID IE in the RESET message." Apparently an RNC must include this ID, while a CN omits it. Related: SYS#6441 Change-Id: Iec70c3054333f01bc27ca0e69bfa325bbe36edd0
2022-11-15ranap_common_cn: rename ctx -> privOliver Smith2-3/+3
Rename the "ctx" argument of ranap_cn_rx_co and ranap_cn_rx_cl to "priv" as it is private user data passed to the callback. Change-Id: I929548e9224298be94f7d3ed4cdca0580147721d
2022-11-15ranap_common_cn: remove unused ctx argsOliver Smith1-2/+6
ranap_cn_rx_co and ranap_cn_rx_cl both have a void *ctx argument, that gets passed to: * a callback function and * to various decode functions in the same file. As it is named "ctx", it looks like a talloc context. But the decode functions don't use ctx at all and so in reality it is private userdata for the callback. It is used as such by test/hnb-test-rua and in osmo-msc. Start cleaning this up by removing the unused ctx args, a future patch will rename it to priv and yet another patch will fix a compiler warning in test/hnb-test-rua by properly using it as userdata arg. Change-Id: I8936197d7ae7ffddbe8ee99d909d74ac5b3ab227
2022-11-14asn1: fix visibility warnings from generated codeOliver Smith38-276/+837
Fix warnings from generated asn1 code in order to build osmo-iuh with werror in a future patch: ../../include/osmocom/hnbap/HNBAP_CriticalityDiagnostics-IE-List.h:29:23: error: ‘struct HNBAP_CriticalityDiagnostics_IE_List__Member’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror] These visibility warnings come from "SEQUENCE … OF SEQUENCE" definitions in the asn1 source files, as described in detail here: https://github.com/vlm/asn1c/issues/430 It is not possible to tell gcc to just ignore these warnings since they don't have their own type (unlike e.g. -Wuninitialized). Also it seems like a huge effort to patch this in asn1c. So work around the problem the same way the author of the issue worked around it by rewriting the lines to "SEQUENCE … OF …-Value" and adding a "…-Value ::= SEQUENCE" line below. Add a script in asn1/utils/asn1_restructure_sequence_of_sequence.py for the transformation and apply it. Related: OS#4462 Change-Id: If84445ed2e0df604b581684dcf83f8520b7da84c
2022-06-10move new_transp_layer_addr to public APINeels Hofmeyr1-0/+1
osmo-hnbgw will use this function in Ic9bc30f322c4c6c6e82462d1da50cb15b336c63a. Related: SYS#5859 Change-Id: Icc61620b4d11c4ba6823b40abc7c300f0533c058
2022-02-14ranap_common: add decoder for RAB-ReleaseListPhilipp Maier1-0/+5
There is currently no decoder to decode RAB-ReleaseList objects properly. Lets add one. Change-Id: I4fc88402a863bc1482947985f759d3a26eea4164 Related: OS#5152
2022-02-14ranap_common: add decoder for RAB-FailedListPhilipp Maier1-0/+5
There is currently no decoder to decode RAB-FailedList objects properly. Lets add one. Change-Id: I0f42487968f2a39f2425068c001950509a3bd28f Related: OS#5152
2022-01-31ranap_common_ran: add decoder for CN/MSC originated messagesPhilipp Maier4-2/+19
Lets add a counterpart for ranap_common_cn that works the same, but decodes CN/MSC originated messages. Change-Id: Iad4c2743d4d1ddf8ad49002d1fe6866f22eb9e98 Related: OS#5152
2022-01-28ranap_common_cn: add functions for direct access to decoderPhilipp Maier1-0/+12
The message encoder functions that decode a message to a struct ranap_message are only accessible via a callback function that is passed to ranap_cn_rx_cx The decoded ranap_message only lives inside the callback since it is freed by ranap_cn_rx_cx when the callback is done. In some situations this might make using the decoder incredibly difficult since it is not possible to keep the decoding results for an extended amount of time. Lets put the decoding into a separate function and use this function in ranap_cn_rx_cx. Then lets make the decoder and the free function public so that the decoder can be used in a more open way. Change-Id: I14d2ed8e597a5d12024a6a6c72ff011dbeb2549d Related: OS#5152
2022-01-11iu_helpers: add function ranap_transp_layer_addr_decode2Philipp Maier1-0/+2
Add ranap_transp_layer_addr_decode2 as AF agnostic version of ranap_transp_layer_addr_decode. Change-Id: Ia60e0ab671fc4185815a880377ab88fcf1b30ac9
2022-01-10iu_helpers: make new_transp_info_(rtp|gtp) publicPhilipp Maier1-0/+7
The functions new_transp_info_rtp and new_transp_info_gtp are needed to generate the transport layer information struct. The functions are currently not public since they are only used in ranap_msg_factory.c but to reqwrite the RANAP RAB AssignmentReqtest / AssignmentResponse messages we can reuse this code, so lets make them public. Change-Id: I1e369718de8c4c7db1f1af1e6864562164ada6cf Related: OS#5152
2022-01-09cosmetic: don't use 4 speaces instead of tabsPhilipp Maier1-2/+2
Change-Id: Ie9ac6e363420d1cbe4f16049740493f6edbbe36a
2022-01-09ranap_common: add decoder for RAB SetupOrModifyItemFirstPhilipp Maier1-0/+5
The RAB SetupOrModifyItemFirst is contained in the RAB Assignment Request. We currently have no decoder for it, so lets add one. Change-Id: Id7293c1035cf6de34b7a416fa9265a5a32ed3216 Related: OS#5152
2022-01-04Drop osmo-hnbgwPau Espin Pedrol8-269/+1
OsmoHNBGW is now available in its own repository osmo-hnbgw.git. Change-Id: I4e17c578b432f0c997ea4e13b1c468b112278854
2022-01-04Introduce dynamic log category for libosmo-rua/hnbapPau Espin Pedrol3-3/+9
Same as already done for libosmo-ranap. This allows applications setting the cateogy dynamically, and will allow untangling library tests using hnbgw log categories in this repo. Change-Id: I5d09b67b115ad8938e5162a23accfcbafab139d4
2021-10-27ranap: Use asn1c flag -fcompound-names to avoid name collisions with other libsPau Espin Pedrol579-726/+726
Change-Id: Iba106dcc18e3d429b4b9808610a44ac29b798172
2021-10-27sabp: Use asn1c flag -fcompound-names to avoid name collisions with other libsPau Espin Pedrol61-81/+81
Change-Id: I10ce4a9414768cdcf850feeca4088296e339919f
2021-10-27rua: Use asn1c flag -fcompound-names to avoid name collisions with other libsPau Espin Pedrol35-79/+79
Change-Id: Id4e337cdc82c26922b7ca7f0fe8af523e9a0945c
2021-10-27hnbap: Use asn1c flag -fcompound-names to avoid name collisions with other libsPau Espin Pedrol115-157/+157
Change-Id: I1bcbe047d233684647d6ffe9febb14a12c579696
2021-10-27hnbap: Drop no longer existing asn1c param -fnative-typesPau Espin Pedrol115-115/+115
This is an option enabled by default and not existent as cmdline param since asn1c 0.9.26. For some reason, when dropping it, asn1c generates different description comment section on related files. In any case, this makes hnbap look like other libraries which already got this param removed and hence also generateds code looks the same. Change-Id: Iccf81539a5045416185e619d24c3d542204437e6
2021-10-26hnbap: Use specific prefix for HNBAP generated codePau Espin Pedrol193-4532/+4296
Other libraries already use ASN1C_PREFIX except the HNBAP one. Let's use it here to avoid collisions. All new include/osmocom/hnbap/HNBAP_*.h and src/hnbap/HNBAP_*.c are generated using the updated src/hnbap/Makefile.am. Files such as src/*.c, test/* and include/osmocom/hnbap/hnbap_common.h are modified manually to update structs/enums to new prefix. Related: SYS#5516 Change-Id: I6c062f631527ae42811bfec134933671c05ecba6
2021-10-26Update generated .c/.h after using asn1c -R paramPau Espin Pedrol790-115/+790
Change-Id: Ib7a03973d43828f47ff59b561d9ddce43186f8af
2021-10-22Provide libosmo-rua as a public shared libraryPau Espin Pedrol1-1/+3
It is needed by the new osmo-hnodeb project. Related: SYS#5516 Change-Id: I8b800baacbfe3a3c424c51b418b5ac2e2848b3ba
2021-10-22Provide libosmo-hnbap as a public shared libraryPau Espin Pedrol1-1/+3
It is needed by the new osmo-hnodeb project. Related: SYS#5516 Change-Id: I0d0862e9d59d3b206f3f7dfae4b39ae4032bb762
2021-04-14ranap_iu_tx_release_free(): always trigger RANAP_IU_EVENT_IU_RELEASE as a resultPau Espin Pedrol1-3/+3
This allows the SGSN always having feedback on the resolution of the release, hence being able to stay in PMM CONNECTED state until the resolution is received, then moving to PMM IDLE. Related: SYS#5389 Change-Id: Iac822c74e56750dc40e94573eae0e20853ff68c0
2021-02-08ranap_msg_factory: Allow detailed control over UEA/UIA algorithm encodedHarald Welte1-0/+3
Change-Id: I6d2d033b0427bdc84fee61e0f3cb7b29935214bf Closes: OS#4143
2020-12-30hnbgw: Introduce LOGHNB() macro for log context informationHarald Welte1-0/+6
So far we don't really have any way of matching a given log message to a specific hNB. Let's introduce a new log macro, together with a configuration directive to select whether the hNB-ID or the UMTS CellID shall be used. Change-Id: I6113925216c6f88add2c6d27bdf47ccbb017f293
2019-09-23sabp: Generate C/H files for SABP; create libosmo-sabpHarald Welte64-1/+3021
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-16iu_client: introduce UE field free_on_releaseAlexander Couzens1-0/+2
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-15iu_client: introduce ranap_iu_tx_release_free()Alexander Couzens1-0/+9
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-12iu_client: allow to control the notificationsAlexander Couzens1-0/+1
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-03iu_client: introduce ranap_iu_free_ue() to free the UE connectionsAlexander Couzens1-0/+4
When freeing the UE connection object, disconnect the SCCP connection. Change-Id: I6812edb4da487507ccf9f483de801c1c65c4b72b
2019-01-22ranap_msg_factory.h: fix enum def within function signatureNeels Hofmeyr1-0/+1
Include RANAP_KeyStatus.h so that we use the global enum RANAP_KeyStatus instead of defining another only within the ranap_new_msg_sec_mod_cmd() function declaration. Change-Id: Ifefaab32afa962dacdaa738a5419cce0a65a4b22
2018-10-31add a VTY command which shows a specific HNBStefan Sperling1-0/+1
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-07-24hnbgw: remove close_cb() to fix a crash when releasing a hnbgwAlexander Couzens1-1/+1
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-02-22ensure unique CellIDs in HNB-GWStefan Sperling1-1/+5
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
2017-12-31Expand ctrl interfaceMax1-1/+8
Add commands to get number of connected HNBs and identity string of connected HNB based on Cell ID. Change-Id: I3a2d6fa3d6d0829ccee4ecc0998d9299c97820e9
2017-12-31Add control interfaceMax1-1/+1
* add libosmoctrl dependency * bind control interface Change-Id: I4637e88da00bac1ab0237c29ac73806d024863ba
2017-12-25osmo-hnbgw: vty: revamp output of context maps on 'show hnb'Neels Hofmeyr1-0/+5
Instead of listing each and every context map, rather output a summary of context counts. Rationale: in a list of a hundred HNBs, I don't want to also see a dozen (or potentially thousands of) context map lines for each. Furthermore, the conn IDs aren't necessarily useful on network traces either. For example, what was shown as SUA Id is incidentally the SCCP Reference, but this is not a hard requirement and may change. Also, the reference is shown in wireshark as a hex in mismatching byte order ... so rather don't bother. The result now looks like OsmoHNBGW> show hnb all HNB (r=192.168.0.124:29169<->l=192.168.0.9:29169) "000295-0000152614@ap.ipaccess.com" MCC 901 MNC 70 LAC 14357 RAC 11 SAC 1 CID 8595638 SCCP-stream:HNBAP=0,RUA=0 IuCS: 1 contexts: inactive-reserved:1 IuPS: 1 contexts: active:1 1 HNB connected Related: OS#2772 OS#2773 Change-Id: Iae76b68e85863c8663bb5c508b85534c00e1d2c9
2017-12-20iu: iu_helpers: add functions to decode ip/port from rab-assPhilipp Maier1-0/+6
add ranap_transp_assoc_decode() to decode the port information from an RANAP_IuTransportAssociation_t field. add ranap_transp_layer_addr_decode() to decode the ip-address from an RANAP_TransportLayerAddress_t field. Change-Id: I3c1a0455c5f25cae41ee19229d6daf299e023062
2017-08-09make point codes configurable by SCCP address bookNeels Hofmeyr2-9/+6
In the vty config, use the SCCP address book to configure the local and remote SCCP addresses. Add VTY commands to set the remote SCCP addresses by name, derive the ss7 instance from these addresses: cs7 instance 1 point-code 0.23.0 sccp-address msc point-code 0.0.1 sccp-address sgsn point-code 0.0.2 hnbgw iucs remote-addr msc iups remote-addr sgsn Enforce that both IuCS and IuPS use the same ss7 instance. In the future, we may add the feature to use two separate instances. Depends: libosmo-sccp I75c67d289693f1c2a049ac61cf2b2097d6e5687d, Ie1aedd7894acd69ddc887cd65a8a0df4b888838c, I85b46269dbe7909e52873ace3f720f6292a4516c Change-Id: I33a7ba11eb7c2d9a5dc74d10fb0cf04bf664477b
2017-07-31move openbsc.git's iu.h, iu.c, iu_vty.c here as iu_clientNeels Hofmeyr2-0/+75
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-31ranap_common.h: fix include of asn1c/asn_application.hNeels Hofmeyr1-1/+1
Change-Id: I152377813cdcfef73e2c4309b0f8c97807d7d4f8
2017-07-05migrate osmo-hnbgw to libosmo-sigtran's SCCP/M3UANeels Hofmeyr3-13/+18
libosmo-sigtran now has a "proper" SCCP/M3UA stack, so we can make our hnb-gw 3GPP compliant by switching from the old SUA code to the new universal SCCP user API with support for (currently) M3UA and SUA. Main changes: Use one cn_link to STP: We will connect to the core network using an (Osmo)STP instance that routes to MSC and SGSN, so we want one SCCP link instead of two. The only difference between IuCS and IuPS is a different remote osmo_sccp_addr. This has various effects through the messaging code; the patch is a bit larger than I would like, but it is hard to separate out truly independent smaller changes. CS or PS domain was previously flagged in the separate cn_link, as ctx pointer for two separate sccp_sap_up()s. Now there's just one such ctx, so determine is_ps from the RANAP Domain Indicator, or from the conn's hnbgw_context_map: - Add is_ps to context_map_alloc_by_hnb(). - To find a matching context, the RUA ID alone is no longer sufficient, also match is_ps (possible optimization todo: separate lists). We would send separate CS or PS Reset messages based on the cn_link, instead send both CS and PS Reset at the same time for the single cn_link. This could be adjusted to detect presence of MSC or SGSN instead. Pending: adjust the VTY config to reflect that there is only one remote address. Place a TODO comment for that. Smaller changes: rua_to_scu(): populate called and calling addresses for N_CONNECT and N_UNITDATA. Remove DSUA. Don't build dummy_cn, which is still implemented on SUA. Mark todo to maybe re-include it based on M3UA later. In hnbgw_cnlink, place sccp related items in a separate sub-struct. Do not keep an llist of cn_links, just have the one. Remove iteration and list management. Change jenkins script to build libosmo-sccp master. Patch-by: hwelte, nhofmeyr Change-Id: I8ac15fa2fd25bedb26297177e416976a5389b573
2016-10-27hnbgw: parameterize IuCS and IuPS ips and ports: add vty cmdsNeels Hofmeyr2-0/+8
Basically copy-paste the Iuh local-ip and local-port code to provide parameterization of the IuCS and IuPS remote addresses. Add IUCS and IUPS nodes, enhance go_parent_cb and config writing accordingly. Change-Id: I2c28977011009df4e1fa472290bbbc359e406971
2016-10-27hnbgw: vty: set explicit go_parent_cbNeels Hofmeyr1-0/+1
A second level of depth will be added to the hnbgw node soon, which will need explicit go-parent logic. Change-Id: I8d1c18a396c215e8425ae49872b5c73316087d7d
2016-10-27hnbgw: cosmetic: local-ip config: drop getter functionNeels Hofmeyr1-2/+0
Use the g_hnb_gw->config.iuh_local_ip directly, drop hnbgw_get_iuh_local_ip(). Change-Id: Ie91aea82ae5d128ad735a0857ea814b440c3232c Suggested-by: hwelte
2016-10-13cosmetic: hnbgw: addr related renames, move define, move commentNeels Hofmeyr1-9/+5
Prepare for parameterization of IuCS and IuPS addresses: Conform internal variable naming to local-ip, local-port, remote-ip, remote-port (instead of bind-ip). Rename HNBGW_IUH_LOCAL_IP_DEFAULT to HNGGW_LOCAL_IP_DEFAULT to be more general and move it to the top. Move a function doc comment to the .c file. Change-Id: Ice85941c978498e3ddf41d151248507e7f56cb5d