Mixe for Privacy and Anonymity in the Internet
CAFirstMixA.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2000, The JAP-Team
3 All rights reserved.
4 Redistribution and use in source and binary forms, with or without modification,
5 are permitted provided that the following conditions are met:
6 
7  - Redistributions of source code must retain the above copyright notice,
8  this list of conditions and the following disclaimer.
9 
10  - Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation and/or
12  other materials provided with the distribution.
13 
14  - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
15  may be used to endorse or promote products derived from this software without specific
16  prior written permission.
17 
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
20 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
22 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
27 */
28 
29 #ifndef __CAFIRSTMIXA__
30 #define __CAFIRSTMIXA__
31 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
32 #include "../CAFirstMix.hpp"
33 #include "../CASocketAddrINet.hpp"
34 #include "../CAIPAddrWithNetmask.hpp"
35 
37 
38 class CAFirstMixA:public CAFirstMix
39 {
40  public:
41  virtual void shutDown();
42 
43  protected:
44  SINT32 loop();
45 #ifndef MULTI_THREADED_PACKET_PROCESSING
47 #else
48 #ifdef HAVE_EPOLL
49  SINT32 closeConnection(fmHashTableEntry* pHashEntry, CASocketGroupEpoll* psocketgroupUsersRead, CASocketGroupEpoll* psocketgroupUsersWrite, CAFirstMixChannelList* pChannelList);
50 #else
51  SINT32 closeConnection(fmHashTableEntry* pHashEntry, CASocketGroup* psocketgroupUsersRead, CASocketGroup* psocketgroupUsersWrite, CAFirstMixChannelList* pChannelList);
52 #endif
53 #endif
54 
55  private:
56 #ifndef MULTI_THREADED_PACKET_PROCESSING
57  bool sendToUsers();
58 #else
59 #ifdef HAVE_EPOLL
60  bool sendToUsers(CASocketGroupEpoll* psocketgroupUsersWrite,CASocketGroupEpoll* psocketgroupUsersRead, CAFirstMixChannelList* pChannelList);
61 #else
62  bool sendToUsers(CASocketGroup* psocketgroupUsersWrite,CASocketGroup* psocketgroupUsersRead, CAFirstMixChannelList* pChannelList);
63 #endif
64 #endif
66 #ifdef SSL_HACK
67  void finishPacket(fmHashTableEntry *pfmHashEntry);
68 #endif
69 #ifdef PAYMENT
70  void checkUserConnections();
73 #endif
74  #ifdef LOG_CRIME
75  void crimeSurveillance(CAIPAddrWithNetmask* surveillanceIPs, UINT32 nrOfSureveillanceIPs, UINT8 *peerIP, SINT32 peerPort,MIXPACKET *pMixPacket);
76  #endif
77  friend THREAD_RETURN fm_loopPacketProcessing(void *params);
78 };
79 
80 #endif
81 #endif //ONLY_LOCAL_PROXY
THREAD_RETURN fm_loopPacketProcessing(void *params)
#define THREAD_RETURN
Definition: StdAfx.h:540
unsigned short UINT16
Definition: basetypedefs.h:133
signed int SINT32
Definition: basetypedefs.h:132
unsigned char UINT8
Definition: basetypedefs.h:135
unsigned int UINT32
Definition: basetypedefs.h:131
void checkUserConnections()
virtual void shutDown()
Definition: CAFirstMixA.cpp:44
void finishPacket(fmHashTableEntry *pfmHashEntry)
friend THREAD_RETURN fm_loopPacketProcessing(void *params)
SINT32 loop()
SINT32 closeConnection(fmHashTableEntry *pHashEntry)
Definition: CAFirstMixA.cpp:85
bool sendToUsers()
SINT32 accountTrafficDownstream(fmHashTableEntry *pfmHashEntry)
SINT32 accountTrafficUpstream(fmHashTableEntry *pHashEntry)
void notifyAllUserChannels(fmHashTableEntry *pfmHashEntry, UINT16 flags)
Data structure that stores all information about the currently open Mix channels.
UINT16 flags
Definition: typedefs.hpp:1