aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
AgeCommit message (Collapse)AuthorFilesLines
2018-02-22destroy hnb context by setting a flag in msgb control bufferstsp/destroy_conn_with_cb_flagStefan Sperling1-1/+1
These are the osmo-iuh changes corresponding to the libosmo-netif branch 'destroy_conn_with_cb_flag'. Change-Id: I62e6d4fe4da75f1a56abf4c46a2426d17840025f
2018-02-22ensure unique CellIDs in HNB-GWStefan Sperling1-0/+4
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) Change-Id: Iffd441eb2b6b75dfbe001b49b01bea015ca6e11c 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
2016-09-27hnbgw: vty conformance: rename iuh 'bind' command to 'local-ip'Neels Hofmeyr1-1/+1
The standard osmo VTY terminology is 'remote-ip', 'remote-port', 'local-ip', 'local-port'. Conform to that. osmo-hnbgw is so far not rolled out widely, so it makes sense to do this now. Change-Id: Ifda2653bf58044552a5f1477cd7008dec3fb9100
2016-09-27hnbap: accept UE Register Requests with TMSI and pTMSINeels Hofmeyr1-0/+1
Add the option to allow UE Register Requests with a TMSI identity. Add VTY command to enable this option, 'hnbap-allow-tmsi'. Add hnbgw_tx_ue_register_acc_tmsi(). HNBGW so far keeps track of UEs that have registered, with their IMSI. When a UE registers with only a TMSI, we obviously can't store an IMSI. However, since we're so far never *using* the list of UEs in osmo-hnbgw, we might as well just accept the TMSI registration and carry on as usual. All that is needed for proper operation is a valid UE context. This is aimed at the ip.access nano3G femto cell, as it apparently feeds whichever identification the UE sends through to HNBAP (TMSI+LAI, pTMSI+RAI), instead of an IMSI as expected. So far this caused failures and the need to make the UE clear its TMSI (wait several minutes or attempt to subscribe to a different network), so that UE registration switched back to IMSI. When simply accepting the TMSI in osmo-hngw, no problems are apparent in our current code state. For example, a Samsung Galaxy S4 seems to send a UE_Identity_PR_tMSILAI (CS identity), and a GT-I9100 seems to send a UE_Identity_PR_pTMSIRAI (PS identity) upon first registration to the network. Recording the IMSI in hnbgw: we could use the subscriber list during paging, to page a UE on only its last seen HNB. On the other hand, it doesn't hurt to anyway always page to all HNBs connected to osmo-hnbgw. The paging procedure does include a page-to-all-HNBs in case the first HNB paging fails. But we must be aware that UEs that register by TMSI will simply not have an IMSI recorded in the list of UE contexts, so a lookup based on IMSI may fail. Patch-by: Harald Welte <laforge@gnumonks.org>, me Change-Id: I87bc1aa3e85815ded7ac1dbdca48f1680b468589
2016-09-27hnbgw: UE context: add handling by tmsi identificationNeels Hofmeyr1-3/+4
To prepare for an upcoming commit that accepts TMSI identification upon UE Register Requests: Add tmsi arg to ue_context_alloc(). Add ue_context_by_tmsi(). This is aimed at the ip.access nano3G femto cell, as it apparently feeds whichever identification the UE sends through to HNBAP (TMSI+LAI, pTMSI+RAI), instead of an IMSI as expected. See the upcoming commit that enables accepting TMSI identities for further detail. Change-Id: I138458443319cc4cbea5ee7906cf5dd72d582130
2016-09-09build: move headers to include/osmocom/*Neels Hofmeyr10-2/+263
This came up while fixing 'make distcheck'; this is certainly not the easiest way but it makes sense to have the headers in include/, like we do in openbsc. The easy alternative might be to add -I$(top_srcdir)/src to src/Makefile.am. Remove -I$(top_srcdir)/src from src/tests/Makefile.am, no longer needed. Change-Id: I5a82e029dcdc4df0a60a31271a4883393fe59234
2016-09-09build: distcheck: add missing distclean filesNeels Hofmeyr3-0/+9
Change-Id: I24d72b2b1bae52a1b2cf8a989396d2aac31d119e
2016-09-09build: fix ranap gen, use same for gen hnbap and rua genNeels Hofmeyr5-2/+234
fix extraneous rebuild for each make invocation: touch the ranap.stamp file in src/ as the make target suggests. fix for 'make distcheck': ranap gen: move generated sources to builddir, not srcdir. Thus we also -I the builddir include to pick up those headers. hnbap and rua have the same situation as ranap (they generate numerous files from a single make rule). Use the same makefile semantics for those two (commit for ranap gen omitted the same changes for hnbap and rua). The generated headers are thus moved to include/osmocom/*/, so adjust #include statements accordingly (*_common.h, *_ies_defs.h). Also move hnbap_common.h to include/osmocom/hnbap and rua_common.h to include/osmocom/rua, since the *_ies_defs.h want to include them; and since *_ies_defs.h are now in include/osmocom/*, we want a '<foo>' include now. Also adjust gitignore. Change-Id: I32213666fcdfc144008fa7d46497c0938d093e86
2016-09-08RAB Assign for voice: heed the x213 nsap flagNeels Hofmeyr1-1/+3
Add use_x213_nsap arg to ranap_new_msg_rab_assign_voice() and new_transp_info_rtp(). Pass this to new_transp_layer_addr() to compose 32bit addresses when use_x213_nsap == false. This is analogous to ranap_new_msg_rab_assign_data(). Particularly, the ip.access nano3G does not accept x213 NSAP 56bit addresses, so we want to send 32bit addresses there. Change-Id: I0c3c95d709c8a2b1c48d7a187faca34102226329
2016-08-18hnbgw vty: add empty hnbgw and hnbgw/iuh vty nodesNeels Hofmeyr3-1/+12
Add include/osmocom/iuh/ named after this project (osmo-iuh), and add vty.h to define VTY node enum values. Also add (to) Makefile.am and configure.ac to include in the build. An upcoming commit will add the actual first config item to the hnbgw/iuh node. Change-Id: I71545823d3bd81cb888c85df8e298a56c98bf131
2016-05-15attempt to fix parallel build, improve AM logicAlexander Huemer1-2967/+0
The formerly existing make rule caused a race condition in parallel builds and wrongly stated the .c files as targets, which caused make to execute the rule twice (once for each target). This was actually only fallout of the attempt to express the fact that those two files are generated by the rule. The generated file ranap_ies_defs.h was moved by one make job, another job then tried to access the file in the old location and failed. parallel build verified with: $ for i in $(seq 1 10) do echo "XXXX iteration $i" git clean -xfd autoreconf -i ./configure make -j${i} || break done Coauthored by Andreas Rottmann <mail@rotty.xx.vu> Change-Id: I439edcb4b7742de861c99ed401114f51061f8088 Reviewed-on: https://gerrit.osmocom.org/65 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-04-25new RAB: add use_x213_nsap parameter / change it to boolNeels Hofmeyr1-1/+3
Allow the *caller* of ranap_new_msg_rab_assign_data() to make the decision for using 32 bit or longer IP addresses in RAB Assignment Request messages. This requires a follow-up change in openbsc branch sysmocom/iu.
2016-04-20ranap_msg_factory: Add keystatus parameter for security mode cmdDaniel Willmann1-1/+1
2016-04-19cosmetic: comment typosNeels Hofmeyr1-1/+1
2016-04-19ranap_msg_factory: add Iu Release Complete msg generatorNeels Hofmeyr1-0/+3
Needed by hnb-test.
2016-04-19ranap_msg_factory: add Security Mode Complete msg generatorNeels Hofmeyr1-0/+7
Needed by hnb-test to reply to a Security Mode Command message.
2016-02-29avoid a warning by declaring struct gprs_ra_id opaquelyNeels Hofmeyr1-0/+1
2016-02-22asn1: Generate _free_*ies function declarationsDaniel Willmann1-1/+316
ranap_ies_defs.h is checked in so update it hnbap_ies_defs.h and rua_ies_defs.h need to be regenerated
2016-02-18ranap: Add custom ranap_decode_rab_setupormodifieditemies() functionDaniel Willmann1-0/+7
2016-02-18ranap_common: Add helper function to get IP from transport layer addrDaniel Willmann1-0/+1
2016-01-25ranap_common.h: declare ranap_parse_lai()Neels Hofmeyr1-0/+2
2016-01-11Add missing ranap_ies_defs.h (generated from 'make regen' but we want it ↵Neels Hofmeyr1-0/+2652
committed)
2016-01-06make ranap_common.cn.[ch] part of libosmo-ranapHarald Welte2-0/+15
2016-01-05move ranap_*.h,iu_helpers.h to include/osmocom/ranap/Neels Hofmeyr4-0/+700
A bit hacky: the ranap_ies_defs.h is generated together with the ranap_encoder.c and ranap_decoder.c. See comments in src/Makefile.am and include/osmocom/ranap/Makefile.am.
2016-01-05Fix install location to osmocom/ranap (without osmo-iuh)Neels Hofmeyr1-1/+1
2016-01-05Fix subdirs of include/osmocom/Makefile.amNeels Hofmeyr1-1/+1
2016-01-05install only ranap headers, make rua and hnbap headers 'noinst'.Neels Hofmeyr2-7/+2
Only ranap will be used in external code, hnbap and rua use will be limited to the osmo-iuh repos.
2016-01-05Remove osmo-iuh subdir level from include/ (2/2)Neels Hofmeyr431-890/+890
Make all changes to #include statements and build files.
2016-01-05Remove osmo-iuh subdir level from include/ (1/2)Neels Hofmeyr733-2/+0
First just move the files to make the upcoming commit diff easier to read.
2016-01-04move asn1 headers to include/ dir (5/5)Neels Hofmeyr5-0/+743
Do all remaining changes necessary for a working build. Add Makefile.am files in include/... subdirs. Remove noinst_HEADERS directives from src/*/Makefile.am, but keep the headers list to feed to move-asn1-header-files.sh. Adjust all #includes in src/*_common.h and elsewhere. In hnbap_common.h, separate the ASN.1 "primitive" headers from the others, and include them without a subdir path, as before.
2016-01-04move asn1 headers to include/ dir (4/5)Neels Hofmeyr729-0/+34575
Move headers.