Commit graph

15 commits

Author SHA1 Message Date
Felix Walter
37ec79e249 bundle: Implement dedicated bundle validation before further processing
This adds a `bundle_is_valid` function checking for further MUST
constraints defined by the spec., which further processing inside uD3TN
may depend on.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2025-06-05 11:05:47 +02:00
Felix Walter
5795169e54 test/decoder: Properly de-initialize parsers on error
Otherwise memory is leaked so we cannot run negative tests with memory
leak detection (ASAN) enabled.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-10-22 11:00:06 +02:00
Felix Walter
81a34fdaf3 test/decoder: Return a different exit code for parser errors
This enables us to differentiate from sanitizer errors - e.g. the UB
sanitizer returns 1 as exit status.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-10-22 10:53:07 +02:00
Felix Walter
bd74f2864b test/decoder: Remove unnecessary comment
We have implemented all four data types.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-10-22 09:52:30 +02:00
Felix Walter
b4250ffb9d test/decoder: Use correct string format specifier
We have adapted the length fields inside bundles to 64 bits, so we need
to use a 64-bit format specifier here.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-10-22 09:52:05 +02:00
Felix Walter
82f5670f59 test/decoder: Fix stylecheck
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-07-25 13:15:05 +02:00
Fiona Fuchs
f3e07fda05 Add message information for AAP packets, delete unnecessary assertion from AAP parser, fix error in aap_parser.c
Signed-off-by: Fiona Fuchs <fiona.fuchs@d3tn.com>
2023-06-14 13:40:09 +02:00
Fiona Fuchs
2fd20437b4 Change variable name in SPP parser, add AAP parser and AAP example packets, rearrange the example bundles and packets into separate folders by protocol name
Signed-off-by: Fiona Fuchs <fiona.fuchs@d3tn.com>
2023-06-08 13:42:18 +02:00
Fiona Fuchs
433421ec22 Fix assertion error in BPv6-parser, add SPP-parser and SPP example-bundle
Signed-off-by: Fiona Fuchs <fiona.fuchs@d3tn.com>
2023-06-07 15:17:43 +02:00
Fiona Fuchs
e53b5cffed Added BPv6 parser and BPv6 example-bundle
Signed-off-by: Fiona Fuchs <fiona.fuchs@d3tn.com>
2023-05-17 15:51:07 +02:00
Felix Walter
642468f3c8 test/decoder: Do not deinit parser before checking flags
We need to access a parser internal data structure for the CRC check.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-17 11:37:12 +02:00
Felix Walter
72711d297b test/decoder: Add check for invalid CRC in BPv7
Otherwise the program aborts on `ASSERT(result != NULL)` in this case.
See also the BPv7 tests for an explanation of the parser's behavior.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-16 11:34:14 +02:00
Felix Walter
2a86a6adf8 test/decoder: Add license header
Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-16 11:34:14 +02:00
Felix Walter
9907affaf5 test/decoder: Initialize platform to enable logging from RX subsystem
We also need argv to be non-const for this to work. Switching to const
everywhere collides with out handling of command line arguments in
`cmdline.c`.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-16 11:34:14 +02:00
Felix Walter
e16ec4c579 Enable building a BPv7 decoder binary
This adds a target `data-decoder` which builds a binary to decode a
specified binary file using uD3TN's parsing logic (based on the CLA RX
subsystem) and print details about it. In this first version only the
decoding of BPv7 bundles is implemented.

This binary can be used, e.g., for fuzz testing.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2023-05-16 11:34:14 +02:00