00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _PAYLOAD_BLOCK_PROCESSOR_H_
00018 #define _PAYLOAD_BLOCK_PROCESSOR_H_
00019
00020 #include "BlockProcessor.h"
00021
00022 namespace dtn {
00023
00027 class PayloadBlockProcessor : public BlockProcessor {
00028 public:
00030 PayloadBlockProcessor();
00031
00033 int consume(Bundle* bundle,
00034 BlockInfo* block,
00035 u_char* buf,
00036 size_t len);
00037
00038 int generate(const Bundle* bundle,
00039 BlockInfoVec* xmit_blocks,
00040 BlockInfo* block,
00041 const LinkRef& link,
00042 bool last);
00043
00044 bool validate(const Bundle* bundle,
00045 BlockInfoVec* block_list,
00046 BlockInfo* block,
00047 status_report_reason_t* reception_reason,
00048 status_report_reason_t* deletion_reason);
00049
00050 void produce(const Bundle* bundle,
00051 const BlockInfo* block,
00052 u_char* buf,
00053 size_t offset,
00054 size_t len);
00055
00056 void process(process_func* func,
00057 const Bundle* bundle,
00058 const BlockInfo* caller_block,
00059 const BlockInfo* target_block,
00060 size_t offset,
00061 size_t len,
00062 OpaqueContext* context);
00063
00064 bool mutate(mutate_func* func,
00065 Bundle* bundle,
00066 const BlockInfo* caller_block,
00067 BlockInfo* target_block,
00068 size_t offset,
00069 size_t len,
00070 OpaqueContext* context);
00071
00073 };
00074
00075 }
00076
00077 #endif