There is enough overlap between the two enums that it doesn't make sense
to carry along both. Unify.
Change-Id: I9de8fbdb8d78a2002d8c1b62cea57188c937d61d
Keep two separate timestamps, one updated by userspace code only and the
other updated by kernel only. This way we can tell where the packet
processing happens. For code that wants to report only the last
timestamp regardless of which one of the two it is, we add a convenience
function that just returns the newer one.
Change-Id: Ib3af7aa55006d8b32e2bc3db4f8bfa5514c57e40
Allocate memory from bufferpool for per-stream stats. No functional
change, but it allows sharing these between kernel and user space.
Change-Id: I370a49e1d94bb91c7fd0a2bc7d00ba65f99c4f6a
This has been broken for a while and nobody seems to be using it since
nobody complained. Remove it.
Change-Id: I114e7b1859ecd1982338c625f4523f372af3bbe8
In the file implementations follow the rules:
1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least one empty row before the code.
In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.
Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9
Start using the media subscriptions model
(based on newly introduced `media_subscription` objects)
in scope of `cdr_update_entry()`.
Change-Id: I0618a1ee51ec8ea208839da2de46781242287a12
Using a pointer array instead of a linked lists allows us to directly
reference a media section by index number, without having to spool into
the linked list.
No functional changes.
Change-Id: I8b0e93f0c2e9addbcb4c938894118ed4a6aec768
libcs are implementing changes to fix the year 2038 issue on 32 bit
platforms (see [1]). musl libc already went ahead and implemented it,
starting with musl-1.2.0 (see [2]).
This commit adds a new definition to lib/loglib.h:
TIME_T_INT_FMT
If __USE_TIME_BITS64 is defined (by a time64 libc, see [1]), it's set to
the proper conversions for type int64_t, PRId64. If __USE_TIME_BITS64 is
not defined, the status quo remains unchanged ("%ld" is used).
The new definition is used in the different parts of rtpengine, where
appropriate.
Note: Richard confirmed that the "%u" format in daemon/cdr.c is not
needed, so this gets swept under the rug.
These changes get rid of the new warnings that appeared with musl-1.2.0.
Below an example warning:
In file included from ./log.h:6,
from ../include/obj.h:94,
from ../include/media_socket.h:9,
from ../include/call.h:26,
from ../include/redis.h:15,
from redis.c:1:
redis.c: In function 'redis_check_conn':
../lib/loglib.h:56:30: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'time_t' {aka 'long long int'} [-Wformat=]
56 | __ilog(prio, "[%s] " fmt, log_level_names[system], ##__VA_ARGS__); \
| ^~~~~~~
../lib/loglib.h:64:39: note: in expansion of macro 'ilogsn'
64 | #define ilogs(system, prio, fmt, ...) ilogsn(log_level_index_ ## system, prio, fmt, ##__VA_ARGS__)
| ^~~~~~
../lib/loglib.h:63:30: note: in expansion of macro 'ilogs'
63 | #define ilog(prio, fmt, ...) ilogs(core, prio, fmt, ##__VA_ARGS__)
| ^~~~~
redis.c:887:17: note: in expansion of macro 'ilog'
887 | ilog(LOG_WARNING, "Redis server %s is disabled. Don't try RE-Establishing for %ld more seconds",
| ^~~~
[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[2] https://musl.libc.org/time64.html
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
The AUTO_CLEANUP_INIT() macro is already allocating a string for this
variable, which we were then overwriting and thus leaking.
Change-Id: If655c867c5666c6cff6311f01e617647375f6279
Warned-by: coverity