ud3tn/include/bundle6/bundle6.h
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

58 lines
1.6 KiB
C

// SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
#ifndef BUNDLE6_BUNDLE6_H_INCLUDED
#define BUNDLE6_BUNDLE6_H_INCLUDED
#include "ud3tn/bundle.h"
#include <stddef.h>
#include <stdint.h>
struct bundle6_eid_reference {
uint16_t scheme_offset;
uint16_t ssp_offset;
};
struct bundle6_eid_info {
const char *str_ptr;
const char *ssp_ptr;
uint16_t dict_scheme_offset;
uint16_t dict_ssp_offset;
};
struct bundle6_dict_descriptor {
size_t dict_length_bytes;
size_t eid_reference_count;
struct bundle6_eid_info destination_eid_info;
struct bundle6_eid_info source_eid_info;
struct bundle6_eid_info report_to_eid_info;
struct bundle6_eid_info custodian_eid_info;
// can be written out by memcopying parts and appending zero terminators
struct bundle6_eid_info eid_references[];
};
/**
* Serializes the bundle dictionary into the given buffer
*/
void bundle6_serialize_dictionary(char *buf,
const struct bundle6_dict_descriptor *desc);
// ----------------------
// Bundle and block sizes
// ----------------------
size_t bundle6_get_dict_length(struct bundle *bundle);
struct bundle6_dict_descriptor *bundle6_calculate_dict(struct bundle *bundle);
void bundle6_recalculate_header_length(struct bundle *bundle);
size_t bundle6_get_serialized_size(struct bundle *bundle);
// -------------------
// Fragmentation sizes
// -------------------
size_t bundle6_get_first_fragment_min_size(struct bundle *bundle);
size_t bundle6_get_mid_fragment_min_size(struct bundle *bundle);
size_t bundle6_get_last_fragment_min_size(struct bundle *bundle);
#endif /* BUNDLE6_BUNDLE6_H_INCLUDED */