ud3tn/include/bundle6/serializer.h
Felix Walter e8a319a277 TX: Allow the bundle serializers to indicate failure if CLA fails
If the write method of the CLA fails, the serailizers will now return
early and this failure is handled properly by the TX task.

In the case of the BPv6 serializer, we add the necessary flow control to
the `write_bytes` macro, to prevent needing a conditional for every
write* or serialize* statement.

Signed-off-by: Felix Walter <felix.walter@d3tn.com>
2024-06-21 12:38:15 +02:00

15 lines
400 B
C

// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
#ifndef BUNDLE6_SERIALIZER_H_INCLUDED
#define BUNDLE6_SERIALIZER_H_INCLUDED
#include "ud3tn/bundle.h"
#include "ud3tn/result.h"
#include <stddef.h>
enum ud3tn_result bundle6_serialize(
struct bundle *bundle,
enum ud3tn_result (*write)(void *cla_obj, const void *, const size_t),
void *cla_obj);
#endif /* BUNDLE6_SERIALIZER_H_INCLUDED */