Commit graph

9 commits

Author SHA1 Message Date
Felix Walter
553cb23bdd Fix constParameter and constVariable warnings by cppcheck
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>
2024-09-11 10:13:21 +02:00
Felix Walter
3c028e22f7 CLA: TCPSPP: Fail on NULL-returning allocations
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>
2023-10-26 14:58:46 +02:00
Felix Walter
7330c79b52 style: Spacing, indentation, long lines, continuations
This harmonizes several style issues found by `checkpatch.pl` when using
strict mode.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-07-25 13:15:05 +02:00
Felix Walter
13b2d78cec SPP: Prevent wrap-around of uint at end of loop
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>
2023-05-10 14:32:47 +02:00
Felix Walter
915051b278 CLA: TCPSPP: Drop SPPs with unknown APID before parsing timecode
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>
2022-11-09 09:30:45 +01:00
Georg Alexander Murzik
298431c68f Insert SPDX license expression comments into our .c, .h, .py, and .sh code
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>
2022-02-20 16:24:38 +01:00
Felix Walter
d5fba6c0f4 spp_parser: Set error state in case of SPP parsing failure
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>
2021-07-30 17:50:03 +02:00
Felix Walter
fb4238a97d Adapt core include path from upcn/ to ud3tn/
This moves all headers from upcn/ to ud3tn/ and adapts the #include
statements accordingly.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2020-11-17 15:51:10 +01:00
Felix Walter
0ce4bee910
Initial import of uPCN v0.8.0 source code
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>
2020-11-14 11:56:40 +01:00