Commit Graph

564 Commits

Author SHA1 Message Date
Neels Hofmeyr a44cb48c46 configure: check for pkg-config presence
Change-Id: I940558e1b53b0d42291077eba0568f9974df6957
2016-10-01 01:05:34 +02:00
Neels Hofmeyr 08d5c8cea9 build: be robust against install-sh files above the root dir
Explicitly set AC_CONFIG_AUX_DIR.

To reproduce the error avoided by this patch:

  rm install-sh        # in case it was already generated.
  touch ../install-sh  # yes, outside this source tree
  autoreconf -fi

This will produce an error like

  ...
  configure.ac:16: error: required file '../ltmain.sh' not found
  configure.ac:5: installing '../missing'
  src/Makefile.am: installing '../depcomp'
  autoreconf: automake failed with exit status: 1

See also automake (vim `which automake`) and look for 'sub locate_aux_dir'.

Change-Id: I5aad87b7d4c043f890f4ae2bc5d68cbad6d2c5c7
2016-10-01 01:05:34 +02:00
Neels Hofmeyr c6db4935be jenkins.sh: output all test logs when 'make check' failed
Assume that cat-testlogs.sh from osmo-ci is installed in $HOME/osmo-ci/scripts,
and call from jenkins.sh upon 'make check' failure.

Change-Id: I6ee37ae638aa0b95222e5c0ec78474fab1f8cfae
2016-09-30 00:58:26 +00:00
Neels Hofmeyr f41b2fa500 fix: apply rename of osmo_sua_link_get_user_priv()
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
2016-09-27 18:13:28 +02:00
Neels Hofmeyr 39ee926062 hnbgw: vty conformance: rename iuh 'bind' command to 'local-ip'
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-27 05:55:55 +00:00
Neels Hofmeyr 0476e2854e log: hnbgw: add hnbap UE context allocation info log
Change-Id: Iac0ca948d6e699d984c6e424afe7106dcaf2ab1e
2016-09-27 05:55:55 +00:00
Neels Hofmeyr 12181a937f hnbap: accept UE Register Requests with TMSI and pTMSI
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-27 05:55:55 +00:00
Neels Hofmeyr f33e8358cc hnbgw: UE context: add handling by tmsi identification
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-27 05:55:55 +00:00
Neels Hofmeyr c94ed09f50 hnbap: add UE Register Reject for pTMSIRAI identity
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
2016-09-27 05:55:55 +00:00
Neels Hofmeyr c83e49fc8d log VTY telnet bind only once
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
2016-09-26 22:44:18 +02:00
Neels Hofmeyr 74b0565d9f comment: note RAB assignment spec reference
Change-Id: Ifef8da82a01cd781ef560d1ec21cbfb23efb1495
2016-09-22 21:12:28 +02:00
Neels Hofmeyr 7b48749783 ranap: include port in RTP TransportLayerInformation
Remove an #if 0 to properly include the port information (verified to work).

Adjust test expectations.

Change-Id: I45fb134959dea9bcdfbfd9d8a061e67c3cc80fb7
2016-09-16 02:41:38 +02:00
Neels Hofmeyr 30f534f887 jenkins.sh: enable make distcheck
Change-Id: I967d4de9682cb2a45210f689ec076ef457841179
2016-09-09 06:43:32 +00:00
Neels Hofmeyr a872421e43 build: parallel build: require ../libosmo-ranap.la from tests/
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
2016-09-09 06:43:32 +00:00
Neels Hofmeyr df63de2e37 build: move headers to include/osmocom/*
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-09 06:43:32 +00:00
Neels Hofmeyr 30e08f5b8e build: cosmetic: hnbap: undup asn1 src path
Change-Id: I0507277995302261c87db1b0c48105065cf13ae4
2016-09-09 06:43:32 +00:00
Neels Hofmeyr 2f1b1189da build: distcheck: add missing bits for testsuite distcheck
Got some errors during 'make distcheck', copying the way openbsc.git does these
things.

Change-Id: I13d76cd56dfb8fe4eb02d6fcada78a9e3311b51b
2016-09-09 06:43:32 +00:00
Neels Hofmeyr ba03c430a6 build: distcheck: look for asn1 in top_srcdir, not top_builddir
Change-Id: Iebcff240ba2fae964dad2a2c481fcbfd29e14e69
2016-09-09 06:43:32 +00:00
Neels Hofmeyr 347f8ef218 build: distcheck: add missing distclean files
Change-Id: I24d72b2b1bae52a1b2cf8a989396d2aac31d119e
2016-09-09 06:43:31 +00:00
Neels Hofmeyr 8345792281 build: fix ranap gen, use same for gen hnbap and rua gen
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-09 06:43:31 +00:00
Neels Hofmeyr c636cab20f build: remove subdir-objects from configure.ac, it is broken
This is a known autoconf bug, it creates odd directories named literally
'$(top_srcdir)', potentially messing up dependency checking.

Change-Id: Ia47b038d4ca4f6c345711fb17d074f71c80e4453
2016-09-09 06:43:31 +00:00
Neels Hofmeyr e7d6476825 build: use tar-ustar to allow paths longer than 99
Needed to fix these errors:

  tar: osmo-iuh-UNKNOWN-dirty/include/osmocom/ranap/RANAP_SourceeNodeB-ToTargeteNodeB-TransparentContainer.h: file name is too long (max 99); not dumped
  tar: osmo-iuh-UNKNOWN-dirty/include/osmocom/ranap/RANAP_LocationRelatedDataRequestTypeSpecificToGERANIuMode.h: file name is too long (max 99); not dumped
  tar: osmo-iuh-UNKNOWN-dirty/include/osmocom/ranap/RANAP_TargeteNodeB-ToSourceeNodeB-TransparentContainer.h: file name is too long (max 99); not dumped
  tar: osmo-iuh-UNKNOWN-dirty/include/osmocom/ranap/RANAP_Requested-RAB-Parameter-ExtendedGuaranteedBitrateList.h: file name is too long (max 99); not dumped

Change-Id: Id41bca92810a81ac50697c0230a6caef490b0ffd
2016-09-09 06:43:30 +00:00
Neels Hofmeyr 52c6ae25be tests: don't log filename nor color in unit tests
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
2016-09-09 06:43:30 +00:00
Neels Hofmeyr 6648fe8f1e jenkins.sh: don't build twice
Instead of building the same .c files twice, rather verify that the
'make regen' target produces identical .c files as are checked in.

Change-Id: I18e7677d8596f61b883e9db57b4bdd2a5c154ec3
2016-09-09 06:43:30 +00:00
Neels Hofmeyr 1a0bb5108c UE Register with TMSI: reply with a Register Reject
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
2016-09-09 06:34:24 +00:00
Neels Hofmeyr f6673b7257 RAB Assign for voice: heed the x213 nsap flag
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-09-08 15:50:32 +02:00
Neels Hofmeyr e75a6297da jenkins.sh: cosmetic: mark start of main build
Add function 'marker' so we don't repeat the five echos, use in build_dep and
before main build.

Change-Id: I58ab958414eb9e9b0fd7e214103578e5b4aa6ff2
2016-08-29 15:55:34 +02:00
Neels Hofmeyr 6dc074c9aa doc: add example osmo-hnbgw.cfg
Note that all *.cfg files are added to 'make dist' by the
doc/examples/Makefile.am.

Change-Id: I424ccdea02578edc7816e4d23a9ea7c5729315d8
2016-08-20 00:30:37 +00:00
Neels Hofmeyr 01c71fc2dd add doc/examples, Makefile.am adds all *.cfg files generically
doc/examples/Makefile.am taken from openbsc/openbsc/doc/examples.

Change-Id: I1fadad4deb7f73d2b3aa753a84a76ba5b9bf9574
2016-08-18 16:16:08 +02:00
Neels Hofmeyr 4d91ab277b add to dist: doc subdir with all current doc files
Change-Id: Idfef4f050e21a5d0eae3a530fe319a5adf81534d
2016-08-18 16:14:40 +02:00
Neels Hofmeyr f495b2347b hnbgw: make Iuh bind address configurable via VTY
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
2016-08-18 03:21:22 +02:00
Neels Hofmeyr 926153b9af hnbgw vty: add empty hnbgw and hnbgw/iuh vty nodes
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-08-18 03:21:22 +02:00
Neels Hofmeyr 4d8eb4cbd7 hnbgw: move vty commands out to new hnbgw_vty.c
Pass g_hnb_gw and tall_hnb_ctx to hnbgw_vty_init() as they are no longer
statically available.

Change-Id: If85c1b97a240bd1dcf9f367ea6fca857d542ab22
2016-08-18 03:21:22 +02:00
Neels Hofmeyr 1d03f19e06 hnbgw: make cmdline options stronger than config file
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
2016-08-18 03:18:03 +02:00
Neels Hofmeyr 085cd67672 hnbgw: add config file and -c cmdline option
Change-Id: I6ac9fa17b35260031c55aab664124d466f60c937
2016-08-18 02:37:11 +02:00
Neels Hofmeyr 4d675a7df9 hnbgw: add cmdline arg parsing with default options
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
2016-08-18 02:36:03 +02:00
Neels Hofmeyr 4c45d2b9fd hnbgw: add copyright to vty_info
Change-Id: I702b606837199ab64c3590546900d4d30357b919
2016-08-18 02:35:57 +02:00
Neels Hofmeyr a1bf4f330f fix compiler warning: osmo_prim_cb() has void* arg
Change-Id: I16741976050b3f36196af1b4f18d795af2b2722a
2016-07-12 00:51:31 +02:00
Neels Hofmeyr 0a43722a48 fix compiler warnings with new libosmo-sccp: rename to osmo_sccp_*
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
2016-07-12 00:51:21 +02:00
Neels Hofmeyr 6458c30db4 jenkins.sh: build both with checked-in and regenerated asn1 code
Change-Id: Ifc3e1ae25b66203b0e8def0a9a0b6971b9c3ce93
2016-07-12 00:44:18 +02:00
Neels Hofmeyr 0961408e1b jenkins.sh: echo HEADs' hashes, echo each project name prominently
Change-Id: I967b11b289630ba6ae1b102c1d6692625f83b875
2016-07-12 00:44:18 +02:00
Neels Hofmeyr de0acd2ff2 jenkins.sh: fix, remove code dup
Have a bash function to build each dependency with the same commands.  There is
a tradeoff: having each dependency build with the same function means you can't
easily tweak one of the dependencies. OTOH having a unified function means a)
more readable script, b) that we're sure not to forget some steps and c) no
need to do the same edit n times.

Set the PKG_CONFIG_PATH globally. Also a tradeoff: if a future addition
wouldn't need the same PKG_CONFIG_PATH, this would make things ugly. But that
is actually quite unlikely, and the readability improvement is substantial.

Use env variables to remember local paths. That means we always are sure to cd
to the same absolute base path, which a 'cd ..' can't guarantee; also, we avoid
possible typos for e.g. "$deps/install".

Build sysmocom/sctp branch of libosmo-netif, as needed for libosmo-sccp's
sysmocom/iu branch.

Build aper-prefix branch of asn1c, as needed by 'regen'.

'make regen' first, to generate the .c from asn1, needed by the build.

Change-Id: Ia7b4b9788b9c951f8be00cc5ae72a9c0a776fe64
2016-07-12 00:44:18 +02:00
Neels Hofmeyr f706d6c065 asn1tostruct.py: use '#\!/usr/bin/env python', not '#\!/usr/bin/python'
Change-Id: I0686467e59b35e68bccb38ccfe645f5ccac97941
2016-07-12 00:44:18 +02:00
Neels Hofmeyr fef2e86003 make regen: fix: use $(MAKE) instead of make
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
2016-07-12 00:44:18 +02:00
Neels Hofmeyr c23146e7f1 make regen: ~8x faster: use sed script instead of single invocations
Change-Id: Ib9b3f4fc524bf3ae7cc921b0340adec113529d4d
2016-07-12 00:44:18 +02:00
Alexander Huemer 156fa393fc attempt to fix parallel build, improve AM logic
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-05-15 23:28:14 +00:00
Neels Hofmeyr fd666890f7 fix test-ranap, after tmsi endianness fix
a9cf70f665 changed the TMSI byte order, the test expectations need to be
adjusted accordingly.
2016-05-04 14:06:53 +02:00
Daniel Willmann a9cf70f665 ranap_msg_factory: Fix endianess in paging command
the asn1 helper functions already take care of byte ordering, so use these.
2016-05-04 13:50:43 +02:00
Neels Hofmeyr 802acd0da4 fix: test-ranap.c: missing NULL init
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.
2016-05-03 13:14:30 +02:00
Holger Hans Peter Freyther 75f8116132 jenkins: Disable parallel make as it is broken right now
sed -i 's,^#include "ranap_ies_defs.h",#include <osmocom/ranap/ranap_ies_defs.h>,' ranap_encoder.c ranap_decoder.c
sed -i 's,^#include "ranap_common.h",#include <osmocom/ranap/ranap_common.h>,' ranap_encoder.c ranap_decoder.c ranap_ies_defs.h
sed -i 's,^#include "ranap_common.h",#include <osmocom/ranap/ranap_common.h>,' ranap_encoder.c ranap_decoder.c ranap_ies_defs.h
mv ranap_ies_defs.h ../include/osmocom/ranap/
sed: can't read ranap_ies_defs.h: No such file or directory
Makefile:916: recipe for target 'ranap_decoder.c' failed
2016-05-03 13:08:55 +02:00