Commit Graph

1250 Commits

Author SHA1 Message Date
Sylvain Munaut ac3e61a7a6 core: Add some generic panic handling
This also includes an option for a minimal 'infinite loop' type
panic that could be required for embedded target that don't have
abort() or fprintf()

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 18:08:54 +02:00
Sylvain Munaut f23ababfb2 build: Use AS_HELP_STRING macro to format the ./configure --help better
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 16:16:42 +02:00
Sylvain Munaut 27af075e1e osmocore: Add utility function rsl_chan_nr_str to RSL
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-25 12:27:44 +02:00
Harald Welte b73631455b [gprs] BSSGP: Fix null pointer dereference
Zecke has found this using "make CC="clang --analyze"
2010-07-23 22:00:45 +02:00
Holger Hans Peter Freyther 5e84a86937 msgb: Avoid warnings that the string might contain %s or such.. 2010-07-23 19:22:23 +08:00
Holger Hans Peter Freyther a1726e9f6b Merge branch 'on-waves/mgcp' 2010-07-23 18:59:52 +08:00
Holger Hans Peter Freyther 0bfe1eb569 Merge branch 'on-waves/sccp' 2010-07-23 18:42:27 +08:00
Holger Hans Peter Freyther b60a4b3b97 gsm0808: Why should there be a lchan in the parameter... 2010-07-23 18:35:59 +08:00
Holger Hans Peter Freyther 06f795c56f gsm0808: Import unaligned mem access fix from on-waves/bsc-master 2010-07-23 18:20:02 +08:00
Holger Hans Peter Freyther dd02a47234 gsm_utils: Move the gsm_7bit_alphabet into the impl and make it static 2010-07-23 16:36:05 +08:00
Harald Welte 652a72385c msgb: Check for available headroom/tailroom and abort() if we violate it 2010-07-22 21:56:10 +02:00
Holger Hans Peter Freyther 0d60aa2ad7 gsm_04_12.h: Add beginning of structs for SMS CB
I am trying to understand the RSL and GSM 04.12
spec to implement CBS for OpenBSC...
2010-07-21 05:02:33 +08:00
Holger Hans Peter Freyther f8a342c350 gsm_7bit_decode: rtext does not hold a null byte, reduce the size
I have added the + 1 as I thought rtext will hold a terminating
null byte but it will not.
2010-07-21 03:14:01 +08:00
Nico Golde c0ce9aa20d tests: don't hardcode length values of expected encoding gsm_7bit_encode:
make sure to return the number of actually written bytes gsm_7bit_decode:
calculate length of resulting septets from input length before decoding

The input length to gsm_7bit_decode reflects the number of encoded bytes
to be decoded. As the decoding is done on the input in septetes we need
to take this into account and recalculate the length.
2010-07-21 02:43:58 +08:00
Holger Hans Peter Freyther 446bf37698 gsm_7bit_decode: Handle the case of the last charachter being an escape
If i + 1 == length and it is an escape charachter we would try
to read rtext[length] which is one after the field we have allocated.
2010-07-20 02:54:54 +08:00
Holger Hans Peter Freyther 31e97ea34e tests: Separate encoding/decoding test to verify them independly
Use the current test result as test data for future
regression testing. The encode function appears to
add too many zeros to the text.
2010-07-20 02:48:17 +08:00
Nico Golde 28de05336b * rewrite GSM 7bit default encoding/decoding based on a lookup table as the previous code produced wrong encodings for certain characters. 2010-07-20 02:48:17 +08:00
Ingo Albrecht 383134b5ac Added crc16 from linux kernel. 2010-07-15 22:43:52 +02:00
Andreas Eversberg 33f0fc3c95 [VTY] add support for numeric ranges with negative numbers
This enables us to do something like <-128-127> as a numeric range.
2010-07-13 13:50:39 +02:00
Harald Welte 6eb7d6c887 [RSL] split rsl_rll_push_l3() L3 LV pushign and rsl_rll_push_hdr()
This allows us to generate RSLms messages that have some non-standard
IEs between the RSL/RLL common header and the L3 INFO IE.
2010-07-13 13:48:13 +02:00
Andreas Eversberg ed00fe4449 Add 3-digit MNC support to gsm48_generate_lai() 2010-07-12 09:12:46 +02:00
Andreas Eversberg 014cb8725c Added new IE definitions to gsm_04_08.h of libosmocore.
Also added RR and MM TLV tables to gsm48.c

[import from accidential commit to osmocom-bb.git]
2010-07-12 09:11:00 +02:00
Andreas Eversberg cd2a74bd43 Added single octet TV (type + value) to libosmocore.
In case of a single octet, the upper nibble is the type, the lower nibble
carries the value.

[import from accidentially committed changes to osmocom-bb.git]
diff --git a/src/shared/libosmocore/include/osmocore/tlv.h b/src/shared/libosmocore/include/osmocore/tlv.h
index c733dbc..4cfce87 100644
--- a/src/shared/libosmocore/include/osmocore/tlv.h
+++ b/src/shared/libosmocore/include/osmocore/tlv.h
@@ -212,6 +212,7 @@ enum tlv_type {
 	TLV_TYPE_TLV,
 	TLV_TYPE_TL16V,
 	TLV_TYPE_TvLV,
+	TLV_TYPE_SINGLE_TV
 };

 struct tlv_def {
diff --git a/src/shared/libosmocore/src/tlv_parser.c b/src/shared/libosmocore/src/tlv_parser.c
index 407e57a..bbef7a9 100644
--- a/src/shared/libosmocore/src/tlv_parser.c
+++ b/src/shared/libosmocore/src/tlv_parser.c
@@ -36,6 +36,14 @@ int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
 	tag = *buf;
 	*o_tag = tag;

+	/* single octet TV IE */
+	if (def->def[tag & 0xf0].type == TLV_TYPE_SINGLE_TV) {
+		*o_tag = tag & 0xf0;
+		*o_val = buf;
+		*o_len = 1;
+		return 1;
+	}
+
 	/* FIXME: use tables for knwon IEI */
 	switch (def->def[tag].type) {
 	case TLV_TYPE_T:
2010-07-12 08:55:14 +02:00
Sylvain Munaut e10ae5b083 gsm_utils: Fix typo in gsm band name
thanks to horizon for noticing :p

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-07-04 11:41:36 +02:00
Harald Welte e335b91ccd GPRS: Add 'input' generator functions for GPRS cipher algorithm 2010-06-30 19:50:14 +02:00
Harald Welte b9ce51c5fd Add support for plugins (and specifically GPRS encryption plugins) 2010-06-30 19:43:11 +02:00
Harald Welte 0e43007f78 [SGSN] BSSGP: Print TLLI as hex value like everwhere else 2010-06-30 09:01:35 +02:00
Harald Welte e34a940542 [gsmtap] add new gsmtap_makemsg() function
This generates a gsmtap message without actually enqueueing to a
bsc_select style queue.
2010-06-29 22:31:21 +02:00
Harald Welte e779c364ac Add gsmtap utility functions to libosmocore
This is imported from OsmocomBB/Layer23
2010-06-29 21:57:25 +02:00
Harald Welte 1067e8cc9a Fix typo in configure script regarding --disable-vty 2010-06-25 03:00:58 +02:00
Andreas Eversberg 816e24cb42 [RSL] Added special RSL message types for mobile side
- suspension DL
    - resume DL
    - re-establish DL
2010-06-25 02:50:56 +02:00
Andreas Eversberg 93364fc8e0 [gsm48] fix typo in struct gsm48_req_ref 2010-06-25 02:50:06 +02:00
Holger Hans Peter Freyther 509f0bd88e Merge branch 'on-waves/mgcp' 2010-06-17 14:37:10 +08:00
Holger Hans Peter Freyther bd67e1df5b Merge branch 'on-waves/merge-nat' 2010-06-16 11:04:47 +08:00
Holger Hans Peter Freyther ed7020bfda Merge branch 'on-waves/sccp' 2010-06-15 17:06:45 +08:00
Harald Welte 639f74bdf4 [GSM 04.08] add more RR IEIs 2010-06-15 09:32:14 +02:00
Holger Hans Peter Freyther 4a90d22f5a GPRS: Increase the NS msg size to 2048
According to the GPRS NS spec the maximum framesize
is 1600 octets for FrameRelay, it can be bigger if
configured to be so. Make it 2048 octets to have some
space available...
2010-06-14 22:11:40 +08:00
Sylvain Munaut b00d1add75 [gprs] bssgp: Fix LLC PDU length encoding in BSSGP.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-10 15:15:42 +02:00
Harald Welte 781b3e6905 [GPSR] SGSN: Keep traffic counters for each PDP context 2010-06-10 15:12:38 +02:00
Harald Welte 68b4f037e0 [GPRS] BSSGP/SGSN: Implement Gb-Interface Paging
We now have a function that generates BSSGP PS and CS paging request.

It is called from the libgtp code when we receive a GTP packet from
the GGSN for a MM context that is in SUSPEND state.  We then issue
a PS paging request to the Cell with the BVCI where the last RA update
was being performed.

TODO: We still don't enqueue the GTP packet (and transmit it on paging
complete), and we don't rate-limit the paging requests, i.e. every GTP packet
will trigger another paging request.

We probably also need some kind of logic that marks the phone as UNREGISTERED
if it doesn't respond to paging requests for some time.
2010-06-10 15:12:38 +02:00
Sylvain Munaut d005eabe16 gsm48: Add authentication response message
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-10 13:30:50 +02:00
Harald Welte 313cccf733 [GPRS] SGSN: Pass BSSGP SUSPEND/RESUME up to GMM and alter MMCTX state 2010-06-09 21:40:45 +08:00
Holger Hans Peter Freyther 8e2e78ecc2 GPRS: Fix compiler warning that will also lead to a crash at runtime. 2010-06-09 21:40:36 +08:00
Sylvain Munaut 4f585491b9 gsm_utils: Add a fn to test A5(x) support given a classmark2
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-09 13:40:36 +02:00
Holger Hans Peter Freyther dd19527cd2 vty: Mark app info strings as const char*. 2010-06-08 16:12:58 +08:00
Harald Welte cfb545aebb [GPRS] BSSGP: Fix formatting of BSSGP TX STATUS 2010-06-03 21:30:57 +02:00
Harald Welte 7b4913662a Merge remote branch 'origin/master' 2010-06-01 21:21:20 +02:00
Harald Welte 02f7325b9f [GPRS] Major LLC / TLLI handling fixes
* separate the LLME and LLE state in the LLC layer
* introduce gprs_llgmm_assign() function for LLGMM-ASSIGN.req primitive
* change QoS profile to match 'real' SGSN
* Update the new TLLI when assigning a P-TMSI

The result now is that the LLC layer is notified of TLLI changes, which in turn
means it doesn't allocate a new LLE structure every TLLI change, which again
in turn means that the UI frame sequence number does not reset to zero.

As a result, MS should no longer ignore frames based on wrong UI sequence number.
2010-06-01 11:57:13 +02:00
Harald Welte c226317c9c add new new gprs_tmsi2tlli() function 2010-06-01 10:47:07 +02:00
Harald Welte 2f94683320 [GPRS] Include IMSI and DRX params in BSSGP DL-UD
When we send a downlink unit-data request via BSSGP, there is a lot
of information that needs to be copied from the mm context, such as
the IMSI, DRX parametes, MS radio access parameters, ...

This is a quite strange layering violation, since we now need to pass
a pointer to the MM ctx from GMM through LLC into BSSGP :(
2010-05-31 22:12:30 +02:00