Mixes for Privacy and Anonymity in the Internet
|
Public Member Functions | |
CAChain (UINT8 *a_chainId) | |
~CAChain (void) | |
UINT8 * | getChainId () |
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 () |
UINT8 * | getPrintableChainId () |
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. More... | |
Private Member Functions | |
void | closeChainInternal () |
void | forceImmediateResponsesInternal () |
void | removeFromAllSocketGroupsInternal () |
UINT32 | sendUpstreamDataInternal (UINT32 a_maxLength) |
Private Attributes | |
UINT8 * | m_chainId |
SINT32 | m_lastAccessTime |
CASocket * | m_socket |
CAQueue * | m_upstreamSendQueue |
t_channelEntry * | m_firstChannel |
t_socketGroupEntry * | m_firstSocketGroup |
bool | m_connectionError |
bool | m_downstreamClosed |
bool | m_upstreamClosed |
bool | m_firstDownstreamPacket |
bool | m_unknownChainId |
CAChain::CAChain | ( | UINT8 * | a_chainId | ) |
CAChain::~CAChain | ( | void | ) |
References t_lastMixBChannelListEntry::associatedChannelList, chainId, t_channelEntry::channel, t_lastMixBChannelListEntry::channelCipher, CAQueue::clean(), CASocket::close(), diff64(), t_lastMixBChannelListEntry::firstResponseDeadline, getcurrentTimeMicros(), getPrintableChainId(), m_chainId, m_firstChannel, m_socket, m_upstreamSendQueue, t_channelEntry::nextChannel, t_deadlineEntry::nextDeadline, CAMsg::printMsg(), removeFromAllSocketGroupsInternal(), and CALastMixBChannelList::removeFromTable().
void CAChain::addChannel | ( | t_lastMixBChannelListEntry * | a_channel, |
bool | a_fastResponse | ||
) |
References t_channelEntry::channel, CHANNEL_DOWNSTREAM_PACKETS, CHANNEL_TIMEOUT, t_deadlineEntry::deadline, t_lastMixBChannelListEntry::firstResponseDeadline, forceImmediateResponsesInternal(), getcurrentTime(), m_downstreamClosed, m_firstChannel, m_lastAccessTime, m_upstreamClosed, t_channelEntry::nextChannel, t_deadlineEntry::nextDeadline, t_lastMixBChannelListEntry::remainingDownstreamPackets, and signalConnectionError().
Referenced by CALastMixB::loop().
References CAQueue::add(), m_upstreamClosed, and m_upstreamSendQueue.
Referenced by CALastMixB::loop().
void CAChain::addToSocketGroup | ( | CASocketGroupEpoll * | a_socketGroup | ) |
References CASocketGroup::add(), m_firstSocketGroup, m_socket, t_socketGroupEntry::nextSocketGroup, and t_socketGroupEntry::socketGroup.
Referenced by CALastMixB::loop().
|
private |
References CAQueue::clean(), CASocket::close(), forceImmediateResponsesInternal(), m_downstreamClosed, m_socket, m_upstreamClosed, m_upstreamSendQueue, and removeFromAllSocketGroupsInternal().
Referenced by closeDownstream(), closeUpstream(), processDownstream(), signalConnectionError(), and signalUnknownChain().
void CAChain::closeDownstream | ( | ) |
References closeChainInternal().
Referenced by processDownstream().
void CAChain::closeUpstream | ( | ) |
References closeChainInternal().
Referenced by CALastMixB::loop().
|
private |
UINT8 * CAChain::getChainId | ( | ) |
References m_chainId.
Referenced by CAChainTable::getEntryInternal(), and CALastMixB::loop().
UINT8 * CAChain::getPrintableChainId | ( | ) |
References bytes2hex(), CHAIN_ID_LENGTH, m_chainId, and strtrim().
Referenced by processDownstream(), and ~CAChain().
bool CAChain::isSignaledInSocketGroup | ( | CASocketGroupEpoll * | a_socketGroup | ) |
References CASocketGroupEpoll::isSignaled(), and m_socket.
Referenced by CALastMixB::loop(), and processDownstream().
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(), CASymChannelCipher::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, min, 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().
|
private |
References m_firstSocketGroup, m_socket, t_socketGroupEntry::nextSocketGroup, CASocketGroupEpoll::remove(), and t_socketGroupEntry::socketGroup.
Referenced by closeChainInternal(), and ~CAChain().
void CAChain::removeFromSocketGroup | ( | CASocketGroupEpoll * | a_socketGroup | ) |
References m_firstSocketGroup, m_socket, t_socketGroupEntry::nextSocketGroup, CASocketGroup::remove(), and t_socketGroupEntry::socketGroup.
Referenced by sendUpstreamData().
UINT32 CAChain::sendUpstreamData | ( | UINT32 | a_maxLength, |
CASocketGroupEpoll * | a_removedSocketGroup | ||
) |
References CAQueue::isEmpty(), m_upstreamSendQueue, removeFromSocketGroup(), and sendUpstreamDataInternal().
Referenced by CALastMixB::loop().
References E_SUCCESS, m_socket, m_upstreamClosed, m_upstreamSendQueue, CAQueue::peek(), CAQueue::remove(), CASocket::send(), and signalConnectionError().
Referenced by sendUpstreamData().
void CAChain::setSocket | ( | CASocket * | a_socket | ) |
References m_socket.
Referenced by CALastMixB::loop().
void CAChain::signalConnectionError | ( | ) |
References closeChainInternal(), and m_connectionError.
Referenced by addChannel(), CALastMixB::loop(), processDownstream(), and sendUpstreamDataInternal().
void CAChain::signalUnknownChain | ( | ) |
References closeChainInternal(), m_firstDownstreamPacket, and m_unknownChainId.
Referenced by CALastMixB::loop().
|
private |
Referenced by CAChain(), getChainId(), getPrintableChainId(), processDownstream(), and ~CAChain().
|
private |
Referenced by CAChain(), processDownstream(), and signalConnectionError().
|
private |
Referenced by addChannel(), CAChain(), closeChainInternal(), and processDownstream().
|
private |
Referenced by addChannel(), CAChain(), forceImmediateResponsesInternal(), processDownstream(), and ~CAChain().
|
private |
Referenced by CAChain(), processDownstream(), and signalUnknownChain().
|
private |
Referenced by addToSocketGroup(), CAChain(), removeFromAllSocketGroupsInternal(), and removeFromSocketGroup().
|
private |
Referenced by addChannel(), CAChain(), and processDownstream().
|
private |
|
private |
Referenced by CAChain(), processDownstream(), and signalUnknownChain().
|
private |
Referenced by addChannel(), addDataToUpstreamQueue(), CAChain(), closeChainInternal(), processDownstream(), and sendUpstreamDataInternal().
|
private |
Referenced by addDataToUpstreamQueue(), CAChain(), closeChainInternal(), sendUpstreamData(), sendUpstreamDataInternal(), and ~CAChain().