|Age||Commit message (Collapse)||Author||Files||Lines|
In OsmoMSC, it's required to be able to specify a particular GSM 04.07
transaction ID for GSM 04.80 Release complete message instead of the
hard-coded value, that is used gsm0480_create_ussd_release_complete().
Let's finally deprecate gsm0480_create_ussd_release_complete(), and
introduce a new function without USSD prefix, as this message
is also used in other "structured" supplementary services.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
When a call that was established in a CSFB context ends the CLEAR
COMMAND that is send from the BSC to the MSC should contain a CSFB
indication IE, which consists of just the IE byte itsslef. This
additional IE tells the BSC to include other CSFB related IEs into the
RR Release message.
These are some IEI definitions that we'll need for CSFB Fast Return
Replace osmo_gsup_get_err_msg_type() with a wrapper to
OSMO_GSUP_TO_MSGT_ERROR(). This macro assumes, that all error messages
are (request message | 0x000001). Add a big comment header for
osmo_gsup_message_type, describing this already implicitly followed rule
and therefore making it explicit.
With this change, we don't need to maintain the request -> error message
mapping in osmo_gsup_get_err_msg_type() anymore.
Related: Iec1b4ce4b7d8eb157406f006e1c4241e8fba2cd6 (osmo-gsm-manuals)
osmo-bsc and osmo-msc implement identical Classmark structures. It makes sense
to define once near the gsm48 protocol definitions.
Also move along some generic Classmark API from osmo-msc.
* osmo_lai_cmp() (to use in gsm0808_cell_id_u_matches())
* osmo_cgi_cmp() (to use in gsm0808_cell_id_u_matches())
* gsm0808_cell_id_u_match() (to re-use for single IDs and lists)
* Unit tests in gsm0808_test.c
For inter-BSC handover, it is interesting to find matches between *differing*
Cell Identity kinds. For example, if a cell as CGI 23-42-3-5, and a HO for
LAC-CI 3-5 should be handled, we need to see the match.
This is most interesting for osmo-msc, i.e. to direct the BSSMAP Handover
Request towards the correct BSC or MSC.
It is also interesting for osmo-bsc's VTY interface, to be able to manage
cells' neighbors and to trigger manual handovers by various Cell Identity
handles, as the user would expect them.
The longest BCd-digit type identity is the IMEISV with 16, so there's
no point in trying to parse up to 255 decimal digits, which will do
nothing but to overflow the caller-provided output buffer.
Let's also clearly define the required minimum size of the output
buffer and add a reltead #define for it.
Add new define for the 14 digit IMEI without the Luhn checksum, as it
is used in OsmoHLR.
They only make sense in the context of LCLS so far - let's make sure
they're not used by external projects directly instead of gsm0808_*()
Most of the time we'll have GCR filled anyway so it make sense to have
it as static parameter instead of a pointer to separately allocated
structure. Update tests to cover both static and dynamic osmo_lcls
* add gsm0808_create_ass_compl2() with additional gsm0808_lcls_status
parameter and make gsm0808_create_ass_compl() into trivial wrapper
* update tests accordingly
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.
Verify 14 digit and 15 digit IMEI strings. OsmoHLR will use the 14
digit version to check IMEIs before writing them to the DB.
Place the Luhn checksum code in a dedicated osmo_luhn() function, so
it can be used elsewhere.
As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.
This change ports osmo-bsc code for encoding SI rest octets.
The conversion was a bit tricky in some places because some
functions receive a 'struct gsm_bts' parameter in osmo-bsc.
In this libosmocore version, such functions expect parameters
which correspond to the individual fields of 'struct gsm_bts'
which are used by these functions.
Several structs from osmo-bsc's system_information.h are now
also declared in libosmocore headers, with an added osmo_ prefix
to avoid collisions with existing definitions in osmo-bsc.
Some helpers were ported from osmo-bsc's system_information.c
to libosmocore's gsm48_rest_octets.c. Contrary to osmo-bsc's
implementation they are now only visible within this file.
Unfortunately, this code ported from osmo-bsc lacks unit tests.
As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.
This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.
An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.
Note that OSMO_GSUP_IMEI_RESULT_ACK is 0 on the wire, although the
enum value is 1. Same with NACK (1 on wire, enum 2).
I had implemented enum osmo_gsup_imei_result after
enum osmo_gsup_cancel_type above, where this comment exists as well,
and I incorrectly assumed that enum osmo_gsup_cn_domain in the middle
was also implemented this way and therefore adding the comments to each
enum would be redundant. But for cn_domain, the values on the wire are
the same as the enum values.
Move lupd_names from osmo-msc to libosmo-gsm.
We have gsm48_mi_to_string() and osmo_bcd2str(), but still lack a function that
conveniently prints both MI type and value in one function call.
Previously it could encode both incorrect values as well as incorrect
message. Let's fix this by explicitly checking for invalid values and
ensuring that at least one of the parameters is valid.
This function have no external or internal users so it's better to fix
type signature as well to match the rest of gsm0808_create_lcls_*().
Keep #defines to still support previous wrong spelling.
osmo-msc is about to implement the SGs interface and requires a RAT indicator
In the MSC, we have RAN types GERAN_A and UTRAN_IU, now we need a similar enum
in osmo-hlr's GSUP client.
Naming: in the MAP specifications, the RAN type is mostly called RAT type,
(Radio Access Network vs. Radio Access Technology?). Since GSUP is more about
MAP messages, I'm calling the enum osmo_rat_type.
Rationale: osmo-msc and osmo-sgsn want to tell the osmo-hlr which RAT a
subscriber is calling on. A subsequent patch will extend the GSUP protocol and
add a RAT types IE.
In 3GPP TS 48.008 the Global Call Reference IE is only used in HANDOVER
REQUEST (§220.127.116.11) and ASSIGNMENT REQUEST (§18.104.22.168) messages which
also include LCLS Config and CSC parameters. Hence, there's no point in
using GCR encode/decode functions alone.
Introduce gsm0808_dec_lcls() and gsm0808_enc_lcls() as trivial wrappers
on top of GCR enc/dec routines which are made static. Adjust tests
accordingly. Test output intentionally left unchanged.
Implement necessary messages for Procedure Check_IMEI_VLR (TS 23.018
Chapter 22.214.171.124). This lets the VLR ask the EIR to check if an IMEI
is valid. In the Osmocom stack, we don't have an EIR and this request
will be handled by the HLR. We will be able to store the IMEI in the
HLR as side-effect (OS#2541).
This is roughly based on TS 29.002 8.7.1 MAP_CHECK_IMEI service, but
only implements the bare minimum required IEs (imei and imei_result).
Simplify gsup_test.c by defining an end marker in gsup.h. No need to
manually update the last element every time anymore.
The C standard guarantees, that the end marker will have the last value
plus one: "Each subsequent enumerator with no = defines its enumeration
constant as the value of the constant expression obtained by adding 1 to
the value of the previous enumeration constant." (From C99: 126.96.36.199
Similar to existing 16 and 32 bit value helpers but simpler because we
don't have to worry about alingment and endianness.
The name "LAI AND LAC" makes no sense because a LAC
is part of a LAI. Keep the old name available for
API backwards compatibility.
This is 1:1 the result of doing
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.
According to 3GPP TS 29.002, section 12.4, MAP-READY-FOR-SM is
used between the MSC and VLR as well as between the VLR and the
HLR to indicate that a subscriber has memory available for SMS.
This change replicates this service in GSUP as READY_FOR_SM_*.
The only mandatory IE for this service (excluding Invoke ID) is
'Alert Reason' that is replicated by OSMO_GSUP_SM_ALERT_RSN_IE.
Related Change-Id: (docs) I549b6c8840a1e86caac09e77fb8bc5042d939e62
Related Change-Id: (TTCN) If2256607527ecfcb10285583332fb8b0515d7c78
According to 3GPP TS 29.002, there are two services:
- MAP-MO-FORWARD-SHORT-MESSAGE (see 12.2),
- MAP-MT-FORWARD-SHORT-MESSAGE (see 12.9),
which are used to forward MO/MT short messages.
This change replicates both services as GSUP messages:
Please note, that only the 'must-have' IEs are introduced
by this change, in particular the following:
- OSMO_GSUP_SM_RP_MR_IE (see note below),
- OSMO_GSUP_SM_RP_DA_IE (see 188.8.131.52),
- OSMO_GSUP_SM_RP_OA_IE (see 184.108.40.206),
- OSMO_GSUP_SM_RP_UI_IE (see 220.127.116.11),
- OSMO_GSUP_SM_RP_MMS_IE (see 18.104.22.168),
- OSMO_GSUP_SM_RP_CAUSE_IE (see GSM TS 04.11, 22.214.171.124),
where both SM_RP_DA and SM_RP_OA IEs basically contain
a single nested TV of the following format:
- T: identity type (see 'osmo_gsup_sms_sm_rp_oda_t'),
- V: encoded identity itself (optional).
According to GSM TS 04.11, every single message on the SM-RL has
an unique message reference (see 8.2.3), that is used to link
an RP-ACK or RP-ERROR message to the associated (preceding)
RP-DATA or RP-SMMA message transfer attempt.
In case of TCAP/MAP, this message reference is being mapped to the
Invoke ID. But since GSUP has no 'Invoke ID' IE, and it is not
required for other applications (other than SMS), this change
introduces a special 'SM_RP_MR' IE that doesn't exist in MAP.
Related Change-Id: (docs) Ie0150756c33c1352bc4eb49421824542c711175c
Related Change-Id: (TTCN) Ibf49474a81235096c032ea21f217170f523bd94e
It allows setting additional assignment parameters explicitly.
* add functions to encode Global Call. Ref. from TS 29.205 as 3GPP TS
48.008 §126.96.36.199 information element
* add corresponding tests
Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 188.8.131.52 add corresponding tests.
At the moment the all gsm0808 cause codes are encoded directly using the
tlv API directly to put a one byte TLV field. This works ok for most
situations where the cause code consists of a single byte. However,
gsm0808 specifies a two byte cause code model where cause codes may be
extended up to two bytes. Instead of implementing the encoding over and
over and again, let's rather have an encoder function we can call.
- Add an encoder function that can generate single byte and extended
cause codeds and makes the length decision automatically.
- Use only this function to append cause codes
We already have some GSM29118 related definitions and functions in
libosmocore. Lets also add some functions to generate GSM29118 messages
(similar to those we have for GSM0808).
The specification defines a default port where the SGs interface should
be reachable. Lets add a define-constant for it.
there is a whitespace between the * and osmo_apn_to_str(). Lets
The value string arrays in the header file (gsm_29_118.h) are not
declared as extern. Lets add it now.
* use pointer to proper struct type for GCR
* update comments to be useful for doxygen
When adding complex TLV structures where length of V is not known in
advance it's handy to be able to simply add Tag and save the pointer to
the Length field so it can be updated once entire Value is added and its
length is known.
We currently have no generator function that can generate BSSMAP
HANDOVER PERFORMED messages. Lets add function for this.
This will be reused be several tests related to TS 48.008 and TS 29.205
in follow-up commits.
ARFCNs are values in well defined ranges. Until this patch, ARFCNs not
belonging to any band were blindly assigned to DCS1800 by
gsm_arfcn2band, causing unnoticed bugs and misconfigurations in
Previous API gsm_arfcn2band cannot accomodate this kind of check easily,
so let's deprecate it to tell people to use a new API gsm_arfcn2band_rc
which performs this kind of checks and allows callers to log failures,
At the same time, modify implementation of gsm_arfcn2band to abort if an
invalid ARFCN is passed, this way users of this API can notice they are
passing wrong data to it that most probably will produce unexpected
It's convenient to hold all LCLS-related parameters from 3GPP TS 48.008
in a single structure.
This will be used in follow-up patch handling Assignment Request with
extended parameters as well as corresponding BSC code working with LCLS.