#include <BundleTLV.h>
Definition at line 28 of file BundleTLV.h.
Public Types | |
enum | bundletlv_flags_t { CUSTODY = 1 << 0, ACCEPTED = 1 << 1, ACK = 1 << 7 } |
Flag values for Bundle Offer/Response Entry p. More... | |
Public Member Functions | |
virtual | ~BundleTLV () |
Destructor. | |
Public Attributes | |
struct prophet::BundleTLV::BundleTLVHeader | packed |
Bundle Offer/Response Header p. | |
struct prophet::BundleTLV::BundleEntry | packed |
Bundle Offer/Response Entry p. | |
Static Public Attributes | |
static const size_t | BundleTLVHeaderSize = sizeof(struct BundleTLVHeader) |
static const size_t | BundleEntrySize = sizeof(struct BundleEntry) |
Protected Member Functions | |
BundleTLV (BaseTLV::prophet_tlv_t type=BaseTLV::UNKNOWN_TLV, u_int8_t flags=0, u_int16_t length=0) | |
Constructor. | |
size_t | write_bundle_entry (u_int32_t cts, u_int32_t seq, u_int16_t sid, bool custody, bool accept, bool ack, BundleTLVEntry::bundle_entry_t type, u_char *bp, size_t len) const |
Serialize BundleOfferTLVEntry out to no more than len bytes of buffer; return bytes written. | |
size_t | read_bundle_entry (u_int32_t *cts, u_int32_t *seq, u_int16_t *sid, bool *custody, bool *accept, bool *ack, BundleTLVEntry::bundle_entry_t *type, const u_char *bp, size_t len) |
Deserialize struct BundleOfferTLVEntry from transport into memory, reading no more than len bytes from buffer; return bytes read. | |
Classes | |
struct | BundleEntry |
Bundle Offer/Response Entry p. More... | |
struct | BundleTLVHeader |
Bundle Offer/Response Header p. More... |
Flag values for Bundle Offer/Response Entry p.
31, 4.4.5
CUSTODY | custody offered or accepted on this bundle |
ACCEPTED | this bundle is accepted for relay |
ACK | Prophet ACK for this bundle. |
Definition at line 108 of file BundleTLV.h.
virtual prophet::BundleTLV::~BundleTLV | ( | ) | [inline, virtual] |
prophet::BundleTLV::BundleTLV | ( | BaseTLV::prophet_tlv_t | type = BaseTLV::UNKNOWN_TLV , |
|
u_int8_t | flags = 0 , |
|||
u_int16_t | length = 0 | |||
) | [inline, protected] |
Constructor.
Protected to force access through derived classes.
Definition at line 127 of file BundleTLV.h.
size_t prophet::BundleTLV::write_bundle_entry | ( | u_int32_t | cts, | |
u_int32_t | seq, | |||
u_int16_t | sid, | |||
bool | custody, | |||
bool | accept, | |||
bool | ack, | |||
BundleTLVEntry::bundle_entry_t | type, | |||
u_char * | bp, | |||
size_t | len | |||
) | const [protected] |
Serialize BundleOfferTLVEntry out to no more than len bytes of buffer; return bytes written.
Definition at line 23 of file BundleTLV.cc.
References ACCEPTED, ACK, prophet::BundleTLV::BundleEntry::b_flags, BundleEntrySize, prophet::BundleTLV::BundleEntry::creation_timestamp, CUSTODY, prophet::BundleTLV::BundleEntry::dest_string_id, prophet::BundleTLV::BundleEntry::seqno, and prophet::BundleTLVEntry::UNDEFINED.
Referenced by prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
size_t prophet::BundleTLV::read_bundle_entry | ( | u_int32_t * | cts, | |
u_int32_t * | seq, | |||
u_int16_t * | sid, | |||
bool * | custody, | |||
bool * | accept, | |||
bool * | ack, | |||
BundleTLVEntry::bundle_entry_t * | type, | |||
const u_char * | bp, | |||
size_t | len | |||
) | [protected] |
Deserialize struct BundleOfferTLVEntry from transport into memory, reading no more than len bytes from buffer; return bytes read.
Definition at line 49 of file BundleTLV.cc.
References ACCEPTED, ACK, prophet::BundleTLV::BundleEntry::b_flags, BundleEntrySize, prophet::BundleTLV::BundleEntry::creation_timestamp, CUSTODY, prophet::BundleTLVEntry::decode_flags(), prophet::BundleTLV::BundleEntry::dest_string_id, prophet::BaseTLV::flags(), and prophet::BundleTLV::BundleEntry::seqno.
Referenced by prophet::ResponseTLV::deserialize(), and prophet::OfferTLV::deserialize().
Bundle Offer/Response Header
p.
30, 4.4.5
After the routing information has been passed, the node will ask the other node to review available bundles and determine which bundles it will accept for relay. The source relay will determine which bundles to offer based on relative delivery predictabilities as explained in Section 3.6. The Bundle Offer TLV also lists the bundles that a PRoPHET acknowledgement has been issued for. Those bundles have the PRoPHET ACK flag set in their entry in the list. When a node receives a PRoPHET ACK for a bundle, it MUST remove any copies of that bundle from its buffers, but SHOULD keep an entry of the acknowledged bundle to be able to further propagate the PRoPHET ACK.
The Response message is identical to the request message with the exception that the flag indicate acceptance of the bundle.
Bundle Offer/Response Entry p.
30, 4.4.5
const size_t prophet::BundleTLV::BundleTLVHeaderSize = sizeof(struct BundleTLVHeader) [static] |
Definition at line 114 of file BundleTLV.h.
Referenced by prophet::ResponseTLV::deserialize(), prophet::OfferTLV::deserialize(), prophet::ResponseTLV::serialize(), and prophet::OfferTLV::serialize().
const size_t prophet::BundleTLV::BundleEntrySize = sizeof(struct BundleEntry) [static] |
Definition at line 116 of file BundleTLV.h.
Referenced by prophet::ResponseTLV::deserialize(), prophet::OfferTLV::deserialize(), read_bundle_entry(), prophet::ResponseTLV::serialize(), prophet::OfferTLV::serialize(), and write_bundle_entry().