Age | Commit message (Collapse) | Author | Files | Lines |
|
This new API doesn't use host_config_set(), and allows passing a FILE*
from any source, not only a filesystem path.
Related: SYS#5369
Change-Id: I720ac04386261628c0798a1bfcaa91e2490a86c3
|
|
The API was defined in the header file but not implemented.
Change-Id: I69de9864fa7cd421557b9fc630beefea6d90b4cc
|
|
The library specific sub-systems are kind of special, because their
position in the 'osmo_log_info' may vary depending on the number of
application specific sub-systems. This is why their associated
constant values (like DLGLOBAL) are negative, and this is what
the LOGP() macro expects as the first argument.
Before this change, invoking 'logp' command with any library
specific logging sub-system would result in getting messages
printed with the fall-back DLGLOBAL sub-systems.
Change-Id: If86563e169fe1243adfa7b09c9d65d9f88c8a99e
|
|
Change-Id: I2b2bab61e46668c3b4b0ccad88d02b6d00a83544
|
|
Change-Id: Ifded63a38caac26e174fc6cb69dead7bc83db344
|
|
Change-Id: I3bc0826c0000be4d76235ed6b5be86d216ea2e4d
|
|
Related: OS#5032
Change-Id: I38fc93ab0182b4edbd639c7ed0f31ce51964ee18
|
|
Back in 2018 in I393907b3c9e0cc1145e102328adad0a83ee13a9f Neels
introduced "last" as an optional flag to log the file/line number at the
end of the line, rather than at the end of the header. It seems nobody
has been usingi this feature, or at least never tried to save a related
config file, as there was no code whatsoever that would ever save this
optional "last" flag.
Change-Id: I7b6245256aecc425722242aaabc154ac58ba27a0
|
|
Callers other than "show fsm" / "show fsm-instances" may want to
indent the output.
Change-Id: I10e01ef91116369868cdb878a99634c8681728af
|
|
Fixes following ASan runtime errors while running vty tests:
command.c:730:27: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Somehow we didn't catch this one in Ie11ff18d6fd9f6e1e91a51b6156fb6b0b7d3a9a8
Change-Id: I601caf7daa947f3cf391316f1011007ef9188c90
|
|
Change-Id: I511ce26350cd04bb0f66d130b5286cab84f16df2
Related: SYS#4910
|
|
Change-Id: I85c80376c13c7dddf34dadd2a6c09caf23fd70ce
|
|
Having the expert mode flag stored in the global 'host' structure
was a bad idea, because this way it applies globally. In other
words, if user Bob activates the expert mode in his dedicated
session (e.g. a telnet connection), then not only him, but all
other users would see the hidden commands in their VTYs.
Moreover, if somebody deactivates the expert mode, it would also
affect the Bob's VTY session. And finally, terminating a VTY
session would not deactivate the expert mode.
Let's move that flag from the global 'struct host' to 'struct vty'
representing an individual VTY session, so then the expert mode
would only affect the session where it was activated.
In functions related to the XML VTY reference generation we don't
have access to 'struct vty' (there may be no VTY session at all).
Add two additional arguments to vty_dump_nodes(), indicating the
global flag mask and a matching mode. This would allow to match
the VTY commands in many different ways, e.g. one can dump hidden
commands only, or all commands except the library specific ones.
Change-Id: Iba13f0949061e3dadf9cf92829d15e97074fe4ad
Related: SYS#4910
|
|
Otherwise in the expert mode, hidden commands do not get the
associated attribute printed to the XML VTY reference.
Change-Id: I8ded973031beb6d8c7ad55f06641c9651b1d9e71
Related: OS#4910
|
|
This change introduces an enumerated type 'vty_ref_gen_mode' that
(as the name suggests) defines the VTY reference generation mode:
- DEFAULT - all commands except deprecated and hidden,
- EXPERT - all commands including hidden, excluding deprecated;
and a new function vty_dump_xml_ref_mode(), that allows to specify
that mode. The old vty_dump_xml_ref() is now deprecated.
Change-Id: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Related: SYS#4910
|
|
Change-Id: I4a8b3bada44538a5e5711bbc4dccf8b2cf3e2e08
|
|
Some VTY commands are intentionally hidden, e.g. because they might
by relatively dangerous if used in production operation. We equip
such commands with a special attribute - CMD_ATTR_HIDDEN.
The problem is that neiter they appear in the XML VTY reference,
nor in the online VTY help, so it's a bit tricky to invoke them.
This change introduces so-called 'expert' mode, in which hidden
(but not deprecated) commands are getting visible.
In the (telnet) VTY session, this mode can be activated by passing
an additional argument to well-known 'enable' command:
OsmoApp> enable ?
[expert-mode] Enable the expert mode (show hidden commands)
OsmoApp> enable expert-mode
OsmoApp#
so then hidden commands will appear together with all the other
commands. They will be marked with a special '^' flag:
OsmoApp# list with-flags
^ ... foo-hidden [expert-mode]
. ... foo-regular-one
! ... foo-immediate
^ u.. app-hidden-unbelievable
For the XML reference generation, additional API needs to be
introduced. This will be implemented in subsequent patches.
Change-Id: Ie69c2a19b22fb31d7bd7f6412f0aeac86ea5048f
Related: SYS#4910
|
|
This change implements 'systemd-journal' logging target, that is
similar to the existing 'syslog' target. The key difference is
that 'systemd-journal' allows us to offload rendering of the meta
information, such as location (file name, line number), subsystem,
and logging level, to systemd. Moreover, we can attach arbitrary,
user-specific fields [1] to the logging messages, so they can be
used for advanced log filtering (e.g. by IMSI/TMSI/TLLI):
$ journalctl OSMO_SUBSYS=DMSC -f
Since we don't want to make libsystemd a required dependency, this
feature is optional, and needs to be enabled at build-time:
$ ./configure --enable-systemd-logging
The new logging target can be configured in the same way as any
other one - via the VTY interface, or using the configuration file:
log systemd-journal [raw]
logging level set-all notice
logging filter all 1
Two logging handlers are available: generic and raw. The first one
behaves similarly to both 'syslog' and 'stderr', i.e. all the meta
information is rendered by libosmocore itself, and then passed to
systemd together with the logging message. The later is more like
the 'gsmtap' target, so all available meta information is handed
over to systemd in form of fields [1]:
- CODE_FILE / CODE_LINE - location info,
- PRIORITY - syslog-compatible logging level,
- OSMO_SUBSYS - Osmocom-specific sub-system (e.g. DMSC),
- OSMO_SUBSYS_HEX - same as OSMO_SUBSYS, but encoded in hex,
- MESSAGE - the logging message itself,
and then can be rendered in any supported format (e.g. JSON).
More details about the API can be found in [2].
[1] https://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html
[2] https://www.freedesktop.org/software/systemd/man/sd-journal.html
Change-Id: I609f5cf438e6ad9038d8fc95f00add6aac29fb23
|
|
Change-Id: Ieea7d13161440326d58f80f1fbc9f7e3fa5a40af
|
|
Fixes following ASan runtime errors while running vty tests:
src/vty/command.c:3088:27: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
src/vty/command.c:3136:23: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Change-Id: Ie11ff18d6fd9f6e1e91a51b6156fb6b0b7d3a9a8
|
|
Change-Id: I0efc57f2cb54798ba207ae6fef9af4771d96bfa9
Related: SYS#4937, OS#1601
|
|
Some attributes like CMD_ATTR_LIB_COMMAND are not being printed
to the XML VTY reference (despite being set), so we should not
print empty "<attributes scope='global'></attributes>".
Change-Id: Ie7e53b080c10564bfef6f0e8ddeb470e46fad387
Related: SYS#4937
|
|
Change-Id: Icb4acbab0a15de2b0ed7b88fb0e227675317146a
Related: SYS#4937
|
|
Change-Id: I77c1ef7ca4c667c769cc53c7ac65c3be5c7e1c86
Related: SYS#4937
|
|
Here is an example:
OsmoAPP(config-foo)# list with-flags
... help
... list
... show running-config
... exit
..F lib-command foo (one|two|three)
ZB. lib-command bar [zoo]
.bf app-command foo-bar
z.. app-command zoo .TEXT
... app-command nope
A dot indicates that the associated attribute is not set.
Note that there is no strict relation between rows and index values
of the attributes. In the example above there could be one or more
hidden flag rows corresponding to attributes that are not assigned
to any of the commands within 'config-foo' node.
If neither of the commands belonging to the current node (where
'list' command is executed) has attributes, the output would
not contain empty dot-rows.
Global attributes (such as CMD_ATTR_IMMEDIATE) are not yet displayed
because we still have not agreed on what kind of symbols to assign
them. This will be implemented later.
Change-Id: I71cef3ec0fab44c7e11fc353b8bc42268a4ee8f0
Related: SYS#4937
|
|
Here is an example of listing all attributes:
OsmoBSC# show vty-attributes
Global attributes:
. This command is deprecated
. This command is hidden
. This command applies immediately
. This command applies on VTY node exit
Library specific attributes:
(no attributes)
Application specific attributes:
o This command applies on A-bis OML link (re)establishment
r This command applies on A-bis RSL link (re)establishment
or only a specific kind of attributes:
OsmoBSC# show vty-attributes application
Application specific attributes:
o This command applies on A-bis OML link (re)establishment
r This command applies on A-bis RSL link (re)establishment
Change-Id: I561114d7416e30cc06b7d49c0bc1217a76039c99
Related: SYS#4937
|
|
Change-Id: I4439a414af05700cb1ccff7e7e5927ffc194d171
Related: SYS#4937, OS#1601
|
|
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.
Change-Id: I15184569635b3ef7dfe9eeddcc19bf16cc358f66
Related: SYS#4937
|
|
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.
Change-Id: Ic541126ffd4975daf87199abfafb465e2055e44f
Related: SYS#4937
|
|
This new attribute would allow to distinguish commands provided
by libraries from commands registered by the application itself,
so vty_dump_element() would print proper description for the
library specific attributes.
All VTY commands defined by the libraries need to use the new API:
- install_lib_element(), and
- install_lib_element_ve,
instead of the old functions (respectively):
- install_element(), and
- install_element_ve().
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.
Change-Id: I8baf31ace93c536421893c2aa4e3d9d298dcbcc6
Related: SYS#4937
|
|
Change-Id: I56306f4886a72a3525b60225721aa2fcf7c57213
Related: SYS#4937
|
|
We agreed to reserve uppercase flag letters for libraries.
Change-Id: If0c332f7c86ff26a4060a14b947445d194a6702e
Related: SYS#4937
|
|
This would facilitate detecting duplicates on early development stages.
Change-Id: I4e27d6e89d3f851b5ea4f00da01e7093afa537b2
Related: SYS#4937
|
|
We cannot keep a reference to the old log_target around if we
just destroyed/deleted it.
Change-Id: I98a801cf83347a4422534d020d5ed5e2d1eb5482
|
|
Given that commands with either/both of the following attributes:
- CMD_ATTR_DEPRECATED,
- CMD_ATTR_HIDDEN,
never end up in the XML reference, only CMD_ATTR_IMMEDIATE would
be reflected for commands taking effect immediately as follows:
<command id='foo'>
<!-- Global attributes -->
<attributes scope='global'>
<attribute doc='This command applies immediately' />
</attributes>
<!-- Application specific attributes -->
<attributes scope='application'>
<!-- ... -->
</attributes>
<params>
<!-- ... -->
</params>
</command>
Change-Id: I8476c1163c23a9a52641987acf3df0b8c49d8f7b
Related: SYS#4937
|
|
Change-Id: I1585ee70a3db77aa8737f9463c4d0665f4e90d90
|
|
Change-Id: Ifcf5f7be925c5421040d3cac2c4c5e4dd497c0f5
|
|
Change-Id: I54ee7c3c6fe16a413d0e1128c7358ff6e4b76c6a
|
|
Change-Id: I1f35368ba9178e1454f2e3ddfcad9d96576143ef
Related: SYS#4937
|
|
Change-Id: I49549439d5bbfbb83954ba92957304b03062d003
Fixes: CID#212137
|
|
Durin dev cycle, node was initially called "sched" instead of
"cpu-sched", and when it was renamed, this specific part was missed.
Change-Id: I0709fee12cc8ddc4d57efb4ea40b0b79b7ea4151
|
|
It's more convenient to use i in the outer loop, and j, k, etc.
in the inner loops. Otherwise it looks a bit confusing.
Change-Id: I61ef48fcf977d6a872e288571a4ff2c3dfe3184b
|
|
Change-Id: I6f7f5af6879d91811be6f0edf3feb2ebae185ac7
|
|
Shared code might be used by applications that have no vty, so sched
can't be initialized, do not assert and break everything in this case, a
warning should suffice.
Change-Id: Ic40075df8d4cf9fe8f1d711f899dae9a4b5b0928
|
|
Change-Id: I8f784d0cf65fa7813088e3ff76d7213b99b975d0
|
|
Change-Id: Id1c082d102b7156dafb9c5d9197dcdc4d26bff63
|
|
Process willing to support this kind of configuration through VTY simply
need to call "osmo_sched_vty_init(tall_ctx);" during startup to register
the commands.
For multithreaded processes, new threads willing to get their
cpu-affinity mask according to VTY config should call
osmo_sched_vty_apply_localthread() (potentially after
setting the thread name through pthread_setname_np()).
Related: SYS#4986
Change-Id: If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
|
|
Without this patch, for instance having a range 0-ULONG_MAX would match
if someones types value -3, which would be converted to unsigned but
that's clearly what is expected here from user point of view.
Change-Id: Ia95f6314a2dd3f94d21fc219cf69bb8d39b8e7f0
|
|
This fixes commands not being matched due to providing a range with more
than 10 digits.
The last case (passing -4000 matching 0-ULONG_MAX) shows a different bug
which will be fixed in next commit.
Change-Id: I0afa0caabffe36083c36b92ba90696ded00bb7be
|
|
* Allow to set the reporting interval to 0 for manual reporting
* stats reset command to reset all statistics
* stats report command to manually trigger statistics reporting
Change-Id: I9febcb65650abfd538caedfbca77a787e66d517a
Related: SYS#4877
|