For some reason gcc 10.2.1 complains about this instance with
control_ng_flags_parser.c: In function ‘parse_transports’:
control_ng_flags_parser.c:299:2: warning: missing initializer for field ‘remainder’ of ‘rtpp_pos’ [-Wmissing-field-initializers]
299 | call_ng_main_flags(&dummy_parser, &STR_CONST("transport-protocol"), &(rtpp_pos) {.cur = STR(val)}, out);
| ^~~~~~~~~~~~~~~~~~
In file included from ./log.h:7,
from ../lib/obj.h:105,
from ../include/control_ng_flags_parser.h:7,
from control_ng_flags_parser.c:1:
../include/types.h:48:6: note: ‘remainder’ declared here
48 | str remainder;
| ^~~~~~~~~
but doesn't complain about other instances of the same usage. Oh well.
Make it shut up.
Change-Id: I6989e3c63b075b6c8f258a824557b767123dc0f6
These functions expect a `rtpp_pos` argument, and while `str` is
compatible through the union, it lacks the second member of the struct,
which ends up uninitialised. Use the correct type through temporary
objects instead.
Change-Id: I0c553bdbb31c351346746b6072f2d424113bac5a
Convenience wrapper for &STR()
This is useful so that STR() and STR_DUP() can be extended to avoid
duplicate expansion of its macro arguments.
Change-Id: Ieae170807c11b0cdd8b52fac9bab98dccdc2b951
If there are no more tokens, instead of returning a null string as
remainder, set the remainder to the end of the original string with a
zero length.
Update two places in the code where this makes a difference.
Change-Id: I137fbce3e7d88ccba65f6b23a36aa1dfbbd3867e
Use str_cmp() to implement str_eq()
Use str_shift_cmp() in place of str_prefix()
Update return types to bool
Change-Id: If7927d957e20780408e77da1d04baffa082a6914
Obsolete str_init(), rename STR_INIT() to just STR(), and replace all
instances of str_init() with STR().
no-op
Change-Id: I981529063ad2ea26089add467f7a84b638dbf423
`delete-delay` is already parsed using bencode_dictionary_get_int_str()
so we don't need to special-handle string type values
Change-Id: If9758ccfbbe18674b7731aa53b9de5bd3fd87ae4
The function in charge of processing codec flags can already handle
standalone string values and doesn't require a list to wrap single
strings.
Change-Id: Id9bc97d455c75a3d1b0a19c5dbe43f677c937401
Use two invocations of str_token_sep instead of strpbrk + strchr. Remove
remnants of C-style string parsing.
Change-Id: Id7aa27dc4e8f77398cc4d7d93847a45eee0a329e
Deprecate a usage of intermediate dictionary for parsing
of rtpp flags. Just use the `call_ng_main_flags()` function
directly with a given `bencode_buffer_t` buffer.
Change-Id: I0bea13b94b6e0016799dd07a50061e1367131106
Switch the rest of flags (with non-specific processing)
to direct parsing or deprecate specific parsing at all
and let it be parsed as generic one (key/val).
Deprecated for:
- `TOS`
- `to-tag`
- `call-id`
- `via-branch`
Left for:
- `from-tag` (requires directional flag setting)
- `delete-delay` (uses int bencode object, because the
`call_delete_ng()` requires it in this format)
Change-Id: I0c5cb173bae09064f8177298aef3d070132f84cf
Deprecate parsing of generic flags using `new_list_to_dict()`.
Leaving it only for `received-from` as it requires special
handling. Function signature is adopted accordingly.
The funciton itself calls the `call_ng_main_flags()` directly,
without really using intermediate bencode objects.
Change-Id: I320761a4b84da0128981f9b65e3ba69e9b4018ac
Direction parsing.
Instead of adding key/val flags to the dictionary for
further parsing later via iteration in `call_ng_main_flags()`,
just call the `call_ng_main_flags()` directly.
Change-Id: Ide137aed12a6ba416b59a307a0a11a934f78a858
Codec related flags parsing.
A bencode list for codec related flags keeping (while
parsing in `parse_rtpp_flags()` ), is removed due to no need.
Instead of adding key/val flags to the dictionary for
further parsing later via iteration in `call_ng_main_flags()`,
just call the `call_ng_codec_flags()` directly.
Change-Id: I1adcea84e9254ae35e6480d61426f1434513e779
Transport parsing.
Instead of adding key/val flags to the dictionary for
further parsing later via iteration in `call_ng_main_flags()`,
just call the `call_ng_main_flags()` directly.
Change-Id: I86a2d6855bcd94edb206c632d8288dd769e94ba8
Instead of adding key/val flags to the dictionary for
further parsing later via iteration in `call_ng_main_flags()`,
just call the `call_ng_main_flags()` directly.
Change-Id: Ia893a6b50db7a0659a42c09463169f2c0f5e595e
Since the generic flags parsing is done (from now on) directly
in the `parse_rtpp_flags()`, there is no need to keep a separate
bencode list object to store them, which was originally intended
to be used later for parsing in `call_ng_flags_flags()`,
but not the case anymore.
Change-Id: I7898e29cabecfd6e8429c064d7b5904d94c50513
It's a useful function for parsing flags, which
we most probably will need in the future, but unsed now.
Change-Id: I3bed7b52e565a24f4ea8ee791a5872ad9cb06228
During the parsing of `rtpp_flags` use the
`call_ng_flags_flags()` directly instead of the
`bencode_list_add_str()`, hence reduce amount
of iterations required to parse generic flags.
Additionally:
`call_ng_flags_flags()` is made visible for usage
within external files.
`helper_arg` union has been moved to the header.
Change-Id: I34399a0d3940a1276feb1210e4421cbcdf656e9d
Is added by:
- explicit generic flag "directionl"; or
- if the "from-tag" flag is used
Introduce the `directional` flag for `sdp_ng_flags` struct.
In use by:
- `media_block_match1()`
Additionally:
add `IS_OP_DIRECTIONAL()` marco check.
Change-Id: Ifd56ea2ad8277d7dec136def1c028c5e2b680ff1
Add support of rtpp_flags parsing for the daemon.
From now on, it's possible to parse option flags
on the daemon side instead of the kamailio module.
It's identical to what the module does, but the
difference is:
- module sends general call identification such as:
call-id, From/To tags, viabranch using bencode
- meanwhile all generic/non-generic option flags
are added to the `rtpp_flags` bencode member as str
- parsing of that is done as usually using the
`call_ng_main_flags()` / `call_ng_flags_flags()`
and additionally using new parser `parse_rtpp_flags()`
New file implementation and header introduced:
- control_ng_flags_parser.c
- control_ng_flags_parser.h
Otherwise no functional changes, and the parsing itself
remains working following the same algorithm.
Change-Id: I59e47fa1947e2aeaa0bbf3930a0f21d9a6d669ad