Harald Welte
75a4e65f52
hnbgw: Add SUA client socket towards localhost
...
This socket doesn't do much yet except to connect to localhost:14001
The host/port needs to be made configurable, and the RUA<->SUA
interfacing needs to be implemented.
Also, we'll need two SUA sockets, one for MSC and one for SGSN.
2015-12-23 00:04:05 +01:00
Harald Welte
38a4f32d58
remove sigtran code, now part of libosmo-sccp
2015-12-23 00:04:05 +01:00
Daniel Willmann
269b8ac7ee
hnbgw: Free msgb when connection is closed
2015-12-22 16:40:46 +01:00
Daniel Willmann
541e429a39
hnbgw_hnbap.c: Clean up after encoding a UE register accept
...
Need to free the ASN.1 structs after using them to encode the UE
register accept message.
2015-12-22 16:40:46 +01:00
Daniel Willmann
d174e76f1d
asn1tostruct.py: Fix memory leaks in generated code
...
The decode_*ies functions did not clean up after them. This change is
taken from changes made to asn1tostruct.py in openair-cn repository.
2015-12-22 16:40:46 +01:00
Neels Hofmeyr
8aac21a5e8
Remove obsolete ffasn1c files.
...
The ffasn1c files from early trials are obsolete, we're using asn1c now.
2015-12-22 13:02:42 +01:00
Neels Hofmeyr
c51f735b35
really fix src/Makefile.am
...
Add BUILT_SOURCES to src/Makefile.am.
(And remove a stray space.)
2015-12-22 12:27:02 +01:00
Alexander Huemer
fec171d8b4
fix Makefile.am
2015-12-22 12:24:27 +01:00
Neels Hofmeyr
6682a37875
README, .gitignore
...
Update building instructions and add tests/atconfig to .gitignore.
2015-12-22 12:22:10 +01:00
Harald Welte
8960704d1c
SUA: Ensure osmo_ prefix is used on all global symbols
2015-12-21 23:51:08 +01:00
Harald Welte
70e84ab5f9
SUA: More FIXMEs
2015-12-21 23:50:36 +01:00
Harald Welte
283c7fde38
Add WIP code for SCCP User Adaptation (SUA) and SCCP User SAP
...
The idea of this code is to
* provide a SCCP User SAP as boundary between the User of SCCP
or SCCP-like transport like SUA
* implement the minimum subset of SUA to transport RANAP messages
betweene HNB-GW and MSC/SGSN
At this point
* we don't yet implement the proper state machines and timer
* we don't imp[lement the SCCP RESET procedure
* we don't implement AS/ASP management
The code is full of FIXMEs whihc hopefully will get fixed gradually.
After some cleanup + verification, it should move to a library, possibly
either replacing/renaming libomo-sccp, or adding it to libosmo-netif?
2015-12-21 23:35:56 +01:00
Harald Welte
71f73a2919
move COPYING file to root directory
2015-12-21 21:01:00 +01:00
Harald Welte
ef5055c275
Makefile.am: Try to model the asn1tostruct.py generation dependencies
2015-12-21 17:50:11 +01:00
Harald Welte
e98dacd1cb
add TS 25.412 spec
2015-12-19 16:24:22 +01:00
Harald Welte
c32b0d9848
Add various RANAP packet captures (pcap files) found on the net
2015-12-19 14:52:44 +01:00
Harald Welte
b2daa0d803
ranap ASN.1: Define IMSI as OCTET STRING to work around asn1c bug
...
When IMSI is a TBCD-STRING type, and TBCD-STRING is defined as OCTET
STRING, we end up encoding the IMSI the wrong way. I don't knwo why
that is, but changing it fixed the problem, as described below:
before this commit:
00 17 PeranentNAS-UE-ID
40 criticality ignore
0a (length)
00 presence = IMSI
08 BUG: why the additional length field?
46 23 91 34 70 77 80 f3 IMSI (643219430777083)
after this commit:
00 17 PeranentNAS-UE-ID
40 criticality ignore
09 (length)
50 presence = IMSI
46 23 91 34 70 77 80 f3 IMSI (643219430777083)
2015-12-19 13:05:19 +01:00
Harald Welte
0a3eafee45
ranap: Don' shift the RAB ID by 3 bits
2015-12-19 02:38:09 +01:00
Harald Welte
94a62d591d
ranap: No need for htonl() of IP addresses and the like
2015-12-19 02:37:48 +01:00
Harald Welte
b7f67c4b14
ranap: Don't forget ProtocolIE-CointainerPair around ProtocolIE-FieldPair
2015-12-19 02:37:35 +01:00
Harald Welte
de9055f142
Makefile.am: Replace .PHONY asn1tostruct.py rules
...
asn1tostruct.py generates three files. Try to teach the makefile that
all three of them depend on the .asn source file to ensure they're
re-built whenever the .asn source file changes.
2015-12-18 20:20:51 +01:00
Harald Welte
f8db61b554
First compiling (and leak-free) RANAP message generation functions
...
encoding correctness still needs to be verified at this point. At least
they generate some binary output without failing somewhere earlier in
the encoding process - and they don't leave any leaked memory behind,
see talloc_report() at the end of test-ranap.c:main().
2015-12-18 20:20:47 +01:00
Harald Welte
fcabec3665
implement BIT_STRING_fromBuf() similar to OCTET_STRING_fromBuf()
2015-12-18 17:51:50 +01:00
Harald Welte
16232780d8
ranap_common: Fix error cleanup path while generating IE Pair
2015-12-18 17:22:04 +01:00
Harald Welte
04329dcbdc
{hnbap,rua,ranap}_common: check for encoding errors in new_ie()
2015-12-18 15:18:13 +01:00
Harald Welte
629391321f
{hnbap,ranap,rua}_common: use FREEMEM(), not free() directly
...
If we allocate with CALLOC/MALLOC macros, we need to release memory via the
same API.
2015-12-18 14:58:34 +01:00
Harald Welte
8526d158f8
hnbap/rua: Don't usse malloc() directly but use CALLOC() macro
2015-12-18 13:41:39 +01:00
Harald Welte
9c397d4969
ranap: Use CALLOC() macro of libasn1c
...
we don't use malloc() directly, as that doesn't mix well with
our libasn1c using talloc.
2015-12-18 13:35:58 +01:00
Harald Welte
2676554c92
ranap: Ensure we free any intermediate dynamically allocated memory
2015-12-18 13:35:58 +01:00
Harald Welte
d062df5307
test-ranap.c: Further WIP, it now actually compiles
2015-12-18 13:35:58 +01:00
Harald Welte
93690184b0
RANAP: Split FormatInformationParameter / SDUParameterItem
...
The definition of the above data types as per 3GPP specs results in a
SEQUENCE_OF() an anonymous structure, which is slightly inconvenient to
use. So let's split the SEQUENCE OF part and the actual definition of
the item in separate types.
2015-12-18 13:35:58 +01:00
Harald Welte
091039d47e
test-ranap.c: More WIP code for convoluted RANAP message encoding
2015-12-18 13:35:58 +01:00
Daniel Willmann
141a0baac9
hnb-test: Add an option to transmit multiple UE register/deregister msgs
2015-12-17 18:03:52 +01:00
Daniel Willmann
28b9ec1473
Enable vty command to output talloc report
...
I don't think I can print this into a string and thus output it via VTY.
In that case it might be smarte to do in a signal handler
2015-12-17 18:02:37 +01:00
Daniel Willmann
5f810f4222
hnbgw_hnbap: Initialize return value and always return something
2015-12-17 17:57:51 +01:00
Daniel Willmann
59d17d8961
hnbap: Free ASN.1 components after they are no longer needed
2015-12-17 17:56:56 +01:00
Daniel Willmann
6637a289da
hnb-test: Handle closed connections correctly
2015-12-17 14:47:51 +01:00
Daniel Willmann
19dedbb6b1
hnb-test: Send UE de-register after receiving the UE registration accept
2015-12-17 13:09:37 +01:00
Daniel Willmann
92856e6ef2
hnb-test.c: Remove pdus.h include as it is not used
...
The messages are constructed so no need to include the binary asn1 data.
2015-12-17 13:09:37 +01:00
Daniel Willmann
3279780557
hnb-test: Add HNBAP category and reduce MAIN loglevel to INFO
2015-12-17 13:09:18 +01:00
Daniel Willmann
bded9841b5
hnbgw: Change logging priorities and add HNBAP category
...
Log hnbap messages to the HNBAP category. Change MAIN category to only
log INFO and above and change SCTP notification message to debug.
2015-12-17 13:09:18 +01:00
Daniel Willmann
efceb187aa
hnbgw_hnbap: Process UEDeRegister and try to free correct UE
2015-12-17 13:09:18 +01:00
Daniel Willmann
4267a29ee0
hnbgw: Handle closed connections correctly
...
We still need to clean up the HNB data structures after the connection
is closed
2015-12-17 13:09:18 +01:00
Daniel Willmann
7c27f7b792
hnbgw: Lower level of SCTP notif. msg to debug and set default log level to info
2015-12-17 13:08:32 +01:00
Harald Welte
ace1d24d34
ranap_common: Add function to wrap IEs into a RANAP_ProtocolIE_FieldPair_t
...
The FieldPair is a strange construct of RANAP Radio Access Bearer
assignment, where certain IEs appear in pairs.
2015-12-16 23:07:19 +01:00
Harald Welte
462db35426
hnbap_common: Fix copy+paste mistake (use hnbap msgb allocator)
2015-12-16 23:06:59 +01:00
Harald Welte
d328c1a3ac
WIP: add some early code for generating required RANAP messages
2015-12-16 23:04:21 +01:00
Harald Welte
c16117a22c
Add ranap_generate_outcome() function
...
Ranap has not only successsful and unsuccessful outcome, but also
an unqualified general 'outcome'.
2015-12-16 20:30:11 +01:00
Harald Welte
8dacb07baf
{hnbap,rua,ranap}_common.c: Reduce code duplicatioon
...
There used to be a lot of code duplication between the code to generate
initiating, successfulOutcome and unsuccessfulOutcome messages. Try to
reduce that by callign a generic function.
2015-12-16 20:27:14 +01:00
Harald Welte
cbaaeefe00
{rua,hnbap,ranap}_common: Add missing encoding functions
...
We used to only have those generator functions that we needed for
the existing hnbgw code; Implement the missing encoders
2015-12-16 20:17:26 +01:00