Mixes for Privacy and Anonymity in the Internet
Public Member Functions | Private Member Functions | Private Attributes
CAChain Class Reference

List of all members.

Public Member Functions

 CAChain (UINT8 *a_chainId)
 ~CAChain (void)
UINT8getChainId ()
void setSocket (CASocket *a_socket)
void addChannel (t_lastMixBChannelListEntry *a_channel, bool a_fastResponse)
void addDataToUpstreamQueue (UINT8 *a_buffer, UINT32 a_size)
void signalConnectionError ()
void signalUnknownChain ()
void closeUpstream ()
void closeDownstream ()
UINT8getPrintableChainId ()
void addToSocketGroup (CASocketGroupEpoll *a_socketGroup)
void removeFromSocketGroup (CASocketGroupEpoll *a_socketGroup)
bool isSignaledInSocketGroup (CASocketGroupEpoll *a_socketGroup)
UINT32 sendUpstreamData (UINT32 a_maxLength, CASocketGroupEpoll *a_removedSocketGroup)
SINT32 processDownstream (CASocketGroupEpoll *a_signalingGroup, MIXPACKET *a_downstreamPacket, UINT32 *a_processedBytes)
 Returns: 0, if a packet was created.

Private Member Functions

void closeChainInternal ()
void forceImmediateResponsesInternal ()
void removeFromAllSocketGroupsInternal ()
UINT32 sendUpstreamDataInternal (UINT32 a_maxLength)

Private Attributes

UINT8m_chainId
SINT32 m_lastAccessTime
CASocketm_socket
CAQueuem_upstreamSendQueue
t_channelEntrym_firstChannel
t_socketGroupEntrym_firstSocketGroup
bool m_connectionError
bool m_downstreamClosed
bool m_upstreamClosed
bool m_firstDownstreamPacket
bool m_unknownChainId

Constructor & Destructor Documentation

CAChain::CAChain ( UINT8 a_chainId)
CAChain::~CAChain ( void  )

Member Function Documentation

void CAChain::addChannel ( t_lastMixBChannelListEntry a_channel,
bool  a_fastResponse 
)
void CAChain::addDataToUpstreamQueue ( UINT8 a_buffer,
UINT32  a_size 
)
void CAChain::addToSocketGroup ( CASocketGroupEpoll a_socketGroup)
void CAChain::closeChainInternal ( ) [private]

References closeChainInternal().

Referenced by processDownstream().

References closeChainInternal().

Referenced by CALastMixB::loop().

SINT32 CAChain::processDownstream ( CASocketGroupEpoll a_signalingGroup,
MIXPACKET a_downstreamPacket,
UINT32 a_processedBytes 
)

Returns: 0, if a packet was created.

1, if currently nothing can be done. 2, if a packet was created and the chain can be removed from the chaintable. 3, if no packet was created, but the chain can be removed from the chaintable.

References t_lastMixBChannelListEntry::associatedChannelList, CHAIN_ID_LENGTH, CHAIN_TIMEOUT, CHAINFLAG_CONNECTION_ERROR, CHAINFLAG_STREAM_CLOSED, CHAINFLAG_UNKNOWN_CHAIN, chainId, t_first_downstream_chain_cell::chainId, t_channelEntry::channel, t_MixPacket::channel, CHANNEL_CLOSE, CHANNEL_DATA, t_lastMixBChannelListEntry::channelCipher, t_lastMixBChannelListEntry::channelId, closeChainInternal(), closeDownstream(), CASymCipher::crypt2(), t_MixPacket::data, t_first_downstream_chain_cell::data, t_sequel_downstream_chain_cell::data, DATA_SIZE, t_deadlineEntry::deadline, DEADLINE_TIMEOUT, t_downstream_chain_cell::firstCell, t_lastMixBChannelListEntry::firstResponseDeadline, t_MixPacket::flags, getcurrentTime(), getPrintableChainId(), getRandom(), isSignaledInSocketGroup(), t_downstream_chain_cell::lengthAndFlags, m_chainId, m_connectionError, m_downstreamClosed, m_firstChannel, m_firstDownstreamPacket, m_lastAccessTime, m_socket, m_unknownChainId, m_upstreamClosed, MAX_FIRST_DOWNSTREAM_CHAINCELL_PAYLOAD, MAX_SEQUEL_DOWNSTREAM_CHAINCELL_PAYLOAD, t_channelEntry::nextChannel, t_deadlineEntry::nextDeadline, CAMsg::printMsg(), CASocket::receive(), t_lastMixBChannelListEntry::remainingDownstreamPackets, CALastMixBChannelList::removeFromTable(), t_downstream_chain_cell::sequelCell, and signalConnectionError().

Referenced by CALastMixB::loop().

UINT32 CAChain::sendUpstreamData ( UINT32  a_maxLength,
CASocketGroupEpoll a_removedSocketGroup 
)
UINT32 CAChain::sendUpstreamDataInternal ( UINT32  a_maxLength) [private]
void CAChain::setSocket ( CASocket a_socket)

References m_socket.

Referenced by CALastMixB::loop().


Member Data Documentation

bool CAChain::m_unknownChainId [private]
bool CAChain::m_upstreamClosed [private]