00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _CIPHERSUITE_PS2_H_
00018 #define _CIPHERSUITE_PS2_H_
00019
00020 #ifdef BSP_ENABLED
00021
00022 #include <oasys/util/ScratchBuffer.h>
00023 #include "bundling/BlockProcessor.h"
00024 #include "PS_BlockProcessor.h"
00025
00026 namespace dtn {
00027
00028 struct PrimaryBlock_ex;
00029
00033 class Ciphersuite_PS2 : public Ciphersuite {
00034 public:
00035 typedef oasys::ScratchBuffer<u_char*, 64> DataBuffer;
00036
00038 Ciphersuite_PS2();
00039
00040 virtual u_int16_t cs_num();
00041
00043
00059 virtual int consume(Bundle* bundle,
00060 BlockInfo* block,
00061 u_char* buf,
00062 size_t len);
00063
00070 virtual bool validate(const Bundle* bundle,
00071 BlockInfoVec* block_list,
00072 BlockInfo* block,
00073 status_report_reason_t* reception_reason,
00074 status_report_reason_t* deletion_reason);
00075
00084 virtual int prepare(const Bundle* bundle,
00085 BlockInfoVec* xmit_blocks,
00086 const BlockInfo* source,
00087 const LinkRef& link,
00088 list_owner_t list);
00089
00095 virtual int generate(const Bundle* bundle,
00096 BlockInfoVec* xmit_blocks,
00097 BlockInfo* block,
00098 const LinkRef& link,
00099 bool last);
00100
00108 virtual int finalize(const Bundle* bundle,
00109 BlockInfoVec* xmit_blocks,
00110 BlockInfo* block,
00111 const LinkRef& link);
00112
00116 static void digest(const Bundle* bundle,
00117 const BlockInfo* caller_block,
00118 const BlockInfo* target_block,
00119 const void* buf,
00120 size_t len,
00121 OpaqueContext* r);
00122
00126 static void create_digest(const Bundle* bundle,
00127 BlockInfoVec* block_list,
00128 BlockInfo* block,
00129 DataBuffer& db);
00130
00134 static int read_primary(const Bundle* bundle,
00135 BlockInfo* block,
00136 PrimaryBlock_ex& primary,
00137 char** dict);
00138
00142 enum { CSNUM_PS2 = 2 };
00143
00145 };
00146
00147 }
00148
00149 #endif
00150
00151 #endif