Mixe for Privacy and Anonymity in the Internet
CASocketList.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 #ifndef __CASOCKETLIST__
29 #define __CASOCKETLIST__
30 #include "CAMuxSocket.hpp"
31 #include "CASymChannelCipher.hpp"
32 #include "CAMutex.hpp"
33 #include "CAQueue.hpp"
34 
35 typedef struct connlist
36  {
44 
45 struct t_MEMBLOCK;
46 
48  {
49  public:
50  CASocketList();
51  CASocketList(bool bThreadSafe);
52  ~CASocketList();
53  SINT32 add(CASocket* pSocket,CASymChannelCipher** pCiphers);
54  SINT32 get(HCHANNEL in,CONNECTION* out);
55 
57  SINT32 clear();
63  {
65  return m_AktEnumPos;
66  }
67 
73  {
74  if(m_AktEnumPos!=NULL)
76  return m_AktEnumPos;
77  }
78 
79  UINT32 getSize(){return m_Size;}
80  SINT32 setThreadSafe(bool b);
82  protected:
91  };
92 #endif
struct connlist CONNECTIONLIST
struct connlist CONNECTION
signed int SINT32
Definition: basetypedefs.h:132
unsigned int UINT32
Definition: basetypedefs.h:131
SINT32 setThreadSafe(bool b)
CONNECTIONLIST * m_AktEnumPos
SINT32 increasePool()
SINT32 add(CASocket *pSocket, CASymChannelCipher **pCiphers)
Add a new channel to the channel-list.
SINT32 addSendMeCounter(HCHANNEL in, SINT32 value)
CASocket * remove(HCHANNEL id)
t_MEMBLOCK * m_Memlist
SINT32 get(HCHANNEL in, CONNECTION *out)
Gets a copy of an entry form the channel-list.
UINT32 getSize()
CONNECTION * getFirst()
Gets the first entry of the channel-list.
CONNECTIONLIST * m_Connections
CONNECTIONLIST * m_Pool
SINT32 clear()
CONNECTION * getNext()
Gets the next entry of the channel-list.
CASymChannelCipher ** pCiphers
UINT32 upstreamBytes
connlist * next
UINT32 currentSendMeCounter
HCHANNEL outChannel
CASocket * pSocket
UINT32 HCHANNEL
Definition: typedefs.hpp:34