00001 /* 00002 * SecurityBlock.cpp 00003 * 00004 * Created on: 08.03.2010 00005 * Author: morgenro 00006 */ 00007 00008 #include "ibrdtn/data/SecurityBlock.h" 00009 #include "ibrcommon/thread/MutexLock.h" 00010 00011 namespace dtn 00012 { 00013 namespace data 00014 { 00015 SecurityBlock::SecurityBlock(SecurityBlock::BLOCK_TYPES type) 00016 : Block(type) 00017 { 00018 00019 } 00020 00021 SecurityBlock::SecurityBlock(SecurityBlock::BLOCK_TYPES type, ibrcommon::BLOB::Reference) 00022 : Block(type) 00023 { 00024 00025 } 00026 00027 SecurityBlock::~SecurityBlock() 00028 { 00029 } 00030 00031 list<EID> SecurityBlock::getEIDList() const 00032 { 00033 std::list<EID> ret; 00034 00035 if (_ciphersuite_flags & CONTINAS_SECURITY_SOURCE) 00036 ret.push_back(_security_source); 00037 00038 if (_ciphersuite_flags & CONTINAS_SECURITY_DESTINATION) 00039 ret.push_back(_security_destination); 00040 00041 return ret; 00042 } 00043 00044 void SecurityBlock::read() 00045 { 00046 // ibrcommon::BLOB::Reference ref = getBLOB(); 00047 // ibrcommon::MutexLock l(ref); 00048 // 00049 // (*ref) >> _ciphersuite_id; 00050 // (*ref) >> _ciphersuite_flags; 00051 // 00052 // if (_ciphersuite_flags & CONTAINS_CORRELATOR) 00053 // (*ref) >> _correlator; 00054 // 00055 // if (_ciphersuite_flags & CONTAINS_CIPHERSUITE_PARAMS) 00056 // (*ref) >> _ciphersuite_params; 00057 // 00058 // if (_ciphersuite_flags & CONTAINS_SECURITY_RESULT) 00059 // (*ref) >> _security_result; 00060 } 00061 00062 void SecurityBlock::commit() 00063 { 00064 // ibrcommon::BLOB::Reference ref = getBLOB(); 00065 // ibrcommon::MutexLock l(ref); 00066 // 00067 // (*ref) << _ciphersuite_id << _ciphersuite_flags; 00068 // 00069 // if (_ciphersuite_flags & CONTAINS_CORRELATOR) 00070 // (*ref) << _correlator; 00071 // 00072 // if (_ciphersuite_flags & CONTAINS_CIPHERSUITE_PARAMS) 00073 // (*ref) << _ciphersuite_params; 00074 // 00075 // if (_ciphersuite_flags & CONTAINS_SECURITY_RESULT) 00076 // (*ref) << _security_result; 00077 } 00078 } 00079 }
1.7.1