CN_DomainIndicator_t is a long, so use %l format.
Error was introduced in recent 2b5021fd8d.
Fixes: CID#157119
Change-Id: I22f49d45bc87897beb24a6b1eee6c83da3e57b0f
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
A second level of depth will be added to the hnbgw node soon, which will need
explicit go-parent logic.
Change-Id: I8d1c18a396c215e8425ae49872b5c73316087d7d
For completeness' sake, add VTY command to set the local Iuh port, to go with
the command that sets the local IP.
Change-Id: I4b5e9fe9fcfa489069a0728d47899ef4a61f7ce5
Use the g_hnb_gw->config.iuh_local_ip directly, drop hnbgw_get_iuh_local_ip().
Change-Id: Ie91aea82ae5d128ad735a0857ea814b440c3232c
Suggested-by: hwelte
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
Properly initialize msgb talloc context in hnbgw and all tests, using the new
msgb_talloc_ctx_init().
test-ranap.c: since msgb talloc ctx is now in test_common_init(), remove msgb
talloc init here.
Change-Id: I807c799aff1239184728551ed77fdafa73bd683f
In the course of a rebase in libosmo-sccp, osmo_sua_link_get_user_priv() was
renamed to osmo_sccp_link_get_user_priv(). Apply this rename here to fix the
build.
Change-Id: I09603f5eb983f17c1e4a1232967fc43c7ceea12a
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
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
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
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.
Sending a proper registration reject speeds up the response seen on the UE and
avoids needless waiting.
See the upcoming commit that enables accepting TMSI identities for further
detail.
Change-Id: I03b69613e6ddd8a08d9358ffc2f74954c231fd2c
After libosmocore 55dc2edc89c1a85187ef8aafc09f7d922383231f which outputs
'telnet at <ip> <port>' from telnet_init_dynif(), there's no need to log the
telnet VTY bind here anymore.
Change-Id: Icd9e670c1d30c156f7bd5d0d34892150aeba95e9
Remove an #if 0 to properly include the port information (verified to work).
Adjust test expectations.
Change-Id: I45fb134959dea9bcdfbfd9d8a061e67c3cc80fb7
This rule is bad because it re-invokes $(MAKE), but it seems to fix the
parallel build. It should probably be done differently.
Change-Id: I8107e08e4c211f20d671f520bf6bab9356f3c90e
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
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
In experr, we had line numbers in log output, which might change. Also, for
make distcheck, the path of the source file might have some '../../' added in
the log output (to indicate the src dir as seen from the build dir).
Fix both by dropping source file and line.
Also drop color while at it.
Change-Id: Ie76384c4176ce0a7d89d093f2efb848fe3f19400
When receiving a UE Register Request with TMSI and no IMSI, compose a
Register Reject with the same UE Identity and send.
The accepting function expects a ue_context argument and composes the
message from the IMSI found there. This new rejection message cannot rely
on a ue_context struct and hence uses the asn1 uE_Identity directly.
Change-Id: Ia47e398e50e316842cd260dc0d9a4e2d8a1c627c
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
Add config node hnbgw/iuh/bind, taking an IPv4 address.
Use this address to bind the Iuh server.
This is particularly useful for the ip.access nano3G, which is very sensitive
with SCTP addresses that don't respond to SCTP heartbeats. If the hnbgw listens
on 0.0.0.0, there will be SCTP heartbeats for all local interfaces on the
machine that the hnbgw runs on; the nano3G will interpret the "missing", or
rather, redundant heartbeat acks for the interfaces that aren't really related
to the Iuh server and assume a broken Iuh link, leading to an Iuh shutdown and
reconnection, looping every minute or so. By binding the hnbgw to only one
local interface, the SCTP addresses can be reduced and "missing" heartbeat acks
can be avoided.
Change-Id: Ie2749c152b878e17aa65dfb806826357d5c494f1
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
Now that a config file gets parsed after the command line options, e.g. the
'logging timestamp 0' config item is stronger than a -T commandline option. So
rather store the cmdline options to take effect after config file parsing.
This adds a stupid 'log_disable_color = true' reverse boolean logic, which is
unavoidable if we want to use the same default cmdline options as osmo-nitb /
osmo-cscn.
Change-Id: I16ad55b173a443c36b71dc6b70f58695f6665312
Default options taken from osmo-nitb:
-h --help This text.
-d option --debug=DHNBAP:DSUA:DRUA:DRANAP:DMAIN Enable debugging.
-D --daemonize Fork the process into a background daemon.
-s --disable-color
-T --timestamp Prefix every log line with a timestamp.
-V --version Print the version of OsmoHNBGW.
-e --log-level number Set a global loglevel.
Change-Id: I931cee01c605c1b507c16041ada226cf963ea433
See libosmo-sccp.git 1a3875092f93df3c3054d26eac52bb0ea9bd09c3
Note: at time of commit, osmo-iuh still depends on the libosmo-sccp sysmocom/iu
branch to build.
The same rename has been committed to both sysmocom/iu and master on
libosmo-sccp. Above commit hash is on sysmocom/iu. The master commit is
03ad002c28073b347b92bcde16d5af80a06389e4.
Change-Id: Id9c0065d7398a6205ff24477d47c9663caac669c
On FreeBSD, we use gmake, so calling 'make -C ...' won't work here.
We need to invoke $(MAKE) so gmake is used again.
Change-Id: If8d09889db2c101eca66675fff8f820d6d1d7a65
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>
The decoding target pointer has to be NULL so that a new structure is allocated
by aper_decode(). Fixes a probable segmentation fault upon decoding at
test-ranap.c:77 or free of unallocated memory in test-ranap.c:81.
After aper_decode(), we still need to free the decoded struct.
This was introduced in 14da5411a4
("test-ranap: Add test case about constrained integer range decode")
Note, in that commit there is another test failure in expout (a reversed byte
order) which is "secretly" fixed in bb289e3b81
("RAB parameters: add Extended Max Bitrate").
This commit fixes:
@@ -213,6 +212,7 @@
</RANAP_IE>
00 0a 00 11 00 00 01 00 29 40 0a 00 00 01 00 28 40 03 05 c2 d0
report
-talloc report on 'asn1_context' (total 0 bytes in 1 blocks)
+talloc report on 'asn1_context' (total 40 bytes in 2 blocks)
+ constr_CHOICE.c:927 contains 40 bytes in 1 blocks (ref 0) 0x187e690
talloc report on 'msgb' (total 1 bytes in 1 blocks)
exit
Adjust test expectation in test-ranap.c.
This IE is seen in a "real life" pcap of hNodeB operation. We did not need it
so far, but add it to test the ip.access nano3G.
Comment from the future: the ip.access nano3G rebooted upon RAB Assignment
Request, and after adding/tweaking some IEs it stopped rebooting. This is one
of the changes that fixed the reboot issue. The changes have been tested
incrementally until reboots vanished, but it's not clear/hasn't been tested
whether omitting this change alone will cause reboots to re-appear.
There was a bug in the asn1c/libffasn1c APER patch that caused
constrained integer ranges to be decoded incorrectly. Add a test
case for that to avoid people falling into that trap...
Our version of asn1c/libasn1c used to have an INTEGER encoding but,
where the encoding of integers of > 2 bytes length was broken.
Add a test case to what we expect with the updated/fixed libasn1c.
If your compilation breaks, please upate to libasn1c with related
fix commited a few minutes ago.
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.
Fix log typo 'REGSITER' and add some comments on UE Register with TMSI.
The container_pair struct starts with 'list', so passing the container_pair
pointer is equivalent to passing the list; but instead, explicitly mention the
list member to avoid confusion.
To test CSCN, I want dummy-cn to listen on 127.0.0.2 and mock IuPS instead of
the hardcoded 127.0.0.1 to mock IuCS.
Add commandline option parsing and the --bind option to set the local bind
address.
As soon as possible, clarify that slink is an osmo_sua_link*. Immediately
obtain the priv as hnbgw_cnlink and pass that to all the static functions.
Thus remove code dup and clarify argument typing.
Allow Iu Release Command decoding and freeing.
Add Paging decoding and freeing.
These are all needed by hnb-test, which still uses the CN parsing functions,
still to be fixed, as commented in the code.
Add the Security Mode Command procedure code to cn_ranap_rx_initiating_msg_co()
and cn_ranap_free_initiating_msg_co(), for hnb-test (see comments in the code).
Adding the Security Mode Control command would break the current scheme of
callbacks across layers. This brought to my attention that the scheme is indeed
unnecessarily complex, so simplify it.
Instead of passing callbacks, call functions directly. Add hnb-test-layers.h to
declare those functions that cross from main to rua, to ranap and back to main
and remove the callback type definitions.
Instead of copying the NAS PDU to a newly allocated msgb, pass the data and len
directly to hnb_test_nas_rx_dtap().
Instead of repeatedly checking the gsm48_hdr length, just pass the struct
gsm48_hdr* and len around and assume the basic header length has been checked.
In some places, rename 'length' to 'len' for cosmetic consistency.
Previously the SRES was hardcoded, but the CN changed to generate the SRES.
So now, generate the SRES while still using the hardcoded Ki.
Fixes the Authentication Response message when testing IuCS Location Update.
Fix the ranap_parse_lai() part that decodes the MNC: place the *10 at the
proper MNC digit.
Add a comprehensive test for ranap_parse_lai() in test-helpers.c. Because
ranap_parse_lai() logs things, add test_common.c to test-helpers compilation
and an expected stderr output to test-helpers' testsuite.at def.
Rewrite ranap_common.h include path in ranap_ies_defs.h as well
Don't move ranap_ies_defs.h to the install directory, but move it inside
the source tree
When we use call-back function pointers with ranap_cn_rx_c{o,l}()
functions, we can (soon) migrate it into libosmo-ranap without an
application having to provide 'magic symbols' that the library expects
to be able to call.
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.
Add asn1tostruct.py as dependency for the targets that use it, so that any
modification to the asn1tostruct.py regenerates everything related
automatically.
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.
Add move-asn1-header-files.sh to do header file moving and sed'ding the include
statements. The file moving part is disabled until a later commit, to make
reading the diffs easier.
Call shell script from src/{hnbap,ranap,rua}/Makefile.am regen targets.
Add convenience regen target to src/Makefile.am, calling regen in the three subdirs.
This change is split over several commits to ease diff reading. Subsequent
commits show, in steps:
- the "unmoved" effect of sed,
- header moves,
- adjust build system and include statements.
'make distcheck' checks for out-of-source-tree builds and whether
the distribution tarball includes all source files. This commit
fixes many problems, except some remaining with src/test still
to-be-fixd.