| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
When log_set_use_color() is enabled, color the log level string according to
the log level. The log line before and after the log level is printed in the
category's color.
ERROR and FATAL are red, NOTICE is yellow, INFO is green and DEBUG is blue.
The default behavior remains unchanged.
Change-Id: If2e52ae9ab83e538e04321c338e3fdffb2c7f9d3
|
|
|
|
|
|
|
|
| |
Log the log level string after the category name, if enabled.
The default behavior remains unchanged.
Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1
|
|
|
|
|
|
|
|
| |
According to GSM 04.80 section 2.5 "Release complete", a message
of the mentioned type may contain optional IEs, such as Cause
and Facility. Let's parse them.
Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222
|
|
|
|
|
|
|
| |
Some SS messages (e.g. RELEASE COMPLETE) may contai multiple
IEs (Information Elements). Let's parse them all.
Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60
|
|
|
|
|
|
|
| |
Previously the same length value was used for both ussd_request
and interrogate_ss payloads, despite they are different.
Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d
|
|
|
|
| |
Change-Id: I64df293188908c7eb10a61941db76656340d3a8e
|
|
|
|
| |
Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1
|
|
|
|
| |
Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc
|
|
|
|
| |
Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4
|
|
|
|
| |
Change-Id: Iff0210e995053e270939a774db33f55b22545204
|
|
|
|
| |
Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4
|
|
|
|
| |
Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e
|
|
|
|
| |
Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf
|
|
|
|
| |
Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa
|
|
|
|
|
|
|
|
|
|
|
| |
According to GSM 04.08, 4.4.2 "ASN.1 data types":
the USSD-DataCodingScheme shall indicate use of
the default alphabet using the 0x0F value.
Previously, the UnstructuredSS Request messages with not
default alphabet were not being handled. Let's fix this.
Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788
|
|
|
|
|
|
| |
This change reduces the degree of code nesting...
Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the GSM 04.80 (version 5.0.0) specification Annex A
"Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD
OCTET STRING is 160 bytes.
Thus according to ETSI TS 123 038 (version 10.0.0) specification
6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's
possible to pack (160 * 8) / 7 = 182.8, that is 182 characters.
The remaining 6 bits are set to zero.
This change defines both mentioned values:
- GSM0480_USSD_OCTET_STRING_LEN 160
- GSM0480_USSD_7BIT_STRING_LEN 182
keeping the old MAX_LEN_USSD_STRING 'as is' due to compatibility
reasons. Now the new value is used for ss_request structure, while
old one is still used for deprecated ussd_request structure.
Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e
|
|
|
|
|
|
|
|
| |
According to GSM 04.80 Section 2.5 'Release complete' Table 2.5,
the 'RELEASE COMPLETE' message payload is optional, so let's drop
the length check in gsm0480_decode_ss_request() for this type.
Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6
|
|
|
|
|
|
|
| |
It's not very useful to get just the raw pointer address in case of
lapd_datalink receive error. Log it's state in addition.
Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5
|
|
|
|
|
|
|
|
|
|
|
| |
When a bad GSM voice frame is received, it's being replaced
by a silence frame. This may cause unpleasant audio effects.
This change implements a functionality to craft a replacement
frame from the last known good frame. Currently, only FR is
supported, support for other codecs may be added latter.
Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1
|
|
|
|
|
|
| |
Both len and rc values were swapped in the test output.
Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309
|
|
|
|
|
|
|
|
|
|
|
| |
GSMTAP doesn't have a lot of space for the source file name. It is better to
send only the basename of the file, because only the first bit of a long path
may not convey the source file at all, needing guess work from the line number.
Before: "Source File Name: ../../../../src/libosmocore/src"
After: "Source File Name: telnet_interface.c"
Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8
|
|
|
|
|
|
|
|
| |
It's just a tiny wrapper around gsm48_encode_ra() with less strict type
signature.
Related OS#1640
Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614
|
|
|
|
|
|
|
|
| |
Previously we've checked for existing log target with a given hostname
from vty code but it was ignored inside the check so only the very first
'log gsmtap' entry was enabled while the rest were silently ignored.
Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2
|
|
|
|
|
|
|
| |
Print which function has triggered assert_loginfo(). It's handy in
debugging logging-related issues in libosmocore.
Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the length provided in the patcket exceeds the buffer length,
tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd.
Many callers of tlv_parse() do not check its return value, but
rely on TLVP_PRESENT() to see if a particular TLV was parsed
successfully. By clearing tlv.val and tlv.len we make it less
likely that those callers will use an overlong TLV length value.
Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794
|
|
|
|
|
|
|
| |
Used for logging Speech Codec List entries in osmo-bsc, during handover
decision.
Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832
|
|
|
|
|
|
| |
Use bssgp_msgb_tlli_put() instead of copy-pasted code.
Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add gsm48_encode_ra() which takes appropriate struct as [out] parameter
instead of generic buffer. Using uint8_t buffer instead of proper struct
type prooved to be error-prone - see Coverity CID57877, CID57876.
Old gsm48_construct_ra() is made into tiny wrapper around new
function. The test output is adjusted because of the change in function
return value which was constant and hence ignored anyway.
Related: OS#1640
Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74
|
|
|
|
|
|
|
|
|
|
| |
As a leftover from code move from OsmoBTS we have eB adjustement outside
of eB check in gsm0503_tch_burst_map() which is rightfully noted by
Coverity. Let's fix this by moving the adjustement under the
corresponding if.
Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2
Fixes: CID57691
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the were no default value provided in case of unspecified
hostname in "log gsmtap" vty config. This leads to confusing log
messages because NULL was used as a hostname:
Inconsistent indentation -- leading whitespace must match adjacent lines, and
indentation must reflect child node levels. A mix of tabs and spaces is
allowed, but their sequence must not change within a child block.
Fix this by using 127.0.0.1 as default log destination and logging
hostname in case of errors.
Related: OS#2608
Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813
|
|
|
|
|
|
| |
RAI is defined in 3GPP TS 24.008 ยง 10.5.5.15
Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422
|
|
|
|
|
|
|
|
|
| |
Now that we use osmo_sock_get_name() to print connection information
at disconnect, let's use the same also at accept() time.
Furthermore, let's call it CTRL connection everywhere for consistency.
Change-Id: I33ee7d0ed853c5b2a4ae4e8ef945f8f27753cdea
|
|
|
|
|
|
|
| |
We are logging new CTRL connections at LOGL_INFO, so we should
also log disconnects for symmetry.
Change-Id: Id30aa76a5a3dab32d6b4121ce6fdf56d71dfc2ba
|
|
|
|
|
|
|
|
|
|
|
| |
When read() or write() system calls return '0' on a stream socket,
it means that the connection has been closed ("EOF"). We must
accordingly close this socket and remove all related state.
Before this patch, every new CTRL connection would introduce a leak
of both some memory/state, as well as a file descriptor :(
Change-Id: I4fb70e5f123b37dece29f156c5f430c875e7cbaf
|
|
|
|
| |
Change-Id: Ic0c8fc407a45ff4b0d3da1d3e4fdf8885b5bca9b
|
|
|
|
|
|
| |
'logging' is not only for terminals, also for stderr and other log targets.
Change-Id: If1ee59c7d1073502259b7d60008206ac3d8e87a3
|
|
|
|
|
|
|
|
| |
In the logs, it is nice to see whether e.g. sanitize or -Werror args actually
made it to the gcc command line. With V=1 we see the complete command
invocations that would be hidden otherwise.
Change-Id: Ie89b1c39489ba80fb47716f4c747f2c85960e32e
|
|
|
|
|
|
|
| |
So far, error reporting just says "Trap/Reply", more accurately report 'GET
REPLY', 'SET REPLY' and 'TRAP' as appropriate.
Change-Id: Ic25a251502499aeda4e2952ec4190a1fa0bebb01
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Validate that incoming CTRL commands...
- have decimal IDs,
- return error on trailing characters,
- have invalid characters in variable identifiers,
- send detailed error messages as reply to the requestor.
Adjust ctrl_test.{c,ok}, which best show the change in behavior.
Message handling causes log messages on stderr; previously, stderr was empty.
Add '[ignore]' in testsuite.at so that the nonempty stderr doesn't cause test
failures.
Change-Id: I96a9b6b6a3a5e0b80513aa9eaa727ae8c9c7d7a1
|
|
|
|
|
|
|
|
| |
This change defines the GSM FR bit positions as described
in RFC 3551, which will be used by further ECU
(Error Correction Unit) implementation.
Change-Id: I1d0a198af0f8dd1f690b5a81f5c9eb92c43aefed
|
|
|
|
|
|
|
|
|
| |
There are some projects, such as OsmoBTS and OsmocomBB, which
are dealing with raw TCH payloads, so they need to have the
FR/HR/EFR frame length defined. At the moment, each project
defines them itself. Let's share these definitions.
Change-Id: Ib19dd1bf81712d034157f9ce061008be0000ef38
|
|
|
|
|
|
|
|
|
| |
So far it uses 2323, a development default. Instead, assign new ports,
appending to the common range of VTY and CTRL ports: 4261 and 4262.
Related: https://osmocom.org/projects/cellular-infrastructure/wiki/Port_Numbers
Related: I28bd7a97d24455f88fadc6724d45c3264ba2fce4 (osmo-gsm-manuals)
Change-Id: Ife52a968a41cb286f640006587877971ff66c1a4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recent patch I563764af1d28043e909234ebb048239125ce6ecd introduced returning
NULL from rate_ctr_group_alloc() when the index passed already exists.
Instead of returning NULL, find an unused group index and use that, adjust the
error message.
In stats_test.c, adjust, and also assert allocated counter group indexes
everywhere.
Rationale:
The original patch causes osmo-sgsn to crash as soon as the second subscriber
attempts to establish an MM context. Of course osmo-sgsn is wrong to a) fail to
check a NULL return value and crash and b) to fail to allocate an MM context
just because the rate counter group could not be allocated (it still rejects
the MM context completely if rate_ctr_group_alloc() fails).
Nevertheless, the price we pay for rate counter correctness is, at least in
this instance, way too high: osmo-sgsn becomes completely unusable for more
than one subscriber.
Numerous other places exist where rate_ctr_group_alloc() is called with a
constant index number; from a quick grep magic I found these possible breaking
points:
osmo-sgsn/src/gprs/gb_proxy.c:1431: cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0);
osmo-sgsn/src/gprs/gprs_sgsn.c:139: sgsn->rate_ctrs = rate_ctr_group_alloc(tall_bsc_ctx, &sgsn_ctrg_desc, 0);
osmo-sgsn/src/gprs/gprs_sgsn.c:270: ctx->ctrg = rate_ctr_group_alloc(ctx, &mmctx_ctrg_desc, 0);
osmo-sgsn/src/gprs/gtphub.c:888: b->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx,
>phub_ctrg_io_desc, 0);
osmo-bsc/src/libfilter/bsc_msg_acc.c:87: lst->stats = rate_ctr_group_alloc(lst, &bsc_cfg_acc_list_desc, 0);
osmo-pcu/src/bts.cpp:228: m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:793: tbf->m_ctrs = rate_ctr_group_alloc(tbf, &tbf_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:879: tbf->m_ul_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_egprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:880: tbf->m_ul_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_ul_gprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:970: tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_egprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:977: tbf->m_dl_gprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_gprs_ctrg_desc, 0);
osmo-pcu/src/tbf.cpp:1475: ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0);
osmo-pcu/src/bts.cpp:226: m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 1);
We can fix all of these callers and then reconsider returning NULL, but IMO
even into the future, rate counter group indexes are not something worth
failing to provide service for. For future bugs we should keep the automatic
index picking in case of index collisions. We will get an error message barfed
and can fix the issue in our own time, while the application remains completely
usable, and even the rate counters can still be queried (at wrong indexes, but
life is tough).
Related: I49aa95b610f2faec52dede2e4816da47ca1dfb14 (osmo-sgsn's segfault)
Change-Id: Iba6e41b8eeaea5ff6ed862bab3f34a62ab976914
|
|
|
|
|
|
|
|
|
|
|
| |
The recently added ctrl_cmd_parse2() returns non-NULL cmd with error messages
upon parsing errors. In handle_control_read(), use ctrl_cmd_parse2() and send
those back to the CTRL command sender as reply.
Retain the previous "Command parser error" reply only in case ctrl_cmd_parse2()
should return NULL, which shouldn't actually happen at all.
Change-Id: Ie35a02555b76913bb12734a76fc40fde7ffb244d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a control command fails to parse, we so far discard specific error messages
and instead send just "Command parser error".
In ctrl_cmd_parse() we actually compose detailed error replies, but in the end
simply talloc_free() them and return NULL.
A first step to report these errors to the ctrl command issuer is to not return
NULL and instead return the cmd with type = CTRL_TYPE_ERROR. Add
ctrl_cmd_parse2() to return such instead of NULL.
To stay API compatible, provide ctrl_cmd_parse2() to return a cmd on errors.
ctrl_cmd_parse() retains identical behavior but becomes just a simple wrapper
around ctrl_cmd_parse2() which discards the cmd on error.
No need really to deprecate ctrl_cmd_parse() yet; especially as long as
compiler warnings might break jenkins builds.
Change-Id: I5047c9f977d70b03eea77cbcfd2b96d43ea46880
|
|
|
|
| |
Change-Id: Id11bc326be2f0bc2746a928354e416495a18baf7
|
|
|
|
|
|
|
|
|
|
|
|
| |
In ctrl_handle_msg() (code recently propagated from handle_control_read()),
talloc_free() the parsed ctrl_cmd in all code paths. In particular, a free was
missing in case ctrl_cmd_handle() returns CTRL_CMD_HANDLED.
CTRL_CMD_HANDLED is triggered by GET_REPLY / SET_REPLY parsing, as show by
ctrl_test.c. With the memleak fixed, adjust expected test output and make a
detected mem leak abort the test immediately.
Change-Id: Id583b413f8b8bd16e5cf92a8a9e8663903646381
|
|
|
|
|
|
|
| |
The "memleak!" output shows messages that lack a talloc_free() of the parsed
ctrl command buffer. The leak shall be fixed in a subsequent patch.
Change-Id: I2c3e4d08b769b9cd77593362ea36a28d681cd042
|
|
|
|
|
|
|
| |
Subsequent patches that tighten CTRL input validation will make the results
more interesting.
Change-Id: Idd4cc7d193db1a7d761f72ed33ed46eea450a78f
|