30 #include <arpa/inet.h>
32 #ifdef __DEVELOPMENT_ASSERTIONS__
41 #if __BYTE_ORDER == __LITTLE_ENDIAN
44 #define GUINT64_TO_BE(x) bswap_64(x)
46 #include <bits/byteswap.h>
47 #define GUINT64_TO_BE(x) __bswap_64(x)
50 #define GUINT64_TO_BE(x) (x)
59 : dtn::data::DefaultSerializer(stream), _ignore(ignore), _ignore_previous_bundles(ignore != NULL)
70 if (_ignore != NULL) _ignore_previous_bundles =
true;
74 _stream << dtn::data::BUNDLE_VERSION;
77 (*this) << (obj.
procflags & 0x0000000007C1BE);
100 if (_ignore_previous_bundles && (&obj != _ignore))
107 _ignore_previous_bundles =
false;
123 #ifdef __DEVELOPMENT_ASSERTIONS__
129 for (dtn::data::Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
142 }
catch (
const std::bad_cast&) {
156 #ifdef __DEVELOPMENT_ASSERTIONS__
181 length +=
static_cast<uint32_t
>(2 *
sdnv_size);
183 length +=
static_cast<uint32_t
>(
sdnv_size);
200 #ifdef __DEVELOPMENT_ASSERTIONS__
206 for (dtn::data::Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
207 len += it->getString().size();
217 }
catch (
const std::bad_cast&) {
228 uint32_t be = htonl(value);
229 _stream.write(reinterpret_cast<char*>(&be),
sizeof(uint32_t));
235 uint32_t length =
static_cast<uint32_t
>(value.
getString().length());
247 _stream.write(reinterpret_cast<char*>(&be),
sizeof(uint64_t));