mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-13 12:33:27 +02:00
In outgoing status reports, previously, we did not send timestamps, even in case they were requested for BPv7 bundles. This refactors the corresponding functions to generate status reports, so we assign the proper timestamp depending on the status flag. Note that we never supported sending a status report capturing multiple events at once -- only the BPv7 SR serializer supports the generation. Signed-off-by: Felix Walter <felix.walter@d3tn.com>
38 lines
1.3 KiB
C
38 lines
1.3 KiB
C
// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
|
|
#ifndef BUNDLE6_REPORTS_INCLUDED
|
|
#define BUNDLE6_REPORTS_INCLUDED
|
|
|
|
#include "ud3tn/bundle.h" // struct bundle, struct bundle_status_report
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
/**
|
|
* Generates a RFC 5050 administrative record bundle of type
|
|
* "Bundle status report" for the given bundle that can be sent
|
|
* to the Report-To EID.
|
|
*
|
|
* @param bundle Bundle for which the status report should be created
|
|
* @param status the status report status flags; note that only one bit must be set
|
|
* @param reason the status report reason code
|
|
* @param source source EID for the status report bundle
|
|
* @param status_timestamp_ms the DTN time when the SR was generated (typically the current time)
|
|
*
|
|
* @return a bundle representing the SR, or NULL on error
|
|
*/
|
|
struct bundle *bundle6_generate_status_report(
|
|
const struct bundle *const bundle,
|
|
enum bundle_status_report_status_flags status,
|
|
enum bundle_status_report_reason reason,
|
|
const struct eid source,
|
|
uint64_t status_timestamp_ms);
|
|
|
|
|
|
/**
|
|
* Parses the payload block of the a RFC 5050 administrative record
|
|
*/
|
|
struct bundle_administrative_record *bundle6_parse_administrative_record(
|
|
const uint8_t *const data, const size_t length);
|
|
|
|
|
|
#endif /* BUNDLE6_REPORTS_INCLUDED */
|