Commit Graph

53 Commits

Author SHA1 Message Date
Neels Hofmeyr f8963f9d4e change GSM48_CMSERV_* to enum type, add names
Prepare handling multiple CM Service Requests in osmo-msc: an enum is more
clear than an int and #defines for passing around and count CM Service types.

Change-Id: I9c2a7adc45ab7a1a7519168e965e7d805e1481ff
2019-01-14 17:42:03 +00:00
Neels Hofmeyr 92f3f5e491 add osmo_lu_type_names[], osmo_lu_type_name()
Move lupd_names[] from osmo-msc to libosmo-gsm.

Change-Id: Ica25919758ef6cba8348da199b0ae7e0ba628798
2019-01-08 14:07:07 +00:00
Neels Hofmeyr b26003963e add/clean big-endian packed structs (struct_endianess.py)
This is 1:1 the result of doing

  cd libosmocore
  ./contrib/struct_endianess.py
  git commit -a

Running struct_endianess.py again should result in no changes.

That means we could include such a check in the gerrit verification job now.

Change-Id: Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2
2018-12-19 18:40:03 +00:00
Keith Whyte 3cdaa8d525 Add CC_CAUSE value_string array
Adds a value_string array for GSM 04.08 Call Control
cause values

Change-Id: I296f208581ce2550805f9d96e20f7319e1199023
2018-09-02 12:33:54 +02:00
Philipp Maier 5796a218db gsm_04_08: add function to get value string
The value string table gsm48_chan_mode_names[] lacks a function
to get the value string by a value. Lets add one.

Change-Id: I0757bcc278c140e18249e35864338e19cdaa3cf7
2018-07-12 18:18:39 +00:00
Keith Whyte 05d3278c0e Add enum gsm48_progress_desc
From GSM 04.08
Section 10.5.4.21 / Table 10.5.127

Change-Id: I6574e8808aaf39fad8026290aa2cc657734e18b5
2018-05-28 15:10:16 +00:00
Keith Whyte adfa199b5d Add enum gsm48_cause_coding from GSM 04.08 Section 10.5.4.11
Change-Id: I3d9c8e117ad19f70a3273650d7c0f8280d7bdb9a
2018-05-26 10:22:08 +00:00
Vadim Yanitskiy 07bfd565a8 protocol/gsm_04_08.h: drop incorrect GSM48_PDISC_USSD
According to the GSM TS 04.07, section 11.2.3.1.1 "Protocol
discriminator", bits 1 to 4 of the first octet of a standard
L3 message contain the protocol discriminator IE.

Meanwhile, the GSM48_PDISC_USSD represents value 0x11, i.e.
0b10001, that requires 5 bits, and moreover it is not
documented anywhere. Let's drop it.

Change-Id: Ic4eb8a6db4ff1dfd535bd0c84e7acf1908422f64
2018-04-17 12:09:48 +00:00
Neels Hofmeyr aead241df0 add gsm48_reject_value_names
There seems to be quite some confusion / overlap between enum
gsm48_reject_value, gsm48_gsm_cause and gsm48_gmm_cause. I tried to go with
gsm48_gsm_cause_names[], but e.g. GSM48_REJECT_CONGESTION is not represented.

Instead of attempting to mix/merge those enums, provide a separate value string
array for enum gsm48_reject_value.

This will be used by osmo-msc's libvlr (refactoring of FSM result handling),
I27bf8d68737ff1f8dc6d11fb1eac3d391aab0cb1.

Change-Id: I6661f139e68a498fb1bef10c266c2f064b72774a
2018-04-09 17:57:15 +02:00
Stefan Sperling 1859515c69 Add helper functions for ACC bit flags in rach control IE.
Add inline functions to manipulate and query ACC flag bits
in the rach_control.t2 and rach_control.t3 octets.
These function definitions also serve as documentation of
the purpose of rach_control.t2/t3.

Change-Id: I8f0a65c2980f86eb5c43f3bebe727f4d4d973163
Related: OS#2591
2018-02-13 15:11:20 +01:00
Harald Welte 554780836f Add GSM 04.08 type-of-number / numbering-plan-id definitions
Change-Id: Idd8d8a7a1c7f0b6cb9318e4f19ebadb415df2ed1
2018-02-09 22:40:09 +01:00
Harald Welte f1076ed75a gsm48_hdr_msg_type(): SS is in the same group as MM/CC
Change-Id: I1ddadeacced9650885f454b81f3f0df531ea1e5d
2018-02-03 21:17:43 +01:00
Harald Welte 143aed7fa6 gsm48_hdr_msg_type[_r99]: Fix bit-masks
TS 24.007 is quite clear: The upper two bits of the message type
octet are *not* part of the message type in any of the L3 protocols
which implement sequence numbers.  it doesn't matter if it's R98 or
R99, or whether the sequence number is 1bit or 2bits wide.

Related: OS#2908
Change-Id: Iec875a77f5458322dfbef174f5abfc0e8c09d464
2018-02-03 21:17:43 +01:00
Harald Welte cd82710be7 gsm_04_08.h: Reduce T310 default to 30s.
3GPP doesn't specify a network-side T310 default, but waiting for 180s
(3 minutes!) for the next message after CALL CONFIRMED is clearly way
too long and will just use radio resources for no good reason.

Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a
Related: OS#2884
2018-01-27 09:48:07 +01:00
Harald Welte e50b00911b gsm_04_08.h: Clearly annotate timers that don't have a 3GPP Default value
Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c
2018-01-27 09:48:07 +01:00
Max ff2eedac0f Fix incorrect spec reference
RAI is defined in 3GPP TS 24.008 § 10.5.5.15

Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422
2018-01-04 18:43:44 +01:00
Harald Welte 548e371200 gsm_04_08.h: Add struct for 9.1.13b GPRS suspension request
Change-Id: I90113044460a6c511ced14f588876c4280d1cac7
2017-07-10 23:42:02 +02:00
Neels Hofmeyr 17518fe393 doxygen: unify use of \file across the board
Considering the various styles and implications found in the sources, edit
scores of files to follow the same API doc guidelines around the doxygen
grouping and the \file tag.

Many files now show a short description in the generated API doc that was so
far only available as C comment.

The guidelines and reasoning behind it is documented at
https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation

In some instances, remove file comments and add to the corresponding group
instead, to be shared among several files (e.g. bitvec).

Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2017-06-23 00:18:23 +00:00
Neels Hofmeyr 87e4550585 doxygen: enable AUTOBRIEF, drop \brief
Especially for short descriptions, it is annoying to have to type \brief for
every single API doc.

Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes
the first sentence of an API doc as the brief description.

Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2017-06-23 00:18:22 +00:00
Philipp Maier 3d9191ef2a gsm0408: update bearer capability speech version
3GPP TS 24.008 specifies two new speech versions for half rate and
two new speech modes for full rate. This patch adds the relevant
constants to enum gsm48_bcap_speech_ver in gsm_04_08.h

Change-Id: Id2835384c855f924332d38f01c73bd1cfdb62549
2017-06-21 20:20:02 +00:00
Philipp Maier a9e193b5dc cosmetic: Add codec references to Speech Version Indication
Add the information which GSM Speech codec version coresponds to
which bearer capability speech version.

Change-Id: Ic9493fea139420a52c32b17d00ac7d0b2bf86967
2017-06-21 20:20:02 +00:00
Harald Welte 3f066dde8f Update L3 protocol discriminator definitions
Change-Id: Ia699d3494b93b7f88c36338e4960b35c42a29b9c
2017-06-09 08:49:13 +00:00
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