| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Adds a value_string array for GSM 04.08 Call Control
cause values
Change-Id: I296f208581ce2550805f9d96e20f7319e1199023
|
|
|
|
|
|
|
|
|
| |
In osmo_sock_unix_init(), add support for non-NUL-terminated unix
socket paths and return an error if the supplied socket path exceeds
the maximum socket path length supported by the operating system.
Change-Id: I19d935e5e3dd7928e6e153c6f5ad7044de726016
Related: OS#2673
|
|
|
|
|
|
|
|
|
|
|
| |
The cell identifier list parameter is mandatory. Document it as
such, and tweak code which treated it like an optional parameter.
No functional change. The existing code already asserts that
a non-NULL value is passed for this parameter.
Change-Id: I3716f9d5b210e0a7e6f45c9fe3fc34024e5234ad
Related: OS#3021
|
|
|
|
| |
Change-Id: I9e128ba775227de5e4010f024338a78584f777ea
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow printing the source file information *after* the log information.
Add target->print_filename_pos, log_set_print_filename_pos() and enum
log_filename_pos, and the optional 'last' keyword to the 'logging print file'
vty command. (An enum in case we want to add other positions later.)
Rationale: on log lines, the logging context is usually printed first in the
logging text. Without the source file information, this logging context pretty
much aligns in an easily readable way. When adding the source file information,
each line's logging context info is shifted right by a pretty much random
amount and it is hard to spot recurring logging contexts.
One solution is to switch off source file info, of course, but that's not an
option when actively hacking on bugs and new features.
For example, it is unnecessarily hard to spot lchan FSM related log lines in
this osmo-bsc log snippet:
DRSL NOTICE mgw_endpoint_fsm.c:603 mgw-endpoint(conn0){WAIT_MGW_RESPONSE}: Freeing instance
DRSL NOTICE fsm.c:381 mgw-endpoint(conn0){WAIT_MGW_RESPONSE}: Deallocated
DMSC NOTICE mgw_endpoint_fsm.c:603 SUBSCR_CONN(conn0){CLEARING}: Received Event FORGET_MGW_ENDPOINT
DCHAN DEBUG lchan_rtp_fsm.c:741 lchan(0-0-1-TCH_F-0){WAIT_RLL_RTP_ESTABLISH}: Received Event LCHAN_EV_RTP_RELEASED
DCHAN DEBUG lchan_rtp_fsm.c:520 lchan_rtp(0-0-1-TCH_F-0){ROLLBACK}: Freeing instance
DCHAN DEBUG fsm.c:381 lchan_rtp(0-0-1-TCH_F-0){ROLLBACK}: Deallocated
DCHAN DEBUG lchan_rtp_fsm.c:520 lchan(0-0-1-TCH_F-0){WAIT_RLL_RTP_ESTABLISH}: Received Event LCHAN_EV_RTP_RELEASED
DCHAN DEBUG lchan_fsm.c:1232 lchan(0-0-1-TCH_F-0){WAIT_RLL_RTP_ESTABLISH}: state_chg to WAIT_RF_RELEASE_ACK
DRSL NOTICE handover_fsm.c:762 handover(interBSCin_conn0){WAIT_RR_HO_DETECT}: Terminating (cause = OSMO_FSM_TERM_REGULAR)
DRSL NOTICE handover_fsm.c:762 handover(interBSCin_conn0){WAIT_RR_HO_DETECT}: Freeing instance
DRSL NOTICE fsm.c:381 handover(interBSCin_conn0){WAIT_RR_HO_DETECT}: Deallocated
DCHAN DEBUG lchan_fsm.c:1196 lchan(0-0-1-TCH_F-0){WAIT_RF_RELEASE_ACK}: state_chg to BORKEN
DCHAN DEBUG lchan_fsm.c:354 lchan(0-0-1-TCH_F-0){BORKEN}: (type=TCH_F) Clearing lchan state
DLMGCP DEBUG mgcp_client.c:741 Tx MGCP msg to MGCP GW: 'DLCX 3 2@mgw MGCP 1.0'
DLMGCP DEBUG mgcp_client.c:743 Sending msg to MGCP GW size: 66
DRLL NOTICE mgcp_client_fsm.c:422 MGCP_CONN(to-BTS){ST_DLCX_RESP}: Received Event EV_DLCX_RESP
Placing the source file info behind the log text makes it much easier to
follow, while the source file info is still available:
DRSL NOTICE mgw-endpoint(conn0){WAIT_MGW_RESPONSE}: Freeing instance (mgw_endpoint_fsm.c:603)
DRSL NOTICE mgw-endpoint(conn0){WAIT_MGW_RESPONSE}: Deallocated (fsm.c:381)
DMSC NOTICE SUBSCR_CONN(conn0){CLEARING}: Received Event FORGET_MGW_ENDPOINT (mgw_endpoint_fsm.c:603)
DCHAN DEBUG lchan(0-0-1-TCH_F-0){WAIT_RLL_RTP_ESTABLISH}: Received Event LCHAN_EV_RTP_RELEASED (lchan_rtp_fsm.c:741)
DCHAN DEBUG lchan_rtp(0-0-1-TCH_F-0){ROLLBACK}: Freeing instance (lchan_rtp_fsm.c:520)
DCHAN DEBUG lchan_rtp(0-0-1-TCH_F-0){ROLLBACK}: Deallocated (fsm.c:381)
DCHAN DEBUG lchan(0-0-1-TCH_F-0){WAIT_RLL_RTP_ESTABLISH}: Received Event LCHAN_EV_RTP_RELEASED (lchan_rtp_fsm.c:520)
DCHAN DEBUG lchan(0-0-1-TCH_F-0){WAIT_RLL_RTP_ESTABLISH}: state_chg to WAIT_RF_RELEASE_ACK (lchan_fsm.c:1232)
DRSL NOTICE handover(interBSCin_conn0){WAIT_RR_HO_DETECT}: Terminating (cause = OSMO_FSM_TERM_REGULAR) (handover_fsm.c:745)
DRSL NOTICE handover(interBSCin_conn0){WAIT_RR_HO_DETECT}: Freeing instance (handover_fsm.c:745)
DRSL NOTICE handover(interBSCin_conn0){WAIT_RR_HO_DETECT}: Deallocated (fsm.c:381)
DCHAN DEBUG lchan(0-0-1-TCH_F-0){WAIT_RF_RELEASE_ACK}: state_chg to BORKEN (lchan_fsm.c:1196)
DCHAN DEBUG lchan(0-0-1-TCH_F-0){BORKEN}: (type=TCH_F) Clearing lchan state (lchan_fsm.c:354)
DLMGCP DEBUG Tx MGCP msg to MGCP GW: 'DLCX 3 12@mgw MGCP 1.0' (mgcp_client.c:741)
DLMGCP DEBUG Sending msg to MGCP GW size: 67 (mgcp_client.c:743)
DRLL NOTICE MGCP_CONN(to-BTS){ST_DLCX_RESP}: Received Event EV_DLCX_RESP (mgcp_client_fsm.c:422)
Implementation: for 'last', insert source file info only when an '\n' is found
at the end of the log line composition buffer, so that LOGP()...LOGPC()
constructs also print source file info only when a log line actually ends.
Change-Id: I393907b3c9e0cc1145e102328adad0a83ee13a9f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When gsmtap adding a new sink it does not supply OSMO_SOCK_F_UDP_REUSEADDR
in order to have SO_REUSEADDR applied. In most cases, the gsmtap sink is
just receiving packets to toss them immediately, so having one of them
is sufficient. However, in other use cases - particularly virt_phy -
we actually want to receve and process GSMTAP messages via multicast
Applying SO_REUSEADDR (like we did before disabling it globally for UDP
in I4a8ffb8d598aca88801a4a0322944d7cdd8d4047 on August 1st) resolves
the issue.
Change-Id: I1399a428467ca12f1564a14eb8ffb294d4f59874
Related: OS#3497
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When IPPROTO_UDP is used then SO_REUSEADDR omitted since UDP is
connection less we do not have to wait until lingering connections time
out. There were also negative effects such as that two applicatications
could use the same UDP port, normally one of the two applications would
get an error, but with SO_REUSEADDR this is supressed. However, there
are applications (UDP MULTICAST) where two applications must be able to
use the same port. In the osmocom project those are osmo-bts-virtual,
virtphy and gsmtap in general.
Lets introduce a flag that the API user can supply in order to have
SO_REUSEADDR applied.
- Add new flag OSMO_SOCK_F_UDP_REUSEADDR
Change-Id: I94aaf6d5224ab23bde5ea5c4a83569b6145ab32b
Related: OS#3497
|
|
|
|
| |
Change-Id: Ie81e9dd9f9936a414e7cebb2bccffa6f42a302a7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The intention was to use the file's basename, but __BASE_FILE__ means "the root
file that is being parsed and contains #include statements".
If we had a function using __BASE_FILE__ and that was defined in an #included
file, __BASE_FILE__ would indicate the first file where the #include is, and
not the file where the function is defined. __BASE_FILE__ works for us because
we don't ever include function definitions that log something, so __BASE_FILE__
always coincides with __FILE__ for our logging; but still __BASE_FILE__ is
semantically the wrong constant.
Related: OS#2740
Change-Id: Ibc1d3746f1876ac42d6b1faf0e5f83bd2283cdcc
|
|
|
|
|
|
|
| |
Setting age to 5 is cleary an error, it should be increment by one
instead as APIs were added 0.11->0.12 and none modified or removed.
Change-Id: I3b3bc808349bc2f949ef9eef64f39e7202ddf946
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise applications need to use "extern void* tall_sigh_ctx" and set
it manually (that symbol is not exported in any header file) or end up
allocating struct signal_handler into the NULL talloc ctx.
API created in a similar way as already existing msgb_talloc_ctx_init(),
but without the pool_size because it's not considered necessary in this
case.
Change-Id: Id58ca18eb826b8f4183a7cf0dbb2b38cba702a09
|
|
|
|
|
|
|
|
|
|
|
|
| |
To reset the state of BSSGP allow to flush the BSSGP queues.
When testing (with TTCN3) the test object should be resetted between
each test.
Introduce the functions:
bssgp_fc_flush_queue() - flushs a single flow control object
bssgp_flush_all_queues() - flushs queues of all BSSGP connections
Change-Id: I29b6ad6742ddf9b0b58b4af37d9a1cf18e019325
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was gsm0480_l3hdr_push() declared in a header file, but
not exposed in 'libosmogsm.map'. Furthermore, for some reason
it was a part of GSM 04.80 API, what is not actually correct.
Let's rename this symbol, and properly expose it as a part of
the GSM 04.08 API. Also, let's introduce an auxiliary wrapper
for messages, where the transaction identifier is required
(see GSM 04.07, section 11.2.3.1.2).
Change-Id: I8a045efe8335d83fcbe8d43eb180972e3b1d9dda
|
|
|
|
| |
Change-Id: I23b4b0e1c237b9b27c1db1c9a824b5329d41a38b
|
|
|
|
| |
Change-Id: I444d95941837458b46e581298f76f3a9926c8552
|
|
|
|
|
|
|
|
|
|
|
| |
the vty_config_write function should write:
line vty
login
to the configuration file when the login is enabled. Otherwise after
saving the configuration the next login will be performed without
password checking (password_check variable will be 0 though it must be 1)
Change-Id: I39050b6bf617dac10d3fccc3106f67bdcca1d05a
|
|
|
|
|
|
|
| |
I was contacted by the (previously unknown) author who provided
the new location of the original code.
Change-Id: I2dabab20ad018ce473817986bdb250131c010bf1
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When UDP is used as protocol (proto=IPPROTO_DUP), then we should not set
SO_REUSEADDR in the socket option. Because if we do, we allow two
processes to bind on the same UDP port. The errornous situation will be
undetectable to both applications. So lets only set SO_REUSEADDR when we
do not use UDP.
- Add check if we use UDP, if yes do not set SO_REUSEADDR
Change-Id: I4a8ffb8d598aca88801a4a0322944d7cdd8d4047
Related: OS#3441
|
|
|
|
|
|
|
|
|
|
| |
the return code of the last setsockopt() call in osmo_sock_init() is not
checked. Since all other calls to setsockopt are checked, lets check
this one as well.
- check return code of setsockopt() and close the socket on failure
Change-Id: I96dbccc3bcff35bf39979dbe0c44aadc8ce20c83
|
|
|
|
|
|
|
|
|
| |
In the previous commit we deprecated ipa_ccm_idtag_parse() but
also removed ipa_ccm_idtag_parse_off(), for which I couldn't find
any users. However, legacy openbsc.git still uses this function,
so let's re-introiduce it in its original form.
Change-Id: Ibfe53b04340eb355c8bfb8453a2af1522a4b6baf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the past, the function ipa_ccm_idtag_parse() was used to parse
the payload of IPA CCM ID RESP packets. However, the function was
based on a possible misunderstanding of the message encoding, and
callers actually counted the first (upper) length nibble as part
of the header and passed a pointer to the second
(lower) length nibble of the first TLV into this function. As such,
it was unfixable, and had to be replaced with a new function called
ipa_ccm_id_resp_parse(). At the same time, we also add
ipa_ccm_id_get_parse() to parse the slightly different format of
the IPA CCM ID GET payload.
We can never be 100% sure what is "correct", as our understanding
of the protocol is entirely based on protocol analysis, without any
official documentation available.
This patch also introduces unit test coverage for both of the new
functions.
Revert "ipa: Add libosmogsm.map entry for ipa_ccm_idtag_parse_off"
This reverts commit 7f31c90b80c08fbfe2d84d70d397402fdb38b94c.
Revert "ipa: Properly parse LV stream of a ID_GET request"
This reverts commit f558ed4bb9c0f00997b8f97c2b251a574c1a64c4.
It introduced a function/behavior that was not originally intended:
The parse of IPA CCM ID GET (8bit length followed by 1 byte tag
and variable-length payload) instead of the IPA CCM ID RESP (16bit
length followed by 1 byte tag and variable-length payload).
Change-Id: I1834d90fbcdbfcb05f5b8cfe39bfe9543737ef8f
|
|
|
|
|
|
|
|
| |
As we're moving this to a common/shared library now, we need to use
the osmo_ namespace prefix for symbol names, struct/type names and
constants.
Change-Id: Ie36729996abd30b84d1c30a09f62ebc6a9794950
|
|
|
|
|
|
|
|
|
| |
This imports the code from osmo-msc 6afef893e17bce67e4d4119acd34d480ed03ba77
with minimal changes to make it compile. Symbol renaming to osmo_
prefix is done separately in a follow-up patch to have a as-clean-as-possible
import first.
Change-Id: I9bc38102318da02d1fe46ef516df3cfd6bf8e3da
|
|
|
|
| |
Change-Id: I160728544c0effe45757df22f1ff2314fcb13dd1
|
|
|
|
|
|
|
| |
Add functions to generate TS 04.80 (supplementary services)
Reject and ReturnError components.
Change-Id: I6e5ee39c3d03364f7833ec717593d5ddb0a4c5f9
|
|
|
|
|
|
|
|
|
|
| |
Contrary to the existing gsm0480_create_ussd_resp(), the new function
only generates the value part of the FACILITY IE, and not the IE
Tag/Length or the 04.08 L3 header. This is needed in the context of
GSUP-encapsulated USSD, as here we don't work with L3 messages, but
only pass on the FACILITY IE value.
Change-Id: Ide240279240322f643e142229eb7829f538c6314
|
|
|
|
| |
Change-Id: If25b467481023eadaaf3f78157eceff4b81d24d2
|
|
|
|
|
|
|
| |
Fixes crashes when using vty `show fsm-instances all`
when fsm children are present.
Change-Id: I4ae0bee7f7f57ec6675cfb52ca6cf0d523d15362
|
|
|
|
| |
Change-Id: Iddf36d26b23dcef4f9b291fd7ead1907e38c3486
|
|
|
|
| |
Change-Id: I423a24c55c9b9aa6fc8f501df94fe54c71ee2b2b
|
|
|
|
| |
Change-Id: I7e66432f37e13fd4c31389e3d89593fa0981e58f
|
|
|
|
| |
Change-Id: I943763e175dca6f3078923a494b052319b78574d
|
|
|
|
|
|
|
|
|
| |
Since we ignore "logging level CAT everything" in logging_level_cmd, we
can never run into the case in which we have loglevel==EVERYTHING, so we
can simplify this code and make it esier for later removal of everything
keyword.
Change-Id: I4e76c65a11cc22616c6dfc632435617ebb861c03
|
|
|
|
| |
Change-Id: I7aca0ce3d2981001e8081f7cee0dea3e2aaf8f7c
|
|
|
|
|
|
|
|
| |
The statsd protocol use ':' as seperator between name and value.
It's not allowed to use the seperator in a name. Replace ':' with '.'
before sending the packet to the statsd server.
Change-Id: Ib46d08481e8ca04afd97cb9ae241e4e39c91ad66
|
|
|
|
| |
Change-Id: Ie37be744abd8c47211d64877bcd17f94465bd423
|
|
|
|
|
|
|
| |
Previous logic regarding logging of verification and mangling of
rate_ctr groups made it difficult to debug when an issue occurrs.
Change-Id: I992d165cab5ee6ca9b5b7e4a2210a0951954bd34
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As stated in its own documentation, reduce_xmaxcr_all() should only
return true when ALL XMAXC fields return true. However, previous
implementation returned true when at least one of them returned true.
As a result, if any of the sections is silent (for instance because one
of the bursts was lost), the whole frame is silenced, returning a zeroed buffer.
Related: OS#2700
Fixes: 40def49ac4b8babbd1b17c232137ce50a428706b ("libosmocodec: implement ECU (Error Concealment Unit) for FR")
Change-Id: I1624b7c6574f53d0593a61645d4fdc5d56cabe96
|
|
|
|
|
|
|
| |
valgrind complains about using unitialised bytes in syscalls.
I could imagine this happens when tcgetattr fails to set termios.
Change-Id: I9d165911fa3127afa8f836fa5c5c2e14a949474a
|
|
|
|
|
|
|
|
|
| |
This came from osmo-bsc refactoring patch I82e3f918295daa83274a4cf803f046979f284366
https://gerrit.osmocom.org/#/c/osmo-bsc/+/9671/6/src/osmo-bsc/gsm_data.c@1708
Add regression test in utils_test.c.
Change-Id: I1f2918418c38918c5ac70acaa51a47adfca12b5e
|
|
|
|
| |
Change-Id: I7d6c61e6a1b5d1fae26f385b420ff55246c4b62f
|
|
|
|
| |
Change-Id: I396fd1e7548beea31b2b7aa9f764edb765b02941
|
|
|
|
|
|
|
|
|
| |
Callers require to know whether the returned ERROR cmd was received or
generated locally, in order to send it or do something with it locally.
Related: OS#3394
Change-Id: Ide9170e5c31967c353f8fe4e8227e64130b91eae
|
|
|
|
| |
Change-Id: I6ca873b3decaf50e7b79b5ab2269919c862a4fe0
|
|
|
|
|
|
|
|
| |
Previously we didn't take into account puncturing and BER was always around
30% for GPRS/EDGE bursts because of they use puncturing coding unlike
"classical" GSM bursts.
Change-Id: I9da22e7051522d06d923fcec3b63cbed8db93910
|
|
|
|
| |
Change-Id: Iadf6460c438d02c53c2eaa9e42d51844ad28859a
|
|
|
|
|
|
|
|
|
|
|
| |
Our implementation generates ERROR CTRL messages with ID=error when it
is unable to parse a CMD. However, it doesn't account for them when
trying to receive and parse this kind of message. As a result, it will
return an ERROR message with a different description. This commit fixes
the old behaviour to success at parsing and returning the received
description to the caller.
Change-Id: I564ab1a7e845388f87accda44fbf165e5adc2480
|
|
|
|
| |
Change-Id: Ia890d4b841ef02342cc1cf7f5926866b040dc8ab
|
|
|
|
|
|
|
| |
enum gsm0808_permitted_speech does not have any value strings. Lets
add value strings to make debugging easier.
Change-Id: I5b5612a5df2758b0137a34c17f7c8c2b3f07c806
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vty_test: add test against ambiguous cmd causing use-after-free and memory
leaks. Add this test along with the fix, because the new test triggers the
memory use-after-free and leaks, causing build failures.
Add cmd_deopt_with_ctx() to allow passing a specific talloc ctx.
is_cmd_ambiguous(): keep all cmd_deopt() allocations until the function exits.
Add a comment explaining why. Before this, if a command matched an optional
"[arg]" with square brackets, we would keep it in local var 'matched', but we
would free the string it points to at the end of that loop iteration; upon
encountering another match, we would attempt to strcmp against the freed
'matched'. Instead of adding hard-to-read and -verify free/alloc dances to keep
the 'matched' accurately freed/non-freed/..., just keep all cmd_deopt() string
allocated until done.
Needless to say that this should have been implemented on a lower level upon
inventing optional args, but at least this is fixing a program crash.
Related: OS#33903390
Change-Id: Ia71ba742108b5ff020997bfb612ad5eb30d04fcd
|