• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ibrdtn/ibrdtn/data/SecurityBlock.h

Go to the documentation of this file.
00001 /*
00002  * SecurityBlock.h
00003  *
00004  *  Created on: 08.03.2010
00005  *      Author: morgenro
00006  */
00007 
00008 #ifndef SECURITYBLOCK_H_
00009 #define SECURITYBLOCK_H_
00010 
00011 #include "ibrdtn/data/Block.h"
00012 #include "ibrdtn/data/EID.h"
00013 #include "ibrdtn/data/SDNV.h"
00014 #include "ibrdtn/data/BundleString.h"
00015 #include <ibrcommon/data/BLOB.h>
00016 #include <list>
00017 
00018 namespace dtn
00019 {
00020         namespace data
00021         {
00022                 class SecurityBlock : public Block
00023                 {
00024                 public:
00025                         enum BLOCK_TYPES
00026                         {
00027                                 BUNDLE_AUTHENTICATION_BLOCK = 0x02,
00028                                 PAYLOAD_INTEGRITY_BLOCK = 0x03,
00029                                 PAYLOAD_CONFIDENTIAL_BLOCK = 0x04,
00030                                 EXTENSION_SECURITY_BLOCK = 0x09
00031                         };
00032 
00033                         enum CIPHERSUITE_FLAGS
00034                         {
00035                                 CONTAINS_SECURITY_RESULT = 1 << 0,
00036                                 CONTAINS_CORRELATOR = 1 << 1,
00037                                 CONTAINS_CIPHERSUITE_PARAMS = 1 << 2,
00038                                 CONTINAS_SECURITY_DESTINATION = 1 << 3,
00039                                 CONTINAS_SECURITY_SOURCE = 1 << 4,
00040                                 BIT5_RESERVED = 1 << 5,
00041                                 BIT6_RESERVED = 1 << 6
00042                         };
00043 
00044                         virtual ~SecurityBlock() = 0;
00045 
00046                         virtual std::list<dtn::data::EID> getEIDList() const;
00047 
00048                 protected:
00049                         SecurityBlock(SecurityBlock::BLOCK_TYPES type);
00050                         SecurityBlock(SecurityBlock::BLOCK_TYPES type, ibrcommon::BLOB::Reference ref);
00051 
00052                         virtual void read();
00053                         virtual void commit();
00054 
00055                         dtn::data::EID _security_source;
00056                         dtn::data::EID _security_destination;
00057 
00058                         dtn::data::SDNV _ciphersuite_id;
00059                         dtn::data::SDNV _ciphersuite_flags;
00060                         dtn::data::SDNV _correlator; // optional
00061 
00062                         dtn::data::BundleString _ciphersuite_params; // optional
00063                         dtn::data::BundleString _security_result; // optional
00064 
00065                 private:
00069                         virtual void addEID(dtn::data::EID) {};
00070                 };
00071 
00072                 class BundleAuthenticationBlock : public SecurityBlock
00073                 {
00074                 public:
00075                         BundleAuthenticationBlock() : SecurityBlock(BUNDLE_AUTHENTICATION_BLOCK) {};
00076                         virtual ~BundleAuthenticationBlock() {};
00077                         static const char BLOCK_TYPE = SecurityBlock::BUNDLE_AUTHENTICATION_BLOCK;
00078                 };
00079 
00080                 class PayloadIntegrityBlock : public SecurityBlock
00081                 {
00082                 public:
00083                         PayloadIntegrityBlock() : SecurityBlock(PAYLOAD_INTEGRITY_BLOCK) {};
00084                         virtual ~PayloadIntegrityBlock() {};
00085                         static const char BLOCK_TYPE = SecurityBlock::PAYLOAD_INTEGRITY_BLOCK;
00086                 };
00087 
00088                 class PayloadConfidentialBlock : public SecurityBlock
00089                 {
00090                 public:
00091                         PayloadConfidentialBlock() : SecurityBlock(PAYLOAD_CONFIDENTIAL_BLOCK) {};
00092                         virtual ~PayloadConfidentialBlock() {};
00093                         static const char BLOCK_TYPE = SecurityBlock::PAYLOAD_CONFIDENTIAL_BLOCK;
00094                 };
00095         }
00096 }
00097 
00098 
00099 #endif /* SECURITYBLOCK_H_ */

Generated on Thu Nov 11 2010 09:49:47 for IBR-DTNSuite by  doxygen 1.7.1