Commit Graph

31 Commits

Author SHA1 Message Date
Neels Hofmeyr 00ab9ed6e2 add gsm48_pdisc_msgtype_name()
Composing the message type string requires knowing the protocol discriminator.
To ease printing the message type, add this function to switch between the
defined value_string[]s depending on pdisc.

Also publish the message type value_string[]s -- without inline functions to
access them because it is anyway more convenient to use
gsm48_pdisc_msgtype_name() instead.

Since gsm48_pdisc_msgtype_name() is nontrivial, do not add as inline function
-- in case the message type is not known, it needs a static string buffer.

Change-Id: I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
2017-03-16 12:54:18 +00:00
Neels Hofmeyr dbd994c05b add gsm48_pdisc_names and gsm48_pdisc_name()
I often want to log the protocol discriminator in the openbsc debug log. It's
more useful to get the name directly instead of looking it up every time.

Change-Id: I0f053e2a4360b27ffccda7cf82469fb1b1cbb3ae
2017-03-16 12:54:18 +00:00
Alexander Couzens 953f929797 gsm_04_08: add _NUM_CHREQ_T to enum
_NUM_CHREQ_T defines the last element of the enum

Change-Id: Id67ba8de89dd6288e449197438e9e1c5d7f5a134
2017-03-14 13:47:29 +01:00
Alexander Couzens f48e8a8ba9 gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASE
The previous version of this commit got reverted to avoid a breakage in openbsc.
The problem is openbsc use an array of chreq_type with a manual defined size. This array
is using enums as index which breaks if any elements got added into the
middle, because the size of the array can't hold elements greater or
equal than the size.

Change-Id: I6676105507fe4e5627f740dfe4c2770f766ad068
2017-03-14 13:30:13 +01:00
Neels Hofmeyr d1c2fc6de1 gsm_04_08.h: add R99 MSCR and CBQ3 to SI3 Ctrl Chan Descr
MSCR and CBQ3 are Release 1999 additions to the Control Channel Description IE
of SI3.

Assuming that no-one is using the spare bits, this will not cause any code
conflicts.

In the R99 struct, spare1 and spare2 are in different places, so rather rename
them to spare_1 and spare_2 to make sure we get a compiler barf *if* anyone
tries to use them with the wrong structure.

Adjust the spec reference to TS 44.018; TS 04.08 Figure 10.5.33 is replaced by
TS 44.018 Figure 10.5.2.11.1 which is right there in the named Section
10.5.2.11, so drop the explicit reference.

Motivation: the R99 Control Channel Description defines MSCR to indicate
whether the MSC is R99+ or not. To use UMTS AKA on GSM networks, we want to
indicate that our libmsc is capable of R99, like OsmoSGSN already does.

CBQ3 is merely added for completeness, no particular use case in mind.

Related: OS#1593
Change-Id: If87e07b5d04e1617155383e14c98d2125fdd0608
2017-02-23 03:39:36 +01:00
Neels Hofmeyr 55a43b8013 gsm48: add UMTS AKA res+sync IEIs, msg type and cause val
According to 3GPP TS 24.008 9.2.3a, 9.2.3, 10.5.3.6

Change-Id: I745061ce8eb88aa23080dadcdbfe2d703c362a30
2017-02-02 20:34:16 +01:00
Neels Hofmeyr 909cbecbb9 Revert "gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASE"
This reverts commit c3c28528de.

The reason is that this breaks a static assert in openbsc.
See https://lists.osmocom.org/pipermail/openbsc/2016-December/009906.html

Enlarging the ctype_by_chreq struct and breaks the static assert for
gsm_network->ctype_by_chreq's size:

../../../src/libbsc/gsm_04_08_utils.c:138:1: error: size of array ‘dummyassert_size’ is negative
 osmo_static_assert(sizeof(ctype_by_chreq) ==
 ^

What this patch lacks is, in openbsc.git:

* adjustment of ctype_by_chreq[] according to the new additions in
  libbsc/gsm_04_08_utils.c
* same for reason_by_chreq[], also in libbsc/gsm_04_08_utils.c
* enlarge ctype_by_chreq[] in gsm_network to 18, in openbsc/gsm_data.h.

Leaving it up to the original authors to follow up and commit a complete patch
series in one go.
2016-12-02 02:30:51 +01:00
Alexander Couzens c3c28528de gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASE
For BSC-located pcu the BSC must understand the PDCH chan request.

Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784
2016-12-01 15:26:29 +00:00
Philipp Maier 72e43f02c3 gsm0408: Completing GSM 04.08 RR message types
- Add missing message types to be up to date with the
  latest specification release (3GPP TS 04.18)

- Add value strings to translate RR message type identifiers
  into human readable strings. (see gsm48_rr_msg_name() in
  gsm48.h

Change-Id: I3ceb070bf4dc8f5a071a5d43c6aa2d4e84c2dec6
2016-10-27 13:36:42 +02:00
Philipp Maier 349784c72d gsm0408: Adding 3g spcific RR message types
GSM 04.18, which is the successor of GSM 04.08, describes
additional RR 3g specific message types. This commit adds
four new message types related to paging and notifiction

See also 3GPP TS 04.18, section 10.4, table 10.4.1

Change-Id: I071cc9ecac342b5221fa0ec0b782b04b51b40e93
2016-10-12 09:29:35 +00:00
Max da34bf01a3 Add define for invalid TA
Add GSM48_TA_INVALID which is invalid Timing Advance value according to
3GPP TS 44.018 § 10.5.2.40.

Change-Id: I061760ccac656f39164562a7883f8ab522cd0911
Related: OS#1526
2016-07-23 19:31:30 +00:00
Max edb57e7709 Add function to check TA validity
Check if given Timing Advance is valid according to 3GPP TS 44.018 §
10.5.2.40.

Change-Id: I5cb6149d6e36fda8cb3f557e4d6d3a724da805a5
Related: OS#1545
2016-07-16 21:00:00 +00:00
Max fdca25dfb8 Add function to check GMM encryptability
Check if particular GMM message can be encrypted according to 3GPP TS
24.008 § 4.7.1.2

Related: OS#1582
Change-Id: I7ad0e03c2c738d174dd6bc3453f332eeb8da1e7d
2016-07-07 12:55:46 +00:00
Harald Welte 82f94ef50f Add UMTS AKA related MM/GMM message type and IE definitions
Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616
Reviewed-on: https://gerrit.osmocom.org/305
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-16 21:43:21 +00:00
Ruben Undheim 720ac4a4e1 Patched structs for big-endian architectures
Change-Id: I29eafe481e112d18c624b1c83add0d53c354dbe4
Reviewed-on: https://gerrit.osmocom.org/124
Tested-by: Jenkins Builder
Reviewed-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-31 11:52:12 +00:00
Max fe65fa7e36 Set DTX in Cell Options
* rename field of struct gsm48_cell_options to better match the spec
* add comments with spec references
* add function for setting DTX in cell options struct
* add necessary enum type

Change-Id: I5a8924f57669c951b2e51b663d95f1d360062a54
Reviewed-on: https://gerrit.osmocom.org/39
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-05-12 15:56:39 +00:00
Max fb348eeff2 Export names for gsm_chan_t and gsm48_chan_mode
This can be used with get_value_string() to improve debugging output.
2016-03-30 21:50:44 +02:00
Neels Hofmeyr da7bf4d55a 04.08: add inline funcs for transaction id bits
Various users of gsm48_hdr apply the same hardcoded shifts/bitmasks to obtain
the transaction ID encoded in the upper nibble of the protocol discriminator.
Centralize. Patch for openbsc.git will follow.
2016-03-15 14:11:49 +01:00
Neels Hofmeyr c656faed12 04.08: switch to r99 msg type bitmasks by default
[hfreyther: Separated from the previous patch to allow an easy
revert]
2016-03-15 14:11:13 +01:00
Neels Hofmeyr 282e908434 04.08: add inline funcs for pdisc + msg type bitmasks
Add inline functions for both release <= 98 and release >= 99 as well as a
default define. Use the release 98 by default since the current code base uses
the r98 bitmasks.

These inline functions relieve callers of the decision on masking bits of the
protocol discriminator and message type octets.

Also add a define for the protocol discriminator extension to one octet length
(GSM48_PDISC_EXTEND).

Apply new pdisc function in gsm0480.c.

[hfreyther: Make the hdr param const]
2016-03-15 14:10:45 +01:00
Max e859aec952 Add support for SI2quater messages
Add basic data structure for System information Type 2quater.
2016-03-11 22:09:21 +07:00
Sylvain Munaut 12ba778afd include: Switch to #pragma once pattern
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16 10:17:27 +02:00
Jacob Erlbeck 1c3f088c1f gsm48: Added 'Network Daylight Saving Time' info element
This information element has been added to the MM Information
message in GSM24.008. This patch adds it to the tlv_definition
to keep the TLV parser from breaking.

Ticket: OW#978
2013-09-16 14:11:36 +02:00
Andreas Eversberg c8cac64abb Fix RR cause values 2013-07-06 23:36:16 +02:00
Bhaskar e6b45d8164 gsm_04_08.h: GSM48_MT_RR_VGCS_UPL_GRANT value corrected 2013-05-23 07:57:27 +02:00
Bhaskar 31e844bfe2 gsm_04_08.h: Fix GSM48_CMODE_DATA_3k6 as per 3GPP TS 04.08 / 10.5.2.6. 2013-05-23 07:56:34 +02:00
Harald Welte 30a8ec466c GSM 04.08: Add 'enum gsm48_bcap_speech_ver' 2012-08-24 23:00:05 +02:00
Harald Welte c8a0b93939 GSM 04.08: Add support for parsing CSD related bearer capabilities
Also adds a test case for both encoder and decoder of this IE
2012-08-24 21:37:59 +02:00
Andreas Eversberg 4b332d7d0e libosmocore/gsm: Fixed total size of gsm48_req_ref
"__attribute ((packed))" must be defined for unions, in order to make
sure that the compiler packs unions.
2012-02-07 20:02:17 +01:00
Harald Welte b5503136fa Import sytem information related definitions + code from openbsc 2011-05-24 15:01:53 +02:00
Pablo Neira Ayuso 8341934844 include: reorganize headers file to include/osmocom/[gsm|core]
This patch moves all GSM-specific definitions to include/osmocom/gsm.
Moreover, the headers in include/osmocore/ have been moved to
include/osmocom/core.

This has been proposed by Harald Welte and Sylvain Munaunt.

Tested with `make distcheck'.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:09:28 +01:00