Mixe for Privacy and Anonymity in the Internet
CADynamicCascadeConfigurator.hpp
Go to the documentation of this file.
00001 #ifndef __CADYNAMICCASCADECONFIGURATOR__
00002 #define __CADYNAMICCASCADECONFIGURATOR__
00003 
00004 #include "StdAfx.h"
00005 #ifdef DYNAMIC_MIX
00006 
00007 #include "xml/DOM_Output.hpp"
00008 #include "CASocketAddrINet.hpp"
00009 #include "CAInfoServiceAware.hpp"
00010 #include "CAInfoService.hpp"
00011 
00012 struct _proposer_t
00013 {
00014   struct _proposer_t* next;
00015   UINT8* ski;
00016 };
00017 typedef struct _proposer_t PROPOSERENTRY;
00018 typedef struct _proposer_t PROPOSERLIST;
00019 
00020 struct _proposal_t
00021 {
00022   struct _proposal_t* next;
00023   PROPOSERLIST* proposers;
00024   UINT8* proposal;
00025   UINT32 count;
00026   DOM_Node elem;
00027 };
00028 typedef struct _proposal_t PROPOSALENTRY;
00029 typedef struct _proposal_t PROPOSALLIST;
00030 
00031 
00032 #define MIN_MAJORITY_QUOTE(x) (UINT32)((2*x)/3)+1
00033 #define MAX_CONTENT_LENGTH 0x00FFFF
00034 
00035 class CADynamicCascadeConfigurator : CAInfoServiceAware
00036 {
00037 
00038 public:
00039   CADynamicCascadeConfigurator(CASignature *a_pSignature, CAMix *a_pMix);
00040 
00041   ~CADynamicCascadeConfigurator();
00042   SINT32 configure();
00043   
00044 
00045 private:
00046   PROPOSALLIST* m_proposals;
00047   SINT32 getMajorityVote(UINT32 a_nrInfoServices, DOM_Node *&r_majorityElem, UINT8* r_strProposal);
00048   SINT32 addProposal(DOM_Element a_elem);
00049   PROPOSALENTRY *createProposal(UINT8* a_strProposal, UINT32 a_lenProposal, UINT8 *a_strProposer, UINT32 a_lenProposer, DOM_Element *a_elem);
00050   SINT32 reconfigureMix(DOM_Node a_elemNewCascade, UINT8* a_strProposal);
00051   CASignature *m_pSignature;
00052   CAMix *m_pMix;
00053 };
00054 #endif //DYNAMIC_MIX
00055 #endif