| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basically, I am applying code review that I would have given had I not been on
vacation when the last osmo_sock_get_name* stuff was merged.
osmo_sock_get_name2() is so far a static internal function. However, it is
nothing like osmo_sock_get_name(), so instead rename it to
osmo_sock_get_ip_and_port(). Also make it public API, no need to hide it. I'm
adding an "and" in the name to hopefully clarify: "ip_port" vs. "ip_and_port"
-- there already are _get_X_ip_port() functions that only return the port
string, despite "ip" in the name.
Add new public osmo_sock_get_name2(), which is like osmo_sock_get_name(),
except it uses a static string instead of talloc, and omits the braces. This
is most convenient for log statement formats, avoiding dyn allocations.
Add new osmo_sock_get_name_buf(), which is like osmo_sock_get_name2() but
writes to a caller provided char buffer.
Use osmo_sock_get_name_buf() in the implementation of osmo_sock_get_name(),
but use another (non-static) local string buffer, because adding braces is too
complex without talloc_snprintf().
Rationale:
I want to improve the logging of socket errors, e.g. change
DLMGCP ERROR Failed to read: 111/Connection refused (mgcp_client.c:720)
to
DLMGCP ERROR Failed to read: r=10.0.99.2:2427<->l=10.0.99.2:2728: 111='Connection refused' (mgcp_client.c:721)
but it is just not handy to compose logging with the current API:
- osmo_sock_get_name() requires a talloc_free().
- all the others require output buffers.
- the only way to conveniently compose a logging string and,
- notably, the only trivial way to skip the string composition if the logging
level is currently muted, is to have a function that returns a static string:
the new osmo_sock_get_name2().
- (I think the osmo_sock_get_{local,remote}_* convenience wrappers should never
have been added, because they encourage the caller to invoke the same code
twice, for IP addr and port, and throw away one half each time.)
Related: Iae728192f499330d16836d9435648f6b8ed213b6 (osmo-mgw)
Change-Id: I8ad89ac447c9c582742e70d082072bdd40a5a398
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: Ic37f3b2114b8095cfce22977e67133b9103942e3
Related Change-Id: (docs) I549b6c8840a1e86caac09e77fb8bc5042d939e62
Related Change-Id: (TTCN) If2256607527ecfcb10285583332fb8b0515d7c78
Related: OS#3587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
- OSMO_GSUP_MSGT_MO_FORWARD_SM_*,
- OSMO_GSUP_MSGT_MT_FORWARD_SM_*.
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 7.6.8.1),
- OSMO_GSUP_SM_RP_OA_IE (see 7.6.8.2),
- OSMO_GSUP_SM_RP_UI_IE (see 7.6.8.4),
- OSMO_GSUP_SM_RP_MMS_IE (see 7.6.8.7),
- OSMO_GSUP_SM_RP_CAUSE_IE (see GSM TS 04.11, 8.2.5.4),
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.
Change-Id: Ibe325c64ae2d6c626b232533bb4cbc65fc2b5d71
Related Change-Id: (docs) Ie0150756c33c1352bc4eb49421824542c711175c
Related Change-Id: (TTCN) Ibf49474a81235096c032ea21f217170f523bd94e
Related: OS#3587
|
|
|
|
|
|
|
| |
It allows setting additional assignment parameters explicitly.
Change-Id: Id89765df3f8c12f55f73f1d7a9d90c8883eb3bba
Related: OS#2487
|
|
|
|
|
|
|
|
| |
* add functions to encode Global Call. Ref. from TS 29.205 as 3GPP TS
48.008 ยง3.2.2.115 information element
* add corresponding tests
Change-Id: I82ce0207dc8de50689a8806c6471ad7fbae6219d
|
|
|
|
|
|
|
|
| |
Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.
Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
|
|
|
|
|
|
|
| |
Otherwise struct osmo_stats_config is not defined and compiler fails.
Related: OS#3722
Change-Id: I037c3ca141ecee2d457e0a881a56e32ee24cec4d
|
|
|
|
|
|
|
|
| |
It's often handy to compare certain msgb layer to a given array and
print the position where they differ. Add simple pretty-printer and
corresponding L* wrappers.
Change-Id: I3bc95f2f5ab6e3f4b502647fb3e0aaaf1f7c4cf5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a standalone bcd-to-string conversion function with generic parameters.
Add a regression test in utils_test.c.
So far there is no single universal implementation that converts a BCD to a
string. I could only find gsm48_mi_to_string(), which also interprets
surrounding bytes, MI type and TMSI as non-BCD value.
The idea is to use this function from gsm48_mi_to_string() and similar
implementations in subsequent commits.
Root cause: in osmo-msc, I want to have an alternative MI-to-string function
for composing an FSM name, which needs the BCD part of gsm48_mi_to_string() but
not the TMSI part.
Change-Id: I86b09d37ceef33331c1a56046a5443127d6c6be0
|
|
|
|
|
|
|
| |
Counting list entires should not alter the list content: let's make this
obvious from type signature.
Change-Id: I414e67a3de733fab407161b3264d3b89070ba537
|
|
|
|
|
| |
Related: OS#3722
Change-Id: If466a64bd44dcb8ae8a9b7f82bc9c9435ba3e640
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Change-Id: I71d58fad89502a43532f60717ca022c15c73f8bb
|
|
|
|
|
|
|
|
|
| |
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).
Change-Id: Ic87f8a771b87b52215d0a7451b67794557b80b8a
Related: OS#3615
|
|
|
|
|
|
|
|
| |
The specification defines a default port where the SGs interface should
be reachable. Lets add a define-constant for it.
Change-Id: Ia4b9f547dd980411d15b2691b7f535fa0463f0f1
Related: OS#3615
|
|
|
|
|
|
|
| |
there is a whitespace between the * and osmo_apn_to_str(). Lets
remove this.
Change-Id: I094e6eb08eacf2d6459c47a7370837601aa92925
|
|
|
|
|
|
|
|
|
| |
It's similar to osmo_sockaddr_to_str_and_uint() but does not require odd
typecasting for AF_INET case. Make osmo_sockaddr_to_str_and_uint() into
wrapper around new function and make sure to check for address family
before typecasting. Also use proper return type.
Change-Id: Ie384483124d407a960ab6732e6a7fd90554389d2
|
|
|
|
|
|
|
|
| |
The value string arrays in the header file (gsm_29_118.h) are not
declared as extern. Lets add it now.
Change-Id: Ib6c4cbea649f790fa4db1ed2fe2b7e76a60291b4
Related: OS#3615
|
|
|
|
|
|
|
| |
* use pointer to proper struct type for GCR
* update comments to be useful for doxygen
Change-Id: I8ccfbd0c146e462e599e5305520cc89602364ec3
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: I8dc1e4880352833a0a49c1dd0d7cb4148ac43aff
|
|
|
|
|
|
|
| |
We always use id = 0 when sending TRAP messages. Let's make this more
obvious by introducing appropriate define.
Change-Id: I33d7d4c6a1885a75a85d6f2f017430e0860b4126
|
|
|
|
|
|
|
|
|
| |
* add missing L1 and L4 hexdump
* add msgb_l4() for consistency and convert msgb_sms() into simple alias
Those will be used in follow-up patches for msgb debug/test helpers.
Change-Id: I8d6dd1b1ff3aa98a452711c692ca7dee0449203b
|
|
|
|
|
|
|
|
| |
We currently have no generator function that can generate BSSMAP
HANDOVER PERFORMED messages. Lets add function for this.
Change-Id: I825106858bd89afc9837811b8fed2e8accc82441
Related: OS#3645
|
|
|
|
|
|
|
| |
This will be reused be several tests related to TS 48.008 and TS 29.205
in follow-up commits.
Change-Id: I4d8cc05b8df8e70c1f6257e53ae3acec7901681f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
osmo-bsc.
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,
misconfigurations, etc.
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
results.
Related: OS#3063
Change-Id: I780d452dcebce385469e32ef2fd844df6033393a
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: I4b873f9a3c5a5d33b438382971b3d92e40d48d62
Related: OS#2487
|
|
|
|
|
|
|
| |
These are actually parts of the struct in big endian order, which will soon be
done automatically by struct_endianess.py.
Change-Id: I9bc694f10fa9cef0bb7fc791bb40e7602459b16b
|
|
|
|
|
|
|
|
| |
That's necessary for 'struct tlv_parsed' definition although lack of it
does not cause build failure in libosmocore for me but does so for
osmo-bsc.
Change-Id: I3b2d3955d02b07dc7ec5e9f0c66cc477196703ed
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add function to generate cipher mode reject with extended (2-byte)
Cause IE
* add function to get (extended) Cause value
* add corresponding (extended cause) test
* update existing (non-extended cause) test
* use enum as a parameter for existing non-extended version to make
interface more unified
Change-Id: Id5509b94a18180a44f45300caaa02b843c166fa3
Related: OS#3187
|
|
|
|
|
|
|
|
|
|
| |
The msgb_wrap_with_TL() is generally useful so it make sense to make it
public to facilitate code re-use.
Other helpers can be implemented as trivial wrappers over existing tlv.h
functions. Update headers and code accordingly.
Change-Id: I37e91d031fba28cf1c6735b8069b0265746f55e6
|
|
|
|
|
|
|
|
| |
Add values indicating that LCLS control/config/status value has not been
received yet.
Change-Id: I52dc6a52f5ee043ed2c1625ffecfd495e3c746b1
Related: OS#2487
|
|
|
|
|
|
|
|
|
|
|
|
| |
* add Class definitions
* add helper to check for extended bit
* add helper to get Cause's Class
* use enum in gsm0808_cause_name() and gsm0808_create_cipher_reject() to
avoid confusion between class and cause
* update gsm0808_create_cipher_reject() comments
Change-Id: I31b31dfc22eb4b6b07089e1255246ac458125340
Related: OS#3187
|
|
|
|
| |
Change-Id: Ib228368901ce90a02a5664f2510593371c7d29cd
|
|
|
|
|
|
|
|
| |
The value strings for the SGSAP IEI are missing, lets add a set of value
strings and a function to retrieve them.
Change-Id: I2787303174f74ffba86675bce2c12f680d8ea708
Related: OS#3615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a typo that prevents building on ppc64 (Power8, Big Endian).
Tested with gcc version: 8.2.1+r265487
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DBUILDING_LIBOSMOCORE -Wall -Wall -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -DBUILDING_LIBOSMOCORE -Wall -c -o panic.lo panic.c
In file included from ../include/osmocom/gsm/rsl.h:6,
from gsmtap_util.c:37:
../include/osmocom/gsm/protocol/gsm_08_58.h:60:4: error: expected specifier-qualifier-list before 'sapi'
sapi:3;
^~~~
Change-Id: I4a40fc68cb6dfdfadfcc34213c4ecdabbbc356f2
|
|
|
|
|
|
|
|
|
| |
The header file gsm_29_118.h is defining variables of type struct
value_string, which is declared in core/utils.h. We should add an
include to utils.h to prevent confusion when the header is used.
Change-Id: I9f9bb62d29cd068820ad5aa677717bd448de3f4a
Related: OS#3615
|
|
|
|
|
|
|
|
|
|
| |
There is already a group of similar functions for L1, L2 and L3,
but L4 was missing. The L4 is usually used for parsing of complex
L3 messages, such as SS/USSD and SMS.
This change introduces a similar halper for L4.
Change-Id: I755f2d654bbdad2a8b4f94df9023bdd370b07ae6
|
|
|
|
| |
Change-Id: Id71d4b45e2b9f42da5e23e709ad97d4d0abfc3d9
|
|
|
|
|
|
|
|
|
| |
The function that generates the clear command takes a parameter
"reason", which is the cause code. Lets give it the name "cause" to have
a coherent naming scheme that matches the other functions and the 3gpp
specs.
Change-Id: I7b6c15e8fa8db13deef5041095944ca1c58fb99f
|
|
|
|
|
|
|
| |
osmo_gen_mme_group_domain(), osmo_gen_mme_group_domain() and
osmo_gen_home_network_domain()
Change-Id: Ia882d9db05ec0037e593aeebea21bc31adb680bb
|
|
|
|
|
|
|
|
|
|
| |
Return only the IP or port of either the local or remote connection,
not the whole set of IP and port of both the local and remote
connection like osmo_sock_get_name() does it. This is needed for
OS#2841, where we only want to print the remote IP.
Related: OS#2841
Change-Id: I6803c204771c59a2002bc6a0e6b79c83c35f87e1
|
|
|
|
| |
Change-Id: Idddfc9b851eb4c2fa7dd661a9ce1b03a04883109
|
|
|
|
|
|
|
|
|
|
|
|
| |
It will allow to make code handling chan_nr values more easier to read
and less prone to errors.
union is used to be able to get the full octet in
case we need to pass it somewhere else or encode it.
An extra union is used in struct abis_rsl_common_hdr and others to allow
using fields directly while keeping API compatibility.
Change-Id: Icd6822021207270a00106c50f8ca6b93c1250df9
|
|
|
|
|
|
|
|
|
|
|
|
| |
It will allow to make code handling link_id values more easier to read
and less prone to errors.
union is used to be able to get the full octet in
case we need to pass it somewhere else or encode it.
An extra union is used in struct abis_rsl_common_hdr to allow using fields
directly while keeping API compatibility.
Change-Id: Ibd75a493bcfdf46c028ea466867d0c0d83d46343
|
|
|
|
| |
Change-Id: I2e710141ee90ddc8b5336d5f81e99bd918d10106
|
|
|
|
|
|
|
|
| |
Wireshark GSMTAP dissector has LTE NAS subtypes for plain NAS messages
and NAS messages with security header. This commit adds definition for
these subtypes.
Change-Id: I49d15fb13299c1bcbe0fb7e50bf222294c7a49ef
|
|
|
|
|
|
|
| |
Later release of 3GPP TS 36.331 added new LTE RRC channels. This commit
additionally defines LTE RRC message types existing in Release V15.3.0.
Change-Id: Ifa48b2227be15af04c9a4702d2025abcc660f0df
|
|
|
|
|
|
|
|
| |
Add a function to convert S0-S15 bits to struct gsm48_multi_rate_conf,
which hold the codec settings for AMR.
Change-Id: I973736273c236eee84decf15868190e339c3fed4
Related: OS#3548
|
|
|
|
|
|
|
| |
The enum gsm48_chan_mode has value strings, but no function to retrieve
those strings. Lets add one.
Change-Id: If715705e1ebdfcfdfae1c2099932f7bb8b3861a7
|
|
|
|
|
|
|
|
|
|
| |
Since the CMD_ATTR_* flags are intended to be used in bitwise
operations, let's assign them proper values. Adding a new flag
(e.g. CMD_ATTR_FOO_BAR) could actually result in assigning 0x03
instead of expected (0x01 << 2).
Change-Id: I3b1badef830f7e6436a67673b5709ec33c060c68
Related: OS#3584
|