Add 'date' to 'logging print timestamp (none|date|date-packed|ctime)'
The idea is to have these date formats:
date 2018-01-16,01:44:34.681 (new, "best" format)
date-packed 20180116014434681 (current 'print extended-timestamp 1')
ctime Sun Jan 1 01:44:34 2018 (current 'timestamp 1')
Rationale: when reading log files, it can be important to see
milliseconds precision on the timestamps. But the current
extended-timestamp format lacks all separators, reading these manually
is a pain. My eyes aren't good at counting digits, I keep getting the
minutes, seconds and millis wrong and waste my time on every glance. So
provide a new detailed timestamp format that is easier to read.
Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0
Deprecate previous logging timestamp config commands:
logging timestamp (0|1)
logging print extended-timestamp (0|1)
Add new single timestamp configuration command:
logging print timestamp (none|date-packed|ctime)
Another format called 'date' is added in patch
Icbd5192ea835e24b12fe057cc1ab56e9572d75c0. The idea is to have these
date formats:
date 2018-01-16,01:44:34.681 (new, "best" format)
date-packed 20180116014434681 (current 'print extended-timestamp 1')
ctime Sun Jan 1 01:44:34 2018 (current 'timestamp 1')
Change-Id: I58c792dda3cbcf8618648ba4429c27fa398a9e15
In preparation of adding a new timestamp format, refactor to use an enum to
pick the timestamp style.
Introduce log_set_print_timestamp2() to be able to pass an enum value directly
(for future additions). Deprecate previous API of
log_set_print_timestamp() and log_set_print_extended_timestamp().
Remove the old members of struct log_target members:
- print_timestamp and
- print_ext_timestamp (bool flags),
instead add member
- timestamp_format (enum).
This is an API and ABI incompatibility. (An original patch version
preserved the unused struct members, but code review suggested it makes
more sense to drop them.)
The old API functions log_set_print_timestamp() and
log_set_print_extended_timestamp() still work, but setting
log_set_print_*timestamp(0) changes its behavior: now passing zero to
either of these functions sets LOG_TIMESTAMP_NONE, so it now always
switches off all timestamps, instead of previously maybe going back to
another timestamp depending on the other flag being set or not.
Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6
Rename 'logging_prnt_timestamp_cmd' to
logging_timestamp_cmd
to better match its VTY name:
'logging timestamp (0|1)'
(An actual 'logging print timestamp' command will be added in subsequent
patch I58c792dda3cbcf8618648ba4429c27fa398a9e15, so clarify.)
Change-Id: I5a651e393bd438ea236659ed2c86188a8f9885d1
Show what timestamp formats we currently feature.
Upcoming patch Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 adds a new
timestamp format.
Change-Id: If3dbf3006a454d4e8a5c758e5c884e12c8bb1fc1
Add ability to print logging timestamps in UTC.
I want to test logging timestamps in vty transcript tests. To get
deterministic timestamps, I can use osmo_gettimeofday_override().
However, so far we log in the server's local time zone: the dates
printed after osmo_gettimeofday_override() still change according to the
locally configured timezone -- not good for regression testing. For UTC,
it is always the same.
The intended use is for regression testing of timestamps, but maybe
logging in UTC may be useful to some user out there, too.
Change-Id: I7f868b47bf8f8dfcf85e735f490ae69b18111af4
Upcoming patch I58c792dda3cbcf8618648ba4429c27fa398a9e15 aims to change
the timestamp configuration. Show current state before these changes.
Change-Id: I8e0a373496130004e453a2044c1091665fe02a05
There's not much point in deallocating memory in a test fixture
which is about to terminate anyway. Having talloc report though
is handy to make sure we're not leaking smth.
Change-Id: I5739bceb90d36164fd4cbf21242bbe26bd1e7075
Including this header just for TALLOC_CTX is an overkill, we use
'void *' for talloc contexts in nearly all other Osmocom projects.
Change-Id: I4b9ffd7a329081df3d2c0b0ee8698a3cf759e94e
Related: OS#5960
This is a partial revert of "9dca9027 coding: clean up Makefile.am".
Even though libosmocoding does not use talloc API, it still depends on
this library indirectly via libosmo{core,codec,gsm}. Furthermore, some
of libosmocore's header files do #include <osmocom/core/talloc.h>, and
thus #include <talloc.h> via this internal header.
Under Slackware 14.2 talloc.h header lives in /usr/include/samba-4.0,
and without $(TALLOC_CFLAGS) compilation of libmsocoding fails due
to the preprocessor failing to find this header. The culprit is my
recent patch 9dca9027 removing $(TALLOC_CFLAGS) and $(TALLOC_LIBS).
Put $(TALLOC_CFLAGS) back to AM_CFLAGS; it will likely be emply under
distributions having talloc.h header in the standard include dir. The
$(TALLOC_LIBS) does not need to be resurrected because libtool will
add '-ltalloc' automatically for each libosmo*.la in LIBADD.
Change-Id: Ic1bd82159a827af21fe36bea998f8f58f732473a
Related: OS#5960
Previously existing code provides osmo_fr_check_sid() and
osmo_hr_check_sid() functions for FR1 and HR1 codecs; these functions
are used by various RTP-touching programs in the Osmocom CNI suite
when they need to differentiate between speech and SID frames.
However, there was no corresponding function of this form for EFR
codec, with the result being that the same programs that handle
speech vs SID distinction correctly for FR1 and HR1 fail to do so
for EFR.
The present change adds an osmo_efr_check_sid() function to libosmocodec
that fully mirrors previously existing osmo_fr_check_sid() and
osmo_hr_check_sid(), providing the first step toward more correct
EFR handling in programs where a SID check may be needed.
Change-Id: Iab9fb60028f4135375287bc42f5da7ca7838b5f0
The convenience wrapper relieves the caller from manually resolving
the individual counter, and instead specify just the counter group
and the index.
Change-Id: If93e8b4fb0b86a87358f32d2b45438ca1887e9f3
The values are defined in 3GPP TS 44.018, section 10.5.2.6. Only the
radio interface rates for CSD (GSM48_CMODE_DATA_*) are given, but the
respective service rates can be found in 3GPP TS 45.003.
Change-Id: I716027f73ab6f20037f6de16e4a3740811aa38a2
Related: OS#1572
The decoding path of TLV_TYPE_SINGLE_TV is wrong, since it is not
shifting right the tag before using it. On the other hand, the encoding
path (tlv_encode_one) is doing that, so it is clear there's a bug.
It seems that in order to workaround the bug some IEs in gsm_04_08.h (TS
24.008 and TS 44.018) were defined incorrectly (eg 0x80) while the spec
clearly assigns eg. "8" to it, and makes sure no full byte IEI collides.
Some other IEIs like GSM48_IE_GMM_CIPH_CKSN which are also of the same
type were already correctly defined as 0x08.
Change-Id: I799e35dc8d4d153fa63bf50563a5482cdf4de2d7
Coverity warns that osmo_v110_sync_ra1_get_user_data_chunk_bitlen() may
return a negative value, which is used as loop boundary. Even though
this is unlikely, let's add an assert().
Change-Id: I0fc0e0bac74bd96351030432ef1b140b727acb0d
Fixes: CID#310968
Change-Id: I67dc578c62f89039f35856da1f29caab4b5db1d8
Fixes: fae779ac5 "GSMTAP: Import changes from Wireshark"
Fixes: f9b1e5556 "gsmtap.h: Introduce new GSMTAP type for LTE NAS messages"
Fixes: 161d42a61 "gsmtap: Add definitions for E1/T1 payload (LAPD, TRAU, FR) in GSMTAP"
Also mask hexadecimal without leading 0x. But take care to not match on
every letter a-f,A-F in normal words and names.
before:
10 map_rua(NffffNfNecN-example-com-RUA-N)[N]
10 map_sccp(NffffNfNecN-example-com-SCCP-N)[N]
17 map_rua(NffffNcN-example-com-RUA-N)[N]
17 map_sccp(NffffNcN-example-com-SCCP-N)[N]
18 map_rua(NffffNeNbN-example-com-RUA-N)[N]
18 map_sccp(NffffNeNbN-example-com-SCCP-N)[N]
82 map_rua(NffffNfNdN-example-com-RUA-N)[N]
82 map_sccp(NffffNfNdN-example-com-SCCP-N)[N]
85 map_rua(NffffNfN-example-com-RUA-N)[N]
85 map_sccp(NffffNfN-example-com-SCCP-N)[N]
224 struct hnbgw_context_map
after:
224 map_rua(N-example-com-RUA-N)[N]
224 map_sccp(N-example-com-SCCP-N)[N]
224 struct hnbgw_context_map
Change-Id: I1b42ce3e67c7ed2d38d3e5c9cbfa90ba185a07b7
Add priorities to ensure on_dso_load_select runs after on_dso_load_ctx.
Otherwise osmo_ctx->global (used via define OTC_GLOBAL) points to NULL
and causes a segfault in osmo_fd_lookup_table_extend.
Use numbers 101 and 102, as "0 to 100 are reserved for the
implementation" and cause an error from GCC.
Fixes: OS#5946
Fixes: c46a15d8 ("select: Optimize osmo_fd_get_by_fd")
Change-Id: Ia2518e82530b93c535f8f5105513e21559b895ba
It makes no sense to call osmo_fd_unregister() on a negative fd.
Let's also make sure we set fd to negative value after unregistering +
closing, even if the struct is going to be freed afterwards.
Change-Id: I0790a63e603028c11cc475d483c6528e4d9aa9ab
LDADD var contains both local and system libraries. Use it at the right
place (after list of local libs, before list of system libs).
Change-Id: Ifb3686f78432ac877c596004646506c540b23c53
The logic testing the and setting the define was inverted, which made it
enabled by default.
Take the chance to rename the enable flag to be "ofd" instead of
"bsc-fd" (since anyway the flag was broken).
Change-Id: I81112fa1f6ce1a8e5fe85468241ad385ed8805d3
Those restrictions were implicitly required for a while and most of the
users of this API already followed them, but just a few didn't. All
known users have now been fixed. Let's explicitly document the
restrictions imposed by the API to ease avoiding similar issues in the
future.
Change-Id: I53d95aad15b33dd66aa5c7dd11745a35c4481f33
Optimize osmo_fd_get_by_fd() from O(n) to O(k) by means of allocating
dynamically growing array.
Make use from the fact that the kernel always tries to use the smallest
possible unused value when allocating a new fd.
Change-Id: I8b71547df8bed84192cb160479fa3debf9b7eade
* $(TALLOC_CFLAGS) is already present in AM_CFLAGS,
* osmo-sim-test: do not redefine but append $(PCSC_CFLAGS).
Change-Id: I7b9af3a1a9493a432af89198e291f4523388751e
* Remove TALLOC_{CFLAGS,LIBS} - talloc is not used directly
* Keep conditional ENABLE_PSEUDOTALLOC for embedded builds
Change-Id: I18f0a65a47c37989f03928f99c4687bf8007d437
3GPP TS 44.021 specifies the format for modified V.110 frames as used
on the GSM air (radio) interface. Implement encoders and decoders for
this modified V.110 format.
Related: OS#1572
Change-Id: I60a2f2690459359437df20cf4da9043fa7c3ad11