Daniel Willmann
d6a45b402c
asn1helpers: Add 28 bit conversion function and use it for Cell ID
...
The padding bits in the bit string are at the end and the byte-order is
MSB-first. This means the number needs to be shifted left so the padding
bits are the least significant.
2015-12-14 10:21:51 +01:00
Daniel Willmann
a1e202e15e
tests/hnb-test: Generate the HNBAP registration request from ASN.1
2015-12-07 17:21:07 +01:00
Daniel Willmann
0e8ef67b7a
hnbap_common: Add function to HNBAP generate initiating message
...
An earlier version was commented out, this function now works like
hnbap_generate_successful_outcome()
2015-12-07 17:19:40 +01:00
Daniel Willmann
f3685c2a13
asn1helpers: Add helper to convert u8/u16 to OCTET_STRING
2015-12-07 17:18:56 +01:00
Daniel Willmann
4aeef6c3c4
hnb-test: Send hard-coded HNB register request for now
2015-12-03 17:02:13 +01:00
Daniel Willmann
97374c039b
tests: Add hnb-test to connect to hnbgw and tests its functions
...
Only connects currently
2015-12-03 09:37:58 +01:00
Daniel Willmann
56f6273430
hnbgw: Add VTY commands to show info about connected HNBs and UEs
2015-12-02 12:58:42 +01:00
Daniel Willmann
9a12a4b992
test-helpers: Also print out hexdump of encoded bit string
2015-11-30 16:27:11 +01:00
Daniel Willmann
b2548fb1e8
asn1helpers, test-helpers: Use ntoh/hton* to convert integers
...
Since the asn1_u32/24_to_bitstring functions need to change the source
variable change the signature to clarify that the uint32_t * will be
modified.
2015-11-30 16:24:57 +01:00
Daniel Willmann
e2956431e8
test-hnbap: Check CID and Identity Info as well
2015-11-30 16:05:51 +01:00
Daniel Willmann
23c86e38bc
test-hnbap: Use different types for UE request and accept IEs
2015-11-30 16:03:36 +01:00
Daniel Willmann
e3adf0edc3
asn1helpers: Fix asn1str_to_uX functions
...
The values are stored big-endian so convert them
2015-11-27 17:53:19 +01:00
Daniel Willmann
ea4c088e78
test-hnbap: Test decoding of the hnbap registration request
...
The 16-bit values are not decoded correctly
2015-11-27 16:14:09 +01:00
Daniel Willmann
1a86955288
tests/test-hnbap: Decode HNBAP UE Register accept as well
2015-11-24 18:11:03 +01:00
Daniel Willmann
39e643a62d
tests: Add test-hnbap to test en-/decoding of HNBAP messages
...
Decode a HNBAP UE register request and check the result.
2015-11-24 18:03:29 +01:00
Daniel Willmann
8ea918d772
tests: Test cropping of string still is NULL-terminated
2015-11-23 15:59:02 +01:00
Daniel Willmann
53018e937c
asn1helpers: Ensure that string is NULL-terminated
...
The buf in an OCTET_STRING_t is not (necessarily) NULL-terminated, so
make sure there is a terminating NULL byte at the end in the resulting
string.
2015-11-23 15:55:46 +01:00
Daniel Willmann
ec0e50e148
tests: Test asn1_strncpy function
2015-11-23 15:48:59 +01:00
Daniel Willmann
6e59d413a2
asn1helpers.c: Fix asn1bitstr_to_u32 function
...
The value in buf is kept in host byte order so no need to swap it
around.
2015-11-23 14:03:04 +01:00
Daniel Willmann
54a9a143f0
tests: Test asn1_u32_to_bitstring and asn1bitstr_to_u32
2015-11-23 14:02:38 +01:00
Daniel Willmann
cc5f7cafa2
src/Makefile: Change order of dependencies so a clean checkout builds
...
There still seem to be some issues with the _decode.o dependencies, but
this will eventually build through.
2015-11-20 19:52:00 +01:00
Harald Welte
9614d9aea7
add more relevant/related specs
2015-10-07 15:59:45 +02:00
Harald Welte
0bb1261239
add asn1_u24_to_bitstring()
...
Sometimes we have a native uint32_t, but we don't want to encode
it to a 4-byte long ASN1 BITSTRING, but rather to one that is only
24 bits.
2015-10-06 22:08:54 +02:00
Harald Welte
4dd16b9643
make asn1bitstr_to_u32() work for sub-32bit bit-strings
...
IF the ASN1 Bit-string is only 24 bits or even less long,
we might still want to retrieve it as an uint32_t.
2015-10-06 22:08:10 +02:00
Harald Welte
77847ad020
add copyright statement and AGPLv3 headers to source code files
2015-10-06 22:07:04 +02:00
Harald Welte
6286880caa
the Context ID is a 24bit number, we cannot use len = 4 bytes!
2015-09-18 01:23:55 +02:00
Harald Welte
1c2ada0e7f
ranap: receive/parse DirectTransfer
2015-09-11 20:10:17 +02:00
Harald Welte
80401adcb0
ranap: Parse InitialUE message and hex-print NAS PDU
2015-09-11 19:48:06 +02:00
Harald Welte
0f0ea8112f
RUA: hand off RANAP from all PDU types, not just UnitDataTransfer
...
Also, we now offer a ranap_tx_dt() message for connection-oriented
RANAP transfers. A far as I understand the RUA spec, on RUA layer,
all operations are Class 2, i.e. without any response/confirmation.
2015-09-11 18:58:28 +02:00
Harald Welte
cc27bebd30
ranap: prepare decoding of InitialUE message
2015-09-11 18:45:39 +02:00
Harald Welte
1d2c39d83b
various cleanups (compiler warnings, coding style)
2015-09-11 17:49:37 +02:00
Harald Welte
35cbc11757
add unit test for BCD encoding/decoding
2015-09-11 17:36:59 +02:00
Harald Welte
208b7b0778
iu_helpers: fix encoding of BCD (like IMSI) into OCTET STING
2015-09-11 17:35:52 +02:00
Harald Welte
393f2bd9fb
move BCD string encoding/decoding functions to iu_helpers.[ch]
2015-09-11 17:13:51 +02:00
Harald Welte
3af1db87ed
hnbap: Print error messages in error cases
2015-09-11 17:03:16 +02:00
Harald Welte
10dfc5a97d
respond to HNBAP UE REGISTER REQ withe correspnding ACCEPT
...
The Accept incudes the IMSI that the phone presented, but
somehow we fail to encode the Context ID as bitstring, see
../pcap/20150911-hnbap-ue_register.pcap
2015-09-11 01:36:44 +02:00
Harald Welte
256c67ad81
ue context: fix linked list insert
2015-09-11 01:22:29 +02:00
Harald Welte
6289cc6248
remove obsolete asn1c makefiles in the asn1c/ hierarchy
...
we are generating the code locally in src/{ranap,rua,hnbap}
2015-09-11 00:17:07 +02:00
Harald Welte
b534e5c085
introduce ue_context management
...
We keep one 'ue_context' structure for every UE that we see
a UE REGISTER REQUEST for.
2015-09-11 00:15:54 +02:00
Harald Welte
e2e5d4dd53
Back RUA/RANAP integration until RANAP Reset works for cs+ps
...
The hNodeB is now actively transmitting and we are getting up to the
HNBAP UE-REGISTER.req with the IMSI of the MS.
2015-09-10 23:49:45 +02:00
Harald Welte
350814a5cb
first dispatch of RUA into RANAP
...
This is becoming more and more of a hack, as asn1c + asn1tostruct.py
don't really deal well with the RANAP syntax :(
2015-09-10 22:32:15 +02:00
Harald Welte
ac9c024432
ranap: Add more manual definitions to RANAP-PDUs
...
It seems that individual IEs contain nested containers, and
asn1c is not generating code for that unless we help it by some
hand-crafted additional definitions. *sigh*
2015-09-10 21:18:16 +02:00
Harald Welte
68fcff219f
don't attempt to regenerate ranap-common, it is not auto generated!
2015-09-10 19:35:09 +02:00
Harald Welte
64b4ebe57c
rua: dispatch different message types and print context/cause
2015-09-10 19:29:59 +02:00
Harald Welte
318e4d5713
actually dispatch RUA messages to RUA handling code
2015-09-10 18:47:08 +02:00
Harald Welte
656ad301a8
enable building + linking of RUA support
2015-09-10 18:33:47 +02:00
Harald Welte
84839c04ea
asn1tostruct.py: Add support for type prefixing
...
If asn1c generates prefixed type names, the asn1tostruct.py of course
also needs to be modified to do so.
2015-09-10 18:33:14 +02:00
Harald Welte
3bc7ff0bb5
hnbap Makefile: add asn1c include directory
2015-09-10 16:43:44 +02:00
Harald Welte
71733fe9b3
add AGPLv3 license text
2015-09-10 11:02:31 +02:00
Harald Welte
b908f638f4
Add README file about current state
2015-09-10 11:01:59 +02:00