36 #ifdef __DEVELOPMENT_ASSERTIONS__
45 : _stream(stream), _compressable(false)
50 : _stream(stream), _dictionary(d), _compressable(false)
77 const Block &b = (**iter);
109 bool post_payload =
false;
113 const Block &b = (**iter);
124 }
catch (
const std::bad_cast&) {
151 const Block &b = (**iter);
152 const std::list<dtn::data::EID> eids = b.
getEIDList();
154 for (std::list<dtn::data::EID>::const_iterator eit = eids.begin(); eit != eids.end(); ++eit)
170 _stream << dtn::data::BUNDLE_VERSION;
187 primaryheader[0] = ref.first;
188 primaryheader[1] = ref.second;
192 primaryheader[2] = ref.first;
193 primaryheader[3] = ref.second;
197 primaryheader[4] = ref.first;
198 primaryheader[5] = ref.second;
202 primaryheader[6] = ref.first;
203 primaryheader[7] = ref.second;
206 primaryheader[11] = 0;
212 primaryheader[0] = ref.first;
213 primaryheader[1] = ref.second;
217 primaryheader[2] = ref.first;
218 primaryheader[3] = ref.second;
222 primaryheader[4] = ref.first;
223 primaryheader[5] = ref.second;
227 primaryheader[6] = ref.first;
228 primaryheader[7] = ref.second;
235 for (
int i = 0; i < 12; ++i)
256 for (
int i = 0; i < 11; ++i)
288 #ifdef __DEVELOPMENT_ASSERTIONS__
296 for (Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
302 offsets = (*it).getCompressed();
331 #ifdef __DEVELOPMENT_ASSERTIONS__
339 for (Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
345 offsets = (*it).getCompressed();
359 Length remain = payload_size - clip_offset;
362 if (payload_size < clip_offset)
369 if (remain > clip_length)
402 const Block &b = (**iter);
413 len +=
sizeof(dtn::data::BUNDLE_VERSION);
424 primaryheader[0] = ref.first;
425 primaryheader[1] = ref.second;
429 primaryheader[2] = ref.first;
430 primaryheader[3] = ref.second;;
434 primaryheader[4] = ref.first;
435 primaryheader[5] = ref.second;;
439 primaryheader[6] = ref.first;
440 primaryheader[7] = ref.second;;
443 primaryheader[11] =
Number(0);
449 primaryheader[0] = ref.first;
450 primaryheader[1] = ref.second;;
454 primaryheader[2] = ref.first;
455 primaryheader[3] = ref.second;;
459 primaryheader[4] = ref.first;
460 primaryheader[5] = ref.second;;
464 primaryheader[6] = ref.first;
465 primaryheader[7] = ref.second;;
480 for (
int i = 0; i < 11; ++i)
520 #ifdef __DEVELOPMENT_ASSERTIONS__
528 for (Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
531 len += offsets.first.getLength();
532 len += offsets.second.getLength();
547 : _stream(stream), _validator(_default_validator), _compressed(false), _fragmentation(false)
552 : _stream(stream), _validator(v), _compressed(false), _fragmentation(false)
557 : _stream(stream), _validator(_default_validator), _dictionary(d), _compressed(false), _fragmentation(false)
563 _fragmentation = val;
575 bool lastblock =
false;
584 while (!
_stream.eof() && !lastblock)
587 _stream.get((
char&)block_type);
598 (*this).read(obj, block);
627 for (
unsigned int i = 0; eidcount > i; ++i)
640 _stream.ignore(block_size.get<std::streamsize>());
664 obj.
offset = pb.fragmentoffset;
692 for (
int i = 0; i < 4; ++i)
712 obj.
destination = _dictionary.get(ref[0].first, ref[0].second);
713 obj.
source = _dictionary.get(ref[1].first, ref[1].second);
714 obj.
reportto = _dictionary.get(ref[2].first, ref[2].second);
715 obj.
custodian = _dictionary.get(ref[3].first, ref[3].second);
747 for (
unsigned int i = 0; eidcount > i; ++i)
759 obj.
addEID( _dictionary.
get(scheme, ssp) );
785 for (
unsigned int i = 0; eidcount > i; ++i)
797 obj.
addEID( _dictionary.
get(scheme, ssp) );
858 #ifdef __DEVELOPMENT_ASSERTIONS__
866 for (Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
892 #ifdef __DEVELOPMENT_ASSERTIONS__
900 for (Block::eid_list::const_iterator it = eids.begin(); it != eids.end(); ++it)
930 _stream.get((
char&)block_type);
944 for (
unsigned int i = 0; eidcount > i; ++i)