| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The state check in lapd_dl_reset causes some buffers
never to be released. Using talloc report LAPD UA
message buffers are never released after each call
and cause a memory leak.
Change-Id: I2799b70623f2ec4dbc725eb213e332e98da02a3e
|
|
|
|
|
|
|
|
| |
Expand 3GPP TS 52.021 §9.4.43 Probable Cause with Osmocom-specific value
for PCU version reporting to enable sending it via OML alarms.
Change-Id: If57459c0610f2c7b36d599b13087c8deef8bdd9e
Related: OS#1614
|
|
|
|
|
|
|
|
| |
Add human-readable names for Message Types from 3GPP TS 52.021 §9.1
Related: OS#1614
Change-Id: Ide8202b4387351f57ceee34a9eb8c30aef09a663
|
|
|
|
|
|
|
| |
Add human-readable names for Attributes from 3GPP TS 52.021 §9.4
Change-Id: I861247c01557dac7e484ef6fb9b170f69c8a7f55
Related: OS#1614
|
|
|
|
|
|
|
|
| |
Ensure that a changed conv_gen.py and/or conv_codes_gsm.py result in
regeneration of the gsm0503* generated sources. Before this patch, manual
cleaning of the generated files was necessary to benefit from a code update.
Change-Id: Ib4328662c21280c0ea6aa9391a64ada2c6598704
|
|
|
|
|
|
|
|
| |
To allow building coding/gsm0503_interleaving.c which includes the generated
bit*gen.h (via bits.h), add -I to the builddir include path in order to find
the generated bit*gen.h headers there.
Change-Id: I0d465bc109765b1315d615243bea6af027afa368
|
|
|
|
|
|
|
|
| |
The logging code crashes if osmo_log_info is not set, which is typically
achieved by calling log_init(). Let's fail with a reasonable assert
and error message if the user forgets that.
Change-Id: If3007860d2efe6ea9aec27e7d7439d44a7cd19c2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
To ensure that the IND index appended to SEQ does not affect the SEQ, the check
should read '>= seq_1', not '>'.
Change-Id: Ib1251159eee02aa07fae1b429ffec2e4604bf6a8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't use CTRL_TYPE_UNKNOWN as value_string[] terminator, use an explicit, more
obvious { 0, NULL } termination. Set an explicit string for CTRL_TYPE_UNKNOWN.
No other value_string[]s to date have such a "hidden" terminator.
BTW, a { 0, "string" } item is not a terminator, only { 0, NULL } is, so we can
set a string for CTRL_TYPE_UNKNOWN == 0.
Also, having a string value for CTRL_TYPE_UNKNOWN is not harmful because all
code paths explicitly check for the CTRL_TYPE_*s that are valid.
Adjust the test expectation.
From the ctrl_type_vals enum, remove the = 0, because it is implicitly 0
anyway.
One motivation to press this fixup: I am trying to add a script that checks
whether all value_string[]s are terminated to our jenkins jobs, and to find
that this one is terminated, it would need to interpret the CTRL_TYPE_UNKNOWN
constant, which would make things far more complex. At this point, all of the
value_string[]s have an explicit termination, and I would like to enforce this
from now on -- for readable code and to not spend more time on the validator.
The patch adding ctrl_type_vals (Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28) was
accepted by another reviewer before I could reconfirm my -1, so this is a fixup
to enable the termination checking script patches.
Related: I2bc93ab4781487e7685cfb63091a489cd126b1a8 (adds script to libosmocore)
I7fe3678b524d602fc6aa14bc0ed06308df809a3e (uses in jenkins.sh)
Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28 (adds ctrl_type_vals)
Change-Id: Ia99f37464c7b36b587da2cc78f52c82725f02cbc
|
|
|
|
|
|
|
|
|
|
|
|
| |
In case we are a daemon, we do not need to daemonize again.
On the other hand everything is fine and we also do not need
to bail out with an error.
The daemonize template at [1] does the same.
[1] http://www.itp.uzh.ch/~dpotter/howto/daemonize
Change-Id: Ia4dcf7344bd65934faa3d7d46563f6e0532c232e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far we incremented SQN by 1, which doesn't match the procedures described in
3GPP TS 33.102. An IND (index) denotes a non-significant part of SQN, and the
significant SEQ part needs to be incremented.
In OsmoHLR we furthermore want to use the "exception" suggested in annex C.3.4,
so that each HLR's client has a fixed IND index. In other words, we will not
assign IND cyclically, but keep IND unchanged per auth vector consumer.
Add 'ind_bitlen' and 'ind' to the osmo_sub_auth_data.u.umts structure and
increment SQN accordingly.
Add a comment explaining the details.
Because 'ind_bitlen' is still passed as zero, the milenage_test does not change
its behavior, which is a feature I want to clearly show in this patch. The test
will be expanded for the newly implemented SQN scheme in a subsequent patch.
Adjust osmo-auc-gen.c to still show the right SQN and SQN.MS -- because it is
passing ind_bitlen == 0, osmo-auc-gen can rely on single increments and know
SQN.MS is sqn - 1. Note that osmo-auc-gen_test output remains unchanged.
Related: OS#1968
Change-Id: Ibc97e1736a797ffcbf8c1f7d41c5c4518f4e41bf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prepare for the implementation of splitting SQN increments in SEQ and an IND
part; particularly to clearly show where the changes in auth/milenage_test's
expectations originate.
Rationale: the source of UMTS auth vectors, for us usually OsmoHLR, typically
stores the last used SQN, not the next one to be used. Particularly with the
upcoming fix of the SQN scheme, this change is important: the next SQN will
depend on which entity asks for it, because each auth consumer may have a
particular slot in the IND part of SQN. It does not make sense to store the
next SQN, because we will not know which consumer that will be for.
The milenage_test has always calculated a tuple for SQN == 34. To account for
the increment now happening before calculating a tuple, lower the test_aud->sqn
by one to 0x21 == 33, so that it is still calculating for SQN == 34.
Because we are no longer incrementing SQN after the tuple is generated,
milenage_test's expected output after doing an AUTS resync to 31 changes to the
next SQN = 32, the SQN used for the generated tuple.
(BTW, a subsequent patch will illustrate AUTS in detail.)
osmo-auc-gen now needs to pass the user requested SQN less one, because the SQN
will be incremented befor generating the auth vector. Also the SQN remains the
same after generating, so SQN output needs less decrementing. Note that the
expected output for osmo-auc-gen_test remains unchanged, hence the same input
arguments (particularly -s <sqn> and -A <auts>) still produce the same results.
Note: osmo-hlr regression tests will require adjustments when this patch is
merged, because it must now pass desired_sqn - 1 instead of just desired_sqn.
See osmo-hlr change-id I4ec5a578537acb1d9e1ebfe00a72417fc3ca5894 .
Related: OS#1968
Change-Id: Iadf43f21e0605e9e85f7e8026c40985f7ceff1a3
|
|
|
|
|
|
|
|
|
| |
We don't really use state numbers without bounds check into string
tables since March 2010, when value_string became part of libosmocore.
It's time to catch up, 7 years later...
Change-Id: I1dac7b4cb441a1119cc167112521e8b8aae62e63
|
|
|
|
|
|
| |
Matches our general scheme and helps readability of an upcoming patch.
Change-Id: I174086a988b51b6e80f3661609069b69a3d41cc7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are some projects, such as GR-GSM and OsmocomBB, which would
benefit from using one shared implementation of GSM 05.03 code. So,
this commit introduces a new sub-library called libosmocoding, which
(for now) provides GSM, GPRS and EDGE transcoding routines, migrated
from OsmoBTS.
The original GSM 05.03 code from OsmoBTS was relicensed under
GPLv2-or-later with permission of copyright holders (Andreas Eversberg,
Alexander Chemeris and Tom Tsou).
The following data types are currently supported:
- xCCH
- PDTCH (CS 1-4 and MCS 1-9)
- TCH/FR
- TCH/HR
- TCH/AFS
- RCH/AHS
- RACH
- SCH
Change-Id: I0c3256b87686d878e4e716d12393cad5924fdfa1
|
|
|
|
|
|
|
|
| |
In ctrl_cmd_parse(), fix missing check for not parseable ctrl type.
Fixup for Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28.
Change-Id: I7f8055225e3ee04b2a723bae07b12c42618963a0
|
|
|
|
|
|
|
|
|
|
| |
Previously lapdm_datalink->entity->mode was dereferenced without
checking if correct entity is present. This might lead to
segfault. Check it explicitly before dereferencing, log error and
gracefully return if necessary.
Change-Id: I0361e3731e86712b415a370cab1128d611988f56
Related: OS#1898
|
|
|
|
| |
Change-Id: Ie38bae32372dc41e1902a8f6f0bc550ae515cfb8
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously *_REPLY and ERROR messages were not explicitly handled which
would lead to sending error in response to them which in turn would
prompt other party to send error as well which would result in infinite
cycle.
Handle it explicitly by logging message id and other relevant data.
Change-Id: Id96f3a2fc81fa4549f49556d83f062c6b2f59e28
Related: OS#1615
|
|
|
|
|
|
|
|
| |
Use value_string for enum ctrl_type instead of custom code. Add
corresponding unit tests.
Related: OS#1615
Change-Id: Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28
|
|
|
|
|
|
|
|
| |
* remove unused ctrl_interface_connect() which is not part of public API
* add default read callback to osmo_ctrl_conn_alloc()
Change-Id: Iaa209e34a849ce0dfe2e29b482c3208ade1a32a4
Related: OS#1615
|
|
|
|
|
|
|
| |
It is in the public header file and allows to easily bind it from
other languages (without having to go through the abstraction).
Change-Id: I0128d529c52ec030cfb87b0aff3c69cadf2c59d2
|
|
|
|
|
|
| |
it's osmo_sock_init_ofd(), not osmo_sock_init_ifd()
Change-Id: Ia6a82031a691403f641815862613d99b31a3a159
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add function for allocating CTRL connection to public headers and
replace call to previous static function with it. Add doxygen docs for
this function.
It's useful if we need to allocate ctrl connection but don't need to
bind to any interfaces: when we act as ctrl client.
Related: OS#1615
Change-Id: I522ed809cbebfd3d7dd08b4ed9137b39ff192e32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My recent logging patch was merged to master a bit too soon. Accomodate the
request for naming that matches the general "LOG" prefix instead of "LOGGING".
libosmocore will not be backwards-compatible with the few commits from
change-id I5c343630020f4b108099696fd96c2111614c8067 up to this one. This and
following commits are backwards compatible with those before that short window.
See also:
* openbsc change-id Ib2ec5e4884aa90f48051ee2f832af557aa525991
* osmo-pcu change-id I4db4a668f2be07f3d55f848d38d1b490d8a7a685
Change-Id: I424fe3f12ea620338902b2bb8230544bde3f1a93
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is too easy for calling code to use the same filter and context indexes for
different filters and structs. For example, openbsc's IMSI filter and libgb's
GPRS_BVC filter both fall on index 1 even though there are plenty more indexes
to choose from. To alleviate this, have one central definition here, sort of
like ports.h does for VTY and CTRL port numbers.
Add static asserts to make sure the indexes fit in the available array and bit
mask space.
Calling code like openbsc.git and osmo-pcu need adjustments and/or should move
to using these enum values instead of their local definitions.
Taking this opportunity to also prepare for a split of struct gsm_subscriber in
openbsc into bsc_subsciber and vlr_subscriber with appropriate separate filter
index constants for both subscriber types.
Include previous LOG_FILTER_ALL in the LOGGING_FILTER_* enum, and replace its
use by (1 << LOGGING_FILTER_ALL).
Change-Id: I5c343630020f4b108099696fd96c2111614c8067
|
|
|
|
|
| |
Related: OS#1593
Change-Id: If943731a78089f0aac3d55245de80596d01314a4
|
|
|
|
|
|
| |
The wrong expectation caused OsmoHLR to fail on Auth Sync.
Change-Id: I277fb3d407396dffa5c07a9c5454d87a415d393f
|
|
|
|
| |
Change-Id: Ie1d5881dda7a9b797d15e9e1eead8281a994d91e
|
|
|
|
|
|
|
| |
Setting the BVC log filter to NULL worked only if the NSVC filter was set,
use the proper constant instead.
Change-Id: Ic1cc268ed20700698c93d3ff8bf85cc0f01d3b1b
|
|
|
|
| |
Change-Id: Ic29b588b72893821d73fe90ecc16c6bf78d5a360
|
|
|
|
|
|
|
|
| |
This is particularly useful for hex dumps containing spaces found in a log
(e.g. osmo-nitb authentication rand token), which can now be passed in quotes
to osmo-auc-gen without having to edit the spaces away.
Change-Id: Ib7af07f674a2d26c8569acdee98835fb3e626c45
|
|
|
|
|
|
|
| |
socket.c still uses fprintf to output error messages. This commit
replaces the fprintf with proper LOGP messages.
Change-Id: Ia2993415d5f5c33ccd719af239ff59252d11b764
|
|
|
|
|
|
|
|
|
|
| |
This change makes the conv_gen application more interactive
and flexible, allowing to generate not only code definitions
but also the test vectors and header files in the future.
Moreover, it becomes possible to select exact code family,
such as GSM, GMR etc.
Change-Id: I0b476b00234c17f78b41d695cf3bfd13edb64c28
|
|
|
|
|
|
|
| |
FreeBSD 11.0 uses clang version 3.8.0 which spits various warnings
during libosmocore compilation. Let's clean this up a bit.
Change-Id: Ic14572e6970bd0b8916604fabf807f1608fa07e5
|
|
|
|
|
|
|
|
|
| |
in lapd_t200_cb() The RELEASE INDICATION is transmitted before
the MDL ERROR INIDCATION, this prevents the MDL ERROR INDICATION
from being sent because the RELASE INDICATION close to connection
eraly. This commit puts the messages into the correct order.
Change-Id: Iae74777138fc27828f511e3aa321d1981861f4a5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when the lapd core is in state LAPD_STATE_SABM_SENT, and the
retransmission counter exceeds (link down) lapd_t200_cb() will
send an RELASE_INDICATION and an MDL_ERROR_INDICATION to L3.
This action is done before the state is processed. This seems
to be no problem with standard retransmission counts (n200),
but may cause timing problems that lead to deadlock states when
custom timer configurations are in use. (Ericsson RBS).
This commit moves the functions calls for sending the indications
mentioned above to the very end of the if branch to relax the
timing again. (See lapd_t200_cb())
Change-Id: I1c1beb3701b19744a3ce9946abca7767d20a0b6a
|
|
|
|
|
|
|
|
|
|
|
|
| |
osmo_fd_register() is used to register socket file descriptors,
after registering a socket, there is no way to test if the socket
is still registered or actually registered at all.
This commit adds a new function osmo_fd_register_check() that can
be used to check in advance, if the socket fd is registered,
before performing further operations.
Change-Id: I48ec7098d6bba586c81bf0d5c9088108e2c081c6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
milenage_gen_vec() has parameter ordering of (..., auts, rand_auts, rand).
osmo_auth_gen_vec_auts() has (..., rand_auts, auts, rand), but actually feeds
args in the same order, so that its rand_auts becomes auts, and its auts
becomes rand_auts.
Interestingly enough, API user osmo-gen-vec.c also adheres to this misordering
and in turn passes auts for osmo_auth_gen_vec_auts()'s rand_auts and vice
versa, so that it matches milenage_gen_vec().
So both the implementation (milenage_*) and the API user use the same ordering,
just osmo_auth_gen_vec_auts() and osmo_auth_impl{ .gen_vec_auts() } in-between
have the argument names swapped.
Any current user of this API would need to adhere to this swapping or will not
get successful AUTS resolution to a SQN. So the least impact fix is to rename
the args without any actual functional change.
So swap the names rand_auts and auts for osmo_auth_gen_vec_auts() and
osmo_auth_impl{ .gen_vec_auts() }. (Also adjust API doc ordering)
Change-Id: I0dcbd49759fc32d3b8974102dbd1d6703364ebf4
|
|
|
|
|
|
|
|
|
| |
The debug output of lapd core has no references to the dl objects,
since we have multiple links, seeing which action is for which
object is impossible. This commit adds pointer references (dl=%p)
to each log line.
Change-Id: I3024d1cbd58631e2abac4ce5822528e2e6e15fda
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GSUP transmits AUTS for UMTS authentication procedures, and OAP uses the same
procedures to authenticate. osmo-gen-vec is a utility program that passes AUTS
to our osmo_auth_gen_vec_auts() API.
According to 3GPP 33.102 6.3.3, AUTS = SQN^AK || MAC-S, which are 6 || 8 == 14
bytes. This is confirmed by 24.008 9.2.3a where the TLV has 16 bytes, TL = 2
and AUTS being the V = 14.
It is not harmful for milenage_gen_vec_auts() to pass two more AUTS bytes. But
writing 16 bytes to a GSUP struct is a potential problem when passing in a 14
byte long AUTS buffer to the GSUP API, which then reads past the AUTS buffer.
The API implies the length, so far to be 16, so passing in a 14 byte buffer to
GSUP would require copying to a larger buffer first.
Fix this by using a length of 14 for AUTS everywhere instead.
This constitues an ABI breakage, we may handle it as a "fix before an official
release", otherwise we need a version bump.
The OAP protocol document has also been updated, needs an update in the
osmo-gsm-manuals as well.
Change-Id: If25b173d9ec57ea4c504d860954912b7d82af455
|
|
|
|
|
|
|
| |
Using this function, one can obtain a human-readable string identifying
the host and port names of the socket.
Change-Id: Ib5de5c7b9effe1b0a363e4473a7be7fa38ca6ef3
|
|
|
|
|
|
|
| |
Add special cause for alerts produced by external processes.
Change-Id: Idd7ee085321f8172c72ecfdba320186049f4d988
Related: OS#1615
|
|
|
|
|
|
|
|
|
|
|
|
| |
A DSO should link to the libraries that it is using. Linking to
libtalloc will resolve these warnings:
Change-Id: I4c8d5e80e194b9d9b4fa2424c4a22377ecee9c7a
dpkg-shlibdeps: warning: symbol _talloc_zero used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries
dpkg-shlibdeps: warning: symbol _talloc_free used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries
dpkg-shlibdeps: warning: symbol talloc_strndup used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries
dpkg-shlibdeps: warning: symbol talloc_strdup used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries
dpkg-shlibdeps: warning: symbol _talloc_memdup used by debian/libosmosim0/usr/lib/i386-linux-gnu/libosmosim.so.0.0.0 found in none of the libraries
|
|
|
|
| |
Change-Id: I69f2891a2bea6f87f079b6778aa01ee27a25001b
|
|
|
|
|
|
|
| |
We don't have file-based I/O nor ethernet devices with mac addresses
when building for OsmocomBB.
Change-Id: I01a9e6d8dbe885dbeac2769b84931a4d44f7a3a5
|
|
|
|
| |
Change-Id: If56b521429af497ddd5a47170eb2c085b1fb78ba
|
|
|
|
|
|
|
| |
osmo_strlcpy() was excluded from the group because the closing brace was above
it.
Change-Id: I6701261f5854342ac4cd4f2da62e49eb40362938
|