| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Modern NS specifications contain a SNS (Sub Network Service) for
negotiating IP/port/weight parameters of NS-over-IP links dynamically.
This patch adds message encoding routines for SNS-CONFIG, SNS-SIZE
and their respective acknowledgements.
Related: OS#3372
Change-Id: I5c47e1c3c10deb89a7470ee2c03adfc174accc93
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It should be large enough to prepend a struct osmo_scu_prim to pass down an
SCCP stack (see libosmo-sccp). 264 should suffice, but pick the next larger
power-of-two instead.
In osmo-msc, I would like to prepend an osmo_prim to the msgb created by
gsm0808 API, but turns out the headroom is too small:
msgb(0x61700001b660): Not enough headroom msgb_push (126 < 264)
Instead of always copying a msgb that has just that instant been created, it
makes more sense to allocate sufficient headroom in the first place.
Change-Id: I95729991eb49555f8bba60c5dc916131b03b6cf2
|
|
|
|
|
|
|
|
|
| |
Add functions to dump LCLS (without GCR) and GCR. Dumping entire struct
results in inconveniently long string hence the separate functions. Both
use talloc functions so they expect caller to take care of providing
proper allocation context and freeing memory.
Change-Id: Ic3609224c8f3282d667e75f68bc20327e36eb9e6
|
|
|
|
| |
Change-Id: I4144506feee74a8219bd3736087c30cc6323ec1d
|
|
|
|
|
|
|
| |
The symbols for those functions were always exported, but we
somehow didn't declare them in gprs_ns.h
Change-Id: Ib073e9c93fcdf408b63000182e90aabce37f687e
|
|
|
|
|
|
|
|
|
|
| |
We are using macros like this or different workarounds in libmsc. In the course
of implementing inter-MSC handover, I am encountering yet another such
situation of appending multiple strings to a limited char buffer. Standardize.
Add a unit test to utils_test.c.
Change-Id: I2497514e26c5e7a5d88985fc7e58343be1a027b2
|
|
|
|
|
|
|
|
| |
This is from TS 08.08 3.2.2.11 directly. The choices for Data mode
and Speech mode were already present, but not for Signalling mode
Change-Id: I9e24841ea877a9a78dc4d2bd14cbf60c4bea79a6
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: Ie3ac85fcef90a5e532334ba3482804d5305c88d7
|
|
|
|
|
| |
Change-Id: Id4350dee4353ebf9de0450dd5dab6e4f2ee7c3a6
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.
Change-Id: Id8a75e1da2d5f520064666e4ee413d1c91da6ae3
Related: OS#3778
|
|
|
|
|
|
|
|
|
| |
This is similar to msgb_tailroom(): It returns the amount of space
left at the end of the bit vector (compared to the current cursor).
The function returns the number of bits left in the bitvec.
Change-Id: I8980a6b6d1973b67a2d9ad411c878d956fb428d1
|
|
|
|
|
|
|
| |
This new bitvec API function returns the number of bytes used in a given
bit-vector.
Change-Id: Id4bd7f7543f5b0f4f6f876e283bd065039c37646
|
|
|
|
| |
Change-Id: If3649606ba7c25121e30ed02939ca08c94665be5
|
|
|
|
|
|
| |
These are some IEI definitions that we'll need for CSFB Fast Return
Change-Id: I0e101af316438b56d63d43fc2cb16d7caf563d07
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move T_def from osmo-bsc to libosmocore as osmo_tdef. Adjust naming to be more
consistent. Upgrade to first class API:
- add timer grouping
- add generic vty support
- add mising API doc
- add C test
- add VTY transcript tests, also as examples for using the API
From osmo_fsm_inst_state_chg() API doc, cross reference to osmo_tdef API.
The root reason for moving to libosmocore is that I want to use the
mgw_endpoint_fsm in osmo-msc for inter-MSC handover, and hence want to move the
FSM to libosmo-mgcp-client. This FSM uses the T_def from osmo-bsc. Though the
mgw_endpoint_fsm's use of T_def is minimal, I intend to use the osmo_tdef API
in osmo-msc (and probably elsewhere) as well. libosmocore is the most sensible
place for this.
osmo_tdef provides:
- a list of Tnnnn (GSM) timers with description, unit and default value.
- vty UI to allow users to configure non-default timeouts.
- API to tie T timers to osmo_fsm states and set them on state transitions.
- a few standard units (minute, second, millisecond) as well as a custom unit
(which relies on the timer's human readable description to indicate the
meaning of the value).
- conversion for standard units: for example, some GSM timers are defined in
minutes, while our FSM definitions need timeouts in seconds. Conversion is
for convenience only and can be easily avoided via the custom unit.
By keeping separate osmo_tdef arrays, several groups of timers can be kept
separately. The VTY tests in tests/tdef/ showcase different schemes:
- tests/vty/tdef_vty_test_config_root.c:
Keep several timer definitions in separately named groups: showcase the
osmo_tdef_vty_groups*() API. Each timer group exists exactly once.
- tests/vty/tdef_vty_test_config_subnode.c:
Keep a single list of timers without separate grouping.
Put this list on a specific subnode below the CONFIG_NODE.
There could be several separate subnodes with timers like this, i.e.
continuing from this example, sets timers could be separated by placing
timers in specific config subnodes instead of using the global group name.
- tests/vty/tdef_vty_test_dynamic.c:
Dynamically allocate timer definitions per each new created object.
Thus there can be an arbitrary number of independent timer definitions, one
per allocated object.
T_def was introduced during the recent osmo-bsc refactoring for inter-BSC
handover, and has proven useful:
- without osmo_tdef, each invocation of osmo_fsm_inst_state_chg() needs to be
programmed with the right timeout value, for all code paths that invoke this
state change. It is a likely source of errors to get one of them wrong. By
defining a T timer exactly for an FSM state, the caller can merely invoke the
state change and trust on the original state definition to apply the correct
timeout.
- it is helpful to have a standardized config file UI to provide user
configurable timeouts, instead of inventing new VTY commands for each
separate application of T timer numbers.
Change-Id: Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5
|
|
|
|
|
|
|
|
|
| |
Provide a va_list type vty_out() variant, to be able to pass on variable
arguments from other function signatures to vty_out().
This will be used by Ibd6b1ed7f1bd6e1f2e0fde53352055a4468f23e5 for osmo_tdef.
Change-Id: Ie6e6f11a6b794f3cb686350c1ed678e4d5bbbb75
|
|
|
|
|
|
|
|
|
|
| |
socket.h uses INET6_ADDRSTRLEN without including arpa/inet.h where it's
defined which might break external users of socket.h
Fix this by adding missing include. The error was introduced in
64b51eb68bd272b6b1f2cefa2b33e9dd74024d0c
Change-Id: I2883addcb81cec038577e401e356e8f07a947d4c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
Change-Id: I46d9f2327791978710e2f90b4d28a3761d723d8f
|
|
|
|
| |
Change-Id: I61d4f7dfada2763948f330745ac886405d889a12
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: Ifd27bab0380f7ad0c44c719aa6c8bd62cf7b034c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add osmo_hexdump_buf() as an all-purpose hexdump function, which all other
osmo_hexdump_*() implementations now call. It absorbs the static
_osmo_hexdump(). Add tests for osmo_hexdump_buf().
Rationale: recently during patch review, a situation came up where two hexdumps
in a single printf would have been useful. Now I've faced a similar situation
again, in ongoing development. So I decided it is time to provide this API.
The traditional osmo_hexdump() API returns a non-const char*, which should
probably have been a const instead. Particularly this new function may return a
string constant "" if the buf is NULL or empty, so return const char*. That is
why the older implementations calling osmo_hexdump_buf() separately return the
buffer instead of the const return value directly.
Change-Id: I590595567b218b24e53c9eb1fd8736c0324d371d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add
* 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)
* gsm0808_cell_ids_match()
* gsm0808_cell_id_matches_list()
* Unit tests in gsm0808_test.c
Rationale:
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.
Change-Id: I5535f0d149c2173294538df75764dd181b023312
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: Ic8488bc7f77dc9182e372741b88f0f06100dddc9
|
|
|
|
|
|
|
| |
Add new define for the 14 digit IMEI without the Luhn checksum, as it
is used in OsmoHLR.
Change-Id: I02b54cf01a674a1911c5c897fbec02240f88b521
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This resolves an issue introduced in 84fb5bb6a09a6a358f98c654c84c3b99a0f24eef
when msgb_wrap_with_TL() was introduced as an inline function with
*exactly the same name* as in osmo-msc.git and openbsc.git. We *NEVER*
do something like this. Functions moved from applications to library
*MUST* always be renamed. This has been the case for almost a decade
now.
With this subsequent change we make sure the libosmocore function
has a different name and doesn't clash. After this commit, old
openbsc.git and osmo-bsc.git should again build fine.
Change-Id: If1e851ac605c8d2fde3da565b0bd674ea6350c2e
|
|
|
|
|
|
|
|
| |
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_*()
counterparts.
Change-Id: I4ae5a3472a20492d5f76170b722e4e2274a5c433
|
|
|
|
|
|
|
|
|
| |
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
allocation variants.
Change-Id: I905c36d8455911c68c30bc429379b7313dd46aea
|
|
|
|
|
|
|
|
|
|
| |
* add gsm0808_create_ass_compl2() with additional gsm0808_lcls_status
parameter and make gsm0808_create_ass_compl() into trivial wrapper
around it
* update tests accordingly
Change-Id: I547c6b8707123aa8c1ef636db88908df112d90a4
Related: OS#2487
|
|
|
|
|
|
|
|
|
|
|
| |
The function osmo_sock_get_name_buf() can be used to write a string
representation to a user provided memory. Unfortunately the proper
length for the user provided memory is not obvious. To make using
osmo_sock_get_name_buf() more practical, add a define constant that
defines the length of the required memory. Also use this define in
socket.c.
Change-Id: If8be8c2c0d4935da17ab13b2c2127b719ceefbcc
|
|
|
|
| |
Change-Id: I9e3b5560a058b976638d03cb819415d237ae9984
|
|
|
|
| |
Change-Id: I3ab94f362866d752099000afe62922288b3dd118
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Related: OS#2541
Change-Id: Id2d2a3a93b033bafc74c62e15297034bf4aafe61
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: I47888965ab11bba1186c21987f1365c9270abeab
Related: OS#3075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
|
|
|
|
| |
Change-Id: I0f47a610e06ac99bd60a5aad6f50f3658480165e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: If97c34f117bfaab2232bbb625e9d118c8f390e58
|
|
|
|
|
|
| |
Move lupd_names[] from osmo-msc to libosmo-gsm.
Change-Id: Ica25919758ef6cba8348da199b0ae7e0ba628798
|
|
|
|
|
|
|
|
| |
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.
Related: http://people.osmocom.org/neels/mi_mi_mi.jpg
Change-Id: I7798c3ef983c2e333b2b9cbffef6f366f370bd81
|
|
|
|
|
|
|
|
|
|
|
| |
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_*().
Change-Id: I7b33a771acbd391c5f9a494d6450edb18511433f
|
|
|
|
|
|
| |
Keep #defines to still support previous wrong spelling.
Change-Id: Id4cf812f0bc3cd40f6bfa05166f817a07a647f71
|
|
|
|
|
|
|
| |
osmo-msc is about to implement the SGs interface and requires a RAT indicator
for that.
Change-Id: I00588396bfe03feba38ecb0717d584594f0b2b46
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Change-Id: I659687aef7a4d67ca372a39fef31dee07aed7631
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using an FSM instace's logging context is very useful. Sometimes it makes sense
to log something on a different logging category than the FSM definition's
default category.
For example, an MSC conn has aspects concerning MM, CC, RR, MGCP, ..., and
currently all of those log on DMM.
This came up in I358cfbaf0f44f25148e8b9bafcb9257b1952b35a, where I want to log
an MGCP event using a ran_conn context, and used the conn->fi->id. That of
course omits context like the current conn FSM state...
I remember at least one other place where I recently added logging using some
fi->id as context, so it might turn out useful in various places.
Change-Id: I11b182a03f5ecb6df7cd8f260757d3626c8e945d
|
|
|
|
|
|
|
|
| |
The LOGPFSM macros are in such wide use that they should guard against a NULL
fi pointer. In case of NULL, default to subsys = DLGLOBAL, loglevel =
LOGL_ERROR and state = "fi=NULL".
Change-Id: I9eaf8b7e2cf1e450ae626cb2fc928862008f6233
|
|
|
|
| |
Change-Id: I3bf6500889aa58195f50a726dec0876c0c2baec3
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 3GPP TS 48.008 the Global Call Reference IE is only used in HANDOVER
REQUEST (§3.2.1.8) and ASSIGNMENT REQUEST (§3.2.1.1) 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.
Change-Id: Icfbb2404e1a1d500243e2071173299b557369335
|
|
|
|
|
|
|
|
|
| |
Instead of duplicating the fmt and args in LOGPFSML and LOGPFSMLSRC, rather
make LOGPFSML invoke LOGPFSMLSRC with __FILE__ and __LINE__.
This is a cosmetic preparation for more tweaks coming up.
Change-Id: I2f23c57ebfdb5355919c06ac5ded7732e3b17a97
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend the vty_bind_cmd VTY command to allow to optionally specify
a port in addition to the IPv4 address.
Introduce telnet_init_default to relieve client code from having
to query the bind IPv4 address (and now the TCP port). Instead a
client only needs to pass the default TCP port to use.
Client code should use it like:
int rc = telnet_init_default(ctx, priv, OSMO_VTY_PORT_SGSN);
Change-Id: Id5fb2faaf4311bd7284ee870526a6f87b7e260f3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement necessary messages for Procedure Check_IMEI_VLR (TS 23.018
Chapter 7.1.2.9). 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).
Related: OS#3733
Change-Id: I085819df0ea7f3bfeb0cabebb5fd1942a23c6155
|