Mixe for Privacy and Anonymity in the Internet
CALocalProxy.hpp
Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2000, The JAP-Team 
00003 All rights reserved.
00004 Redistribution and use in source and binary forms, with or without modification, 
00005 are permitted provided that the following conditions are met:
00006 
00007   - Redistributions of source code must retain the above copyright notice, 
00008     this list of conditions and the following disclaimer.
00009 
00010   - Redistributions in binary form must reproduce the above copyright notice, 
00011     this list of conditions and the following disclaimer in the documentation and/or 
00012     other materials provided with the distribution.
00013 
00014   - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors 
00015     may be used to endorse or promote products derived from this software without specific 
00016     prior written permission. 
00017 
00018   
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS 
00020 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
00021 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
00022 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
00024 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
00025 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
00026 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
00027 */
00028 #ifndef __CALOCALPROXY__
00029 #define __CALOCALPROXY__
00030 
00031 #include "CAMix.hpp"
00032 #include "CAMuxSocket.hpp"
00033 #include "CAASymCipher.hpp"
00034 
00035 // How many packets do you want to replay at a time?
00036 #define REPLAY_COUNT 16
00037 #ifndef NEW_MIX_TYPE
00038 class CALocalProxy
00039   {
00040     public:
00041       CALocalProxy()
00042         {
00043           m_arRSA=NULL;
00044           m_pSymCipher=NULL;
00045         }
00046       
00047       ~CALocalProxy(){clean();}
00048       
00049       // signals the main loop whether to capture or replay packets
00050       static bool bCapturePackets;
00051       static bool bReplayPackets;
00052       static int iCapturedPackets;
00053       SINT32 start();
00054   
00055     private:
00056       SINT32 loop();
00057       SINT32 init();
00058       SINT32 initOnce();
00059       SINT32 clean();
00060       SINT32 processKeyExchange(UINT8* buff,UINT32 size);
00061     private:
00062       CASocket m_socketIn;
00063       CASocket m_socketSOCKSIn;
00064       CAMuxSocket m_muxOut;
00065       UINT32 m_chainlen;
00066       UINT32 m_MixCascadeProtocolVersion;
00067       CAASymCipher* m_arRSA;
00068       CASymCipher* m_pSymCipher;
00069       UINT32 m_nFlowControlDownstreamSendMe;
00070       bool m_bWithNewFlowControl;
00071       bool m_bWithEnhancedChannelEncryption;
00072       UINT32 m_SymChannelEncryptedKeySize;
00073       UINT32 m_SymChannelKeySize;
00074       bool m_bWithFirstMixSymmetric;
00075   };
00076 #endif //!NEW_MIX_TYPE
00077 #endif