IBR-DTNSuite
0.8
|
00001 /* 00002 * CustodySignalBlock.h 00003 * 00004 * Created on: 05.06.2009 00005 * Author: morgenro 00006 */ 00007 00008 00009 00010 #ifndef CUSTODYSIGNALBLOCK_H_ 00011 #define CUSTODYSIGNALBLOCK_H_ 00012 00013 #include "ibrdtn/data/EID.h" 00014 #include "ibrdtn/data/SDNV.h" 00015 #include "ibrdtn/data/MetaBundle.h" 00016 #include "ibrcommon/data/BLOB.h" 00017 #include "ibrdtn/data/DTNTime.h" 00018 00019 namespace dtn 00020 { 00021 namespace data 00022 { 00023 class CustodySignalBlock : public Block 00024 { 00025 public: 00026 enum REASON_CODE 00027 { 00028 NO_ADDITIONAL_INFORMATION = 0x00, 00029 RESERVED_01 = 0x01, 00030 RESERVED_02 = 0x02, 00031 REDUNDANT_RECEPTION = 0x03, 00032 DEPLETED_STORAGE = 0x04, 00033 DESTINATION_ENDPOINT_ID_UNINTELLIGIBLE = 0x05, 00034 NO_KNOWN_ROUTE_TO_DESTINATION_FROM_HERE = 0x06, 00035 NO_TIMELY_CONTACT_WITH_NEXT_NODE_ON_ROUTE = 0x07, 00036 BLOCK_UNINTELLIGIBLE = 0x08 00037 }; 00038 00039 CustodySignalBlock(); 00040 virtual ~CustodySignalBlock(); 00041 00042 void setMatch(const MetaBundle& other); 00043 void setMatch(const Bundle& other); 00044 bool match(const Bundle& other) const; 00045 00046 virtual size_t getLength() const; 00047 virtual std::ostream &serialize(std::ostream &stream, size_t &length) const; 00048 virtual std::istream &deserialize(std::istream &stream, const size_t length); 00049 00050 char _admfield; 00051 //char _status; 00052 bool _custody_accepted; 00053 REASON_CODE _reason; 00054 SDNV _fragment_offset; 00055 SDNV _fragment_length; 00056 DTNTime _timeofsignal; 00057 SDNV _bundle_timestamp; 00058 SDNV _bundle_sequence; 00059 EID _source; 00060 }; 00061 } 00062 } 00063 00064 #endif /* CUSTODYSIGNALBLOCK_H_ */