// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0 #ifndef BUNDLE7_REPORTS_INCLUDED #define BUNDLE7_REPORTS_INCLUDED #include "ud3tn/bundle.h" // struct bundle, struct bundle_status_report #include "ud3tn/eid.h" // struct eid #include #include /** * Generates a BPv7 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 prototype a structure containing the type, reason, and timestamps for the status report * to be sent (note that this struct is only read, not modified) * @param source source EID for the status report bundle * @param report_creation_timestamp_ms the DTN time when the SR was generated * * @return a bundle representing the SR, or NULL on error */ struct bundle *bundle7_generate_status_report( const struct bundle *const bundle, const struct bundle_status_report *prototype, const struct eid source, uint64_t report_creation_timestamp_ms); /** * Parses the payload block of the a BPv7-bis administrative record */ struct bundle_administrative_record *bundle7_parse_administrative_record( const uint8_t *const data, const size_t length); void free_record_fields(struct bundle_administrative_record *record); #endif /* BUNDLE7_REPORTS_INCLUDED */