| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Change-Id: If9a6ecc4d6e2beaf716569e9a6053d73488e860b
|
|
|
|
|
|
|
|
| |
Use value_string for enum ctrl_type instead of custom code. Add
corresponding unit tests.
Related: OS#1615
Change-Id: Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28
|
|
|
|
|
|
| |
See OS#1958
Change-Id: I85aee0f8fdfc9c69d0ba9240988c633d3e707f2d
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ic459b04219abe70171c8f80ed09df53d412dcfb2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 812ba6dc63a75c39678dd3fe652768e76bf63183
"logging: centrally define ctx and filter indexes"
Removed definitions, which causes older e.g. openbsc and osmo-pcu code trees to
fail to build against a newer libosmocore. Re-introduce the legacy definitions
to redirect to the new ones and re-establish backwards compatibility.
The GPRS_* constants used to be defined in gprs_msgb.h, but since that header
also includes logging.h, rather place the legacy shims in logging.h next to the
other ones.
Change-Id: I455bb1bb474d758af0fd5b6397f7e57260ad739d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Ic29b588b72893821d73fe90ecc16c6bf78d5a360
|
|
|
|
|
| |
Change-Id: I1328c89ec8e908bf4b4d2c0a398690278369e0f5
Related: OS#1645
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
According to 3GPP TS 24.008 9.2.3a, 9.2.3, 10.5.3.6
Change-Id: I745061ce8eb88aa23080dadcdbfe2d703c362a30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
It is still too easy to forget syncing, so add another reminder at the end
of the list.
Change-Id: I95191906afa8e6ada31310d0e36de33e3fccf268
|
|
|
|
| |
Change-Id: I08cb52d9399a27e6876e45da36f434708c4fddef
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I911c7f4bcadde414ce0b384e13a3a9a4a953e2fb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After subchan_demux.c in libosmo-abis, osmo-bts/common/vty.c and openbsc's
gtphub_test.c, more places would like to count the llist items (mostly unit
tests). Instead of proliferating numerous local implementations, add here.
NOTE: other than the previous llist_len() implementations, this one returns an
*unsigned* length, which might need some adjusting of current callers.
Call this llist_count() rather than llist_len() to highlight the fact that this
is actively iterating. This also avoids a potential naming conflict when
library versions mismatch.
Change-Id: Ic49adc7a346f5722bf624d7d3b4a735e4220ae15
|
|
|
|
|
|
|
|
| |
* make DEBUGP* macro into simple wrappers around LOGP*
* deprecate unused logp() function
Related: OS#71
Change-Id: Ia6c92bd4824c44fc22cc733ce7a88da86e58ed93
|
|
|
|
|
|
|
|
|
| |
Similar to CTRL_CMD_DEFINE_RO() add helper for control commands which
are not meant to be read, only to set. Similarly, add
CTRL_CMD_DEFINE_WO_NOVRF() for commands which do not perform inbound
data verification.
Change-Id: I66b7990db590c1f8e56326e392e6c1d2eafebd9a
|
|
|
|
|
|
| |
uint32_t may or may not be unsigned int.
Change-Id: I21c96985fcbb72372b6df949301c21f1ebca41f2
|
|
|
|
|
|
| |
In EMBEDDED builds we don't have a system-wide talloc
Change-Id: Icc526016bda45b36e584afee8669996752d6d89c
|
|
|
|
|
|
|
|
|
| |
It accept fixed number of arguments including va_list instead of variable
number of arguments in abis_nm_fail_evt_rep() - similar to vprintff() vs
printf().
Related: OS#1615
Change-Id: Ib293dec1c2de9b664584a8456c782ea7b6dd8555
|
|
|
|
|
|
|
|
| |
Add string representation of Probable Cause Type from 3GPP TS 12.21 §
9.4.43.
Change-Id: I9fe14ed3b5398f59dd06a509e4d419e074cc20a7
Related: OS#1615
|
|
|
|
|
|
|
| |
This adds a definition for wrapping Qualcomm DIAG frames into GSMTAP for
transporting them over an IP network.
Change-Id: I1b357b7d11a370685671c7b01e55f4f36dec2f25
|
|
|
|
| |
Change-Id: I89212e4f149f019099115a85bab353c04170df90
|
|
|
|
|
|
|
| |
This addresses a FIXME in the fsm.c code: osmo_fsm_register() should
fail in case a FSM with the given name already exists.
Change-Id: I5fd882939859c79581eba70c14cbafd64560b583
|
|
|
|
|
|
|
|
| |
Add 3GPP TS 12.21 § 8.8.2 Failure Event Report function which pack given
vararg string and parameters into msgb.
Change-Id: I58c198d8ea588432c62520928b08f0b2a7035e93
Related: OS#1615
|
|
|
|
|
|
|
|
| |
Add human-readable descriptions to event causes from 3GPP TS 12.21 §
9.4.43.
Change-Id: Id173c978616c98b7831fbafb5401064257f1cf73
Related: OS#1615
|
|
|
|
|
|
|
|
|
| |
Function bitvec_rl_curbit added to get number of uninterrupted
bits run in vector starting from the current bit till max number
of bits.
Test case is added to check bitvec_rl_curbit.
Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26
|
|
|
|
|
|
|
|
|
|
| |
Add 3GPP TS 12.21 §9.4.43 Probable Cause values of type 03 (Manufacturer
specific values).
Max's note: renamed to make it clear that values are vendor-specific.
Related: OS#1615
Change-Id: Ie9ba4b53fb19a151447aec9ea309284e20613585
|
|
|
|
|
|
| |
Add functions to copy and merge parsed TLV structures from OsmoBTS.
Change-Id: Ieaaaed19da9c069fe451faa53d24c5b84d7d5615
|
|
|
|
|
| |
Change-Id: I9c3bc15662949654e7bba6aad5488c69ee7d0c45
Related: OS#1615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
osmo_fsm_inst_term() has code for safe child removal, publish that part as
osmo_fsm_inst_term_children(); also use from osmo_fsm_inst_term().
As with osmo_fsm_inst_term(), add osmo_fsm_inst_term_children() macro to pass
the caller's source file and line to new _osmo_fsm_inst_term_children().
Rationale: in openbsc's VLR, I want to discard child FSMs when certain events
are handled. I could keep a pointer to each one, or simply iterate all
children, making the code a lot simpler in some places.
(Unfortunately, the patch may be displayed subobtimally. This really only moves
the children-loop to a new function, replaces it with a call to
_osmo_fsm_inst_term_children(fi, OSMO_FSM_TERM_PARENT, NULL, file, line) and
drops two local iterator variables. No other code changes are made, even though
the diff may show large removal + addition chunks)
Change-Id: I8dac1206259cbd251660f793ad023aaa1dc705a2
|
|
|
|
|
|
|
|
|
|
|
| |
LOGPFSM and LOGPFSML are in the header file, put the *SRC variants also there
so users of the osmo_fsm_inst API may conveniently create own functions that
log the caller's source file and line.
Very useful if many action functions call the same event dispatching function,
like foo_fsm_done(), and one needs to know which of the callers to debug.
Change-Id: I39447b1d15237b28f88d8c5f08d82c764679dc80
|
|
|
|
|
|
| |
Use the implementation from Linux lib/crc-ccitt.c (GPLv2)
Change-Id: I26bb54038f5ab36bbb34da7f5fb8ae6c0c0386a4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OSMO_STRINGIFY particularly allows putting port numbers from a #define into VTY
doc strings, like:
#define FOO_PORT 2342
DEFUN(...,
"Foo UDP port (default: " OSMO_STRINGIFY(FOO_PORT) ")\n")
OSMO_VALUE_STRING creates value_string items with the string being exactly the
enum value's name. Replaces a similar macro def in fsm.c
Change-Id: I857af45ae602bb9a647ba26cf8b0d1b23403b54c
|
|
|
|
| |
Change-Id: I5c57e35b29d50cb409becada6b9b120ce5210ae0
|
|
|
|
| |
Change-Id: Iaf63d3cadb0d46bf454e3314ebb439240cafd834
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When looking at log output, it is not interesting to see that a state
transition's petty details are implemented in fsm.c. Rather log the *caller's*
source file and line that caused an event, state change and cascading events.
To that end, introduce LOGPSRC() absorbing the guts of LOGP(), to be able to
explicitly pass the source file and line information.
Prepend an underscore to the function names of osmo_fsm_inst_state_chg(),
osmo_fsm_inst_dispatch() and osmo_fsm_inst_term(), and add file and line
arguments to them. Provide the previous names as macros that insert the
caller's __BASE_FILE__ and __LINE__ constants for the new arguments. Hence no
calling code needs to be changed.
In fsm.c, add LOGPFSMSRC to call LOGPSRC, and add LOGPFSMLSRC, and use them in
above _osmo_fsm_inst_* functions.
In addition, in _osmo_fsm_inst_term(), pass the caller's source file and line
on to nested event dispatches, so showing where a cascade originated from.
Change-Id: Iae72aba7bbf99e19dd584ccabea5867210650dcd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide one central LOGPFSML to print FSM information, take the FSM logging
subsystem from the FSM instance but use an explicitly provided log level
instead of the FSM's default level.
Use to replace some, essentially, duplications of the LOGPFSM macro.
In effect, the fsm_test's expected error changes, since the previous code dup
for logging events used round braces to indicate the fi's state, while the
central macro uses curly braces.
Change-Id: If295fdabb3f31a0fd9490d1e0df57794c75ae547
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the process, also:
* Change the license from AGPLv3 to GPLv2-or-later;
* correct spelling of 'sysmocom' to lowercase;
* add '2016' to the copyright;
* rename to osmo_*;
* add API docs;
* add logging category DLOAP: define id and add to internal_cat;
* redirect all oap.c logging to DLOAP.
A unit test will follow in a subsequent patch, since it needs a minor tweak for
decoding of boolean values.
The related openbsc change-id is I2f06aaa6eb54eafa860cfed8e72e41d82ff1c4cf.
Tweaked-by: Neels Hofmeyr
Change-Id: If5099e60681a215e798b6675f21813f26769c253
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All DL* categories are typically negative, but DLGSUP isn't, and it's also not
in libosmocore's internal_cat array.
See: 3b6fb0880c3ab1e23a3d7d738d073b00c2a794c2
This means that a program using DLGSUP has to include DLGSUP in its own logging
cat array (typically not needed for DL* categories), which means for osmo-nitb
that DLGSUP (11) replaces DMGCP (also 11), and DMGCP becomes unusable.
Fix this: make DLGSUP -11 and include in internal_cat.
In gsup_test.c, no longer add DLGSUP to the logging categories array.
External follow-ups are otherwise needed only in osmo-hlr.git and some pending
patches for openbsc (Id3938267fa062e1a997d3704cd678874306f86ee).
Change-Id: Id974c7be158e4d60421a98110f5c807aefd31119
|
|
|
|
|
|
|
| |
This target wraps the to-be-logged string (With metadata) into a GSMTAP
packet and sends it to the configured destination address.
Change-Id: I9a7e72b8c9c6f6f2d76d1ea2332dcdee12394625
|
|
|
|
|
|
|
|
|
|
|
| |
Often it is useful to have log statements from the osmocom programs
synchronized with protocol traces. So rather than having to open the
pcap file with GSMTAP or other protocol data side-by-side with the
textual log of one or more network elements, we simply pass the log
lines around as GSMTAP messages, which can then be displayed in-order
and interspersed with the protocol messages inside wireshark.
Change-Id: I33ab530e10ef0311b6f80b731e61894f20b4b3e7
|
|
|
|
|
|
|
|
| |
The G used to mean GPRS, but the scope is larger now. To satisfy the curious
reader, give the G a name in gsup files' header comments. BTW, logging.h and
gsup_test.c already mentioned "Generic" before this.
Change-Id: I6ac5cf94c215e156ceff6a58da3d9e520ca942d9
|
|
|
|
|
|
|
|
|
| |
The copyright in gsup.h differed from the one in gsup.c: gsup.c names the GNU
Affero GPL, gsup.h only the GNU GPL. Change both to GPL-v2-or-later.
In gsup.c/h's copyright notice, 'sysmocom' should be spelled lower case.
Change-Id: Ia5748c275501889b9086aef7d20ccb5c9edb8031
|