This improves const correctness, at least for pointers (making the
pointed-to data const where possible).
Some suppressions are added for false positive warnings, such as in
`simple_queue.c` where an arithmethic operation is used on the pointer
to calculate a non-const pointer that is returned (thus, the passed
pointer should also not point to const).
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Although malloc() can never fail on Linux it might fail on other systems
we might target in the future, such as microcotnrollers.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
Not strictly necessary, but will prevent the value going below zero and
wrapping around after the loop finished.
Found by Clang's UB sanitizer.
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
We do not need to parse the timecode to drop SPP frames that do not
belong to us. This makes the SPP parser return on every change of its
internal state (as it is called again by the CLA methods, this is a
totally valid mode of operation) and check the APID early in the CLA
methods.
By that we also support receiving SPPs that use different formats to
other APIDs (e.g., without any timecode in case we are expecting a
timecode).
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
ud3tn is available under multiple licenses and we want to reflect this in
our source code. But which license information should appear first and how
can we manage this efficiently in the future? The Linux Kernel uses SPDX
expressions instead of boilerplate sections. This seems to be a great
approach, so we do the same here.
Signed-off-by: Georg Alexander Murzik <georg.murzik@d3tn.com>
See #62 - we did not force a parser reset by setting an error state in
case of timecode read errors and unsupported features such as ancillary
data. This properly handles both cases, ensuring that we don't
indefinitely hang in the parsing state and also do not abort due to an
invalid state.
Fixes: #62
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
This is the initial commit for uD3TN. uD3TN is a fork of uPCN v0.8.0,
which will be developed and maintained in a public Git repository.
For questions concerning the history of and code provided with uPCN,
please get in touch with us via: contact <at> d3tn <dot> com
Signed-off-by: Felix Walter <felix.walter@d3tn.com>