| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new functions bitvec_get_bytes and bitvec_set_bytes copy
byte sequences from bitvecs to uint8_t arrays and vice versa.
While the bytes in the bitvecs do not need to be aligned, the uint8_t
arrays always are. In case the bytes in the bitvec are aligned, the
implementation uses memcpy.
Note that the implementation like the other existing functions assume
MSB first encoding.
[hfreyther: Squash the comment fix into this commit as well]
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions are currently part of openbsc but also needed by
other projects.
The function have been renamed as follows:
gprs_apn_to_str -> osmo_apn_to_str
gprs_str_to_apn -> osmo_apn_from_str
Sponsored-by: On-Waves ehf
|
|
|
|
|
| |
86ec311896dd5d4 adds compiler warnings on 64bit. The build is clean otherwise,
so let's keep it that way.
|
| |
|
|
|
|
|
|
|
| |
This patch makes msgb_hexdump accept out of range lXh pointers and
shows info about them instead of aborting the dump entirely.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions originate from openbsc/src/gprs but are generic
msgb helper functions.
msgb_copy: This function allocates a new msgb, copies the data
buffer of msg, and adjusts the pointers (incl. l1h-l4h)
accordingly.
msgb_resize_area:
This resizes a sub area of the msgb data and adjusts the
pointers (incl. l1h-l4h) accordingly.
Sponsored-by: On-Waves ehf
|
| |
|
|
|
|
|
|
| |
The primitives for SUSPEND, RESUME and RECONNECT are only permitted on
the MS side of the LAPDm link, not on the BTS side. So we should check
for this and reject, accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the state is assumed to remain the same while the reset
procedure is active. While this works correctly in general, a single
unexpected BLOCK_ACK or UNBLOCK_ACK can change the state but will not
stop the reset procedure. The leads to repeated RESET messages, where
the corresponding RESET_ACK is ignored. This is a stable state which
can only be left by manual intervention or by reception of a RESET
message from the peer.
This commit changes the RESET timeout handler to set the state to
BLOCKED/RESET when sending the new NS RESET message.
Note that this should ensure a clean restart even if the state has been
screwed up. It does not fix the handling of BLOCK_ACK or UNBLOCK_ACK
in abnormal cases.
Addresses:
gprs_ns.c:349 NSEI=8895 Tx NS RESET (NSVCI=8895, cause=O&M intervention)
gprs_ns.c:878 NSVCI=8895 Rx NS RESET ACK (NSEI=8895, NSVCI=8895)
gprs_ns.c:887 NS RESET ACK Discarding unexpected message for NS-VCI 8895 from SGSN NSEI=8895
Ticket: OW#1551
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
stats_statsd.c: In function ‘osmo_stats_reporter_statsd_send_item’:
stats_statsd.c:154:15: warning: initialization discards ‘const’ qualifier from pointer target type
char *unit = desc->unit;
^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The stat item group is not removed by gprs_nsvc_delete which will
corrupt the group list.
Addresses:
valgrind tests/gbproxy/gbproxy_test
[...]
==4541== Invalid write of size 4
==4541== at 0x4071ACA: __llist_add (linuxlist.h:65)
==4541== by 0x4071ACA: llist_add (linuxlist.h:81)
==4541== by 0x4071ACA: osmo_stat_item_group_alloc
(stat_item.c:112)
==4541== by 0x407EDFD: gprs_nsvc_create (gprs_ns.c:244)
==4541== by 0x408109D: gprs_ns_instantiate (gprs_ns.c:1388)
==4541== by 0x804CFD3: test_gbproxy_ident_changes
(gbproxy_test.c:1501)
==4541== by 0x805FBD3: main (gbproxy_test.c:5803)
Sponsored-by: On-Waves ehf
|
| |
|
|
|
|
|
|
|
| |
This symbol is globally visible and therefore should have an OSMO
prefix like the other identifiers exported by stat_item.h.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
Add OSMO_STAT_ITEM_NO_UNIT for stat items without an unit. The
statsd reporter uses gauges ("g") to report them.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
Shipping our own private copy of talloc was a good idea in 2008,
when it was not readily available on most target platforms. Today,
the situation is quite different, as it is a standard library on
major Linux distributions.
|
|
|
|
|
|
|
|
|
|
| |
Currently the counters are scanned twice, once for interval
computation and once for reporting.
This adds a reminder to move the interval computation code to a
special stats reporter which just shall update the fields.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
Due to prior refactoring, the functions do not have an sensible order
in the file. This commit tries to improve that a little bit.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
| |
This commit moves the stats specific code parts into stats_statsd.c
while keeping the generic parts in stats.c. The code in stats.c no
longer contains references to statsd symbols.
Note that the VTY code still needs to know about every stats reporter
backend.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
| |
CC stat_item.lo
stat_item.c: In function 'osmo_stat_item_group_alloc': stat_item.c:84:28: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]
group->items[item_idx] = (void *)items_size;
^
stat_item.c:98:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
((uint8_t *)items + (int)group->items[item_idx]);
^
|
|
|
|
|
| |
This was pointed out by Jaroslav Skarvada during fedora packaging,
and he has a valid point...
|
|
|
|
| |
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the global stat item index is being advanced in
osmo_stat_item_group_handler, so that the second and further groups
in the list will skip new item values.
This commit moves the call to osmo_stat_item_discard_all into
osmo_stats_report to a place where all groups have been processed
already.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the reporter loop is aborted, if the event would be ignored
due to an insufficient max_level. Thus the reporters that happen to
be stored afterwards would be skipped even if their level were
sufficient.
This commit replaces the conditional 'return' statement by a
considtional 'continue' statement to ensure the processing of the
list tail.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently only counter changes and new item values are being
reported. This makes it cumbersome to configure reporting clients,
since there is nothing like a list of all parameters.
This commit changes this behaviour such that all currently existing
counters and items that would be reported eventually, are passed to
the reporter when it has been reconfigured or enabled. If a counter
has not been incremented, 0 is sent. If a stat item value has not
been added, the last item value (or the default value if there is
none) is resent again.
Note that this will not catch transient counters/items that will be
created later on, e.g. triggered by new peers or subscribers.
To just force this kind of dump on a running reporter, it is
sufficient to invoke the 'enable' command in its configuration node.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the having an unset prefix leads to an abort() in the
statsd reporter due to an fprintf format string error. In addition
the prefix cannot be reset to its initial state (NULL) by using 'no
prefix', which just sets the prefix to the empty string, causing a
single leading dot to appear in front of the name.
This commit changes the implemenation to consistly use NULL for
the unset name prefix ('no prefix') and to handle this case correctly
in the statsd reporter.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
Potentially Fixes:
<command id='show stats level (global|peer|subscriber)'>
<param name='subscriber' doc='(null)' />
|
|
|
|
|
|
|
|
|
|
|
| |
The NS object is created with an unknown identity and only after
the reset procedure has progressed (completed?) we know the real
ID for this peer. Before nobody has looked at the idx values (this
could have been seen with the CTRL interface) but with statsd the
wrong NSVCI becomes obvious.
Add routines to update the idx and I don't know if the change of
idx is causing any issues but we will find that out soon.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently there is only the 'show stats' command which shows all
counter and stat_item values. This can lead to many lines of output
if there are per-subscriber rate counters.
The new command added by this commit allows it to only show groups of
a certain level (class_id), similar to the 'level' configuration
command for stats reporter.
The new command is
show stats level (global|peer|subscriber)
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
| |
Currently the class_id is not set which effectively puts these groups
into the 'subscriber' class.
This commit adds the missing initialisation value.
Sponsored-by: On-Waves ehf
|
|
|
|
|
| |
Bump the ABI version of libosmovty and we need to do this
recursively to force rebuilds of our software.
|
|
|
|
|
| |
include stdint.h for int64_t and use netinet/in.h and not
netinet/ip.h for getting sockaddr_in and such.
|
|
|
|
|
|
|
|
|
| |
timer.c:27:23: warning: tentative definition of variable with internal linkage has incomplete
non-array type 'struct timeval' [-Wtentative-definition-incomplete-type]
static struct timeval nearest;
^
timer.c:27:15: note: forward declaration of 'struct timeval'
static struct timeval nearest;
|
|
|
|
| |
Sponsored-by: On-Waves ehi
|
|
|
|
|
|
|
| |
For the atoi we need to pass the val as a string. This means
we need to write "0" which then gets parsed to 0.
[src/vty/stats_vty.c:90]: (error) Possible null pointer dereference: val
|
|
|
|
|
|
|
|
| |
we need to put the default value into inaddr and not put a
32bit value into the addr pointer.
Spotted by cppcheck:
[src/stats.c:231]: (error) Uninitialized variable: inaddr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Nothing is being done with these return values. Remove them
for now and update the TODO entry that is present at two of
the three places.
stats.c: In function ‘rate_ctr_handler’:
stats.c:570:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
int rc;
^
stats.c: In function ‘osmo_stat_item_handler’:
stats.c:617:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
int rc;
^
stats.c: In function ‘handle_counter’:
stats.c:651:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
int rc;
|
|
|
|
|
|
|
|
| |
This log level is used by the stats subsystem log reporter to report
statistics to level INFO. Note that the default level of DLSTATS is
NOTICE.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds class_id fields to the rate_ctr and stat_item group
descriptions. The stats reporter code is extended to only process
groups whose class_id does not exceed a per reporter max_class level.
If the class_id is not set, the code assumes 'global' for groups with
idx == 0 and 'subscriber' otherwise.
The following vty command is added to config-stats:
level (global|peer|subscriber) Set the maximum group level
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the unsigned group index value is silently being cast to
(signed) int in the log and statsd reporter code. If the resulting
value is negative (which can happen for instance with MMCTX
counters), the index is assumed to be unset.
This commit changes the affected types to unsigned. The index value 0
is then the only value indicating an unset group.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
Since the the stat_item and stats functions and data types are meant
to be exported, they get an osmo_ prefix.
Sponsored-by: On-Waves ehf
[hfreyther: Prepended the enum values too. This was requested by
Jacob]
|
|
|
|
|
|
|
| |
This reporter passes the measurement values to the logging subsystem
as DSTATS (which is currently DLGLOBAL) level INFO messages.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently case statements are used to select the right reporter
functions. This makes it difficult to add new reporter types,
especially if they are not going to reside in the same file.
This commit introduces per reporter function pointer for
open, close, send_count, and send_item. They are checked for
non-NULL before being called or skipped.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
| |
To support reporters without network configuration, this commit
introduces the have_net_config flag to provide corresponding error
messages.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
Currently the config_write_stats_reporter function does not output
the mtu value, which is fixed by this commit.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the MTU is given, combine several messages into a single UDP
packet until the limit is reached. Flush all reporters after the
values have been scanned.
New vty commands (node config-stats):
mtu <100-65535> Enable multi-metric packets and set the maximum
packet size (in byte)
no mtu Disable multi-metric packets
Note that single messages that are longer than the given MTU (minus
28 octets protocol overhead) will be dropped.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
| |
This commit changes the reporting code to also show all modified
osmo_counter values. Since there is no grouping of these values, the
name string just consists of the optional prefix and the counter
name.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
| |
The osmo_counter_difference returns the counter value difference
since the last call of this function with the given counter object.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
| |
Currently only rate counter are being supported.
This commit adds support for stat items. All groups are polled for
changed values.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
| |
This calls stats_flush in regular intervals which polls the
statistical values and calls the active reporters when values have
changed.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit provides stats configuration similar to the log
configuration.
The following vty commands are added to the config node:
stats reporter statsd Create/Modify a statsd reporter
no stats reporter statsd Remove a statsd reporter
To actually configure a reporter, the config-stats node is entered
when the "stats reporter" command has succeeded. The following new
vty commands are available there:
local-ip ADDR Set the IP address to which we bind locally
no local-ip Do not bind to a certain IP address
remote-ip ADDR Set the remote IP address to which we connect
remote-port <1-65535> Set the remote port to which we connect
prefix PREFIX Set the item/counter name prefix
no prefix Do not use a prefix
enable Enable the reporter
disable Disable the reporter
Sponsored-by: On-Waves ehf
|