Mixe for Privacy and Anonymity in the Internet
Public Member Functions | Private Attributes | List of all members
CAAccountingControlChannel Class Reference

implementation of a per-user control-channel for the AccountingInstance. More...

#include <CAAccountingControlChannel.hpp>

Inheritance diagram for CAAccountingControlChannel:
Collaboration diagram for CAAccountingControlChannel:

Public Member Functions

 CAAccountingControlChannel (fmHashTableEntry *pHashEntry)
 Creates a new accounting controlchannel and stores a pointer to this in the pHashEntry. More...
 
virtual ~CAAccountingControlChannel ()
 
SINT32 processXMLMessage (const XERCES_CPP_NAMESPACE::DOMDocument *a_doc)
 processMessage - receives an XML msg and appends it to the AI message queue where it will be processed asynchronously More...
 
- Public Member Functions inherited from CASyncControlChannel
 CASyncControlChannel (UINT8 id, bool bIsEncrypted)
 Constructor for a synchronized (e.g. More...
 
virtual ~CASyncControlChannel ()
 
- Public Member Functions inherited from CAAbstractControlChannel
 CAAbstractControlChannel (UINT8 id, bool bIsEncrypted)
 
virtual ~CAAbstractControlChannel ()
 
SINT32 sendXMLMessage (const XERCES_CPP_NAMESPACE::DOMDocument *pDocMsg) const
 Call to send a XML message via this control channel. More...
 
SINT32 sendXMLMessage (const UINT8 *msgXML, UINT32 msgLen) const
 Call to send a XML message via this control channel. More...
 
UINT32 getID () const
 Returns the id of this control channel. More...
 

Private Attributes

fmHashTableEntrym_pHashEntry
 

Additional Inherited Members

- Protected Member Functions inherited from CASyncControlChannel
SINT32 proccessMessage (const UINT8 *msg, UINT32 msglen)
 Processes some bytes of a message we got from the communication channel. More...
 
SINT32 proccessMessageComplete ()
 Parses the bytes in m_MsgBuff and calls processXMLMessage() More...
 
- Protected Member Functions inherited from CAAbstractControlChannel
SINT32 setDispatcher (CAControlChannelDispatcher *pDispatcher)
 Sets the Dispatcher. More...
 
- Protected Attributes inherited from CASyncControlChannel
UINT8m_MsgBuff
 buffer for assembling the parts of the message More...
 
UINT32 m_aktIndex
 how much bytes have we received already? More...
 
UINT32 m_MsgBytesLeft
 how much bytes we need until all bytes are received? More...
 
- Protected Attributes inherited from CAAbstractControlChannel
CAControlChannelDispatcherm_pDispatcher
 
bool m_bIsEncrypted
 
UINT32 m_ID
 

Detailed Description

implementation of a per-user control-channel for the AccountingInstance.

All incoming messages are appended to the AccountingInstance queue where they are processed in an own thread.

Author
Bastian Voigt

Definition at line 43 of file CAAccountingControlChannel.hpp.

Constructor & Destructor Documentation

◆ CAAccountingControlChannel()

CAAccountingControlChannel::CAAccountingControlChannel ( fmHashTableEntry pHashEntry)

Creates a new accounting controlchannel and stores a pointer to this in the pHashEntry.

Definition at line 37 of file CAAccountingControlChannel.cpp.

39  {
40  m_pHashEntry = pHashEntry;
41  if (m_pHashEntry == NULL)
42  {
43  CAMsg::printMsg(LOG_CRIT,"CAAccountingControlChannel: User hash entry is NULL - creating control channel will fail!");
44  }
46  {
48  }
49  }
static SINT32 initTableEntry(fmHashTableEntry *pHashEntry)
This must be called whenever a JAP is connecting to init our per-user data structures.
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
Definition: CAMsg.cpp:251
CASyncControlChannel(UINT8 id, bool bIsEncrypted)
Constructor for a synchronized (e.g.
#define ACCOUNT_CONTROL_CHANNEL_ID
const SINT32 E_SUCCESS
Definition: errorcodes.hpp:2
CAAccountingControlChannel * pControlChannel
a pointer to the user-specific control channel object
Definition: typedefs.hpp:330
tAiAccountingInfo * pAccountingInfo

References E_SUCCESS, CAAccountingInstance::initTableEntry(), m_pHashEntry, t_fmhashtableentry::pAccountingInfo, t_accountinginfo::pControlChannel, and CAMsg::printMsg().

Here is the call graph for this function:

◆ ~CAAccountingControlChannel()

CAAccountingControlChannel::~CAAccountingControlChannel ( )
virtual

Definition at line 52 of file CAAccountingControlChannel.cpp.

53  {
54  // todo cleanup hashtable entry
55  #ifdef DEBUG
56  CAMsg::printMsg(LOG_DEBUG, "~CAAccountingControlChannel destructor\n");
57  #endif
59  }
static SINT32 cleanupTableEntry(fmHashTableEntry *pHashEntry)
This should always be called when closing a JAP connection to cleanup the data structures.

References CAAccountingInstance::cleanupTableEntry(), m_pHashEntry, and CAMsg::printMsg().

Here is the call graph for this function:

Member Function Documentation

◆ processXMLMessage()

SINT32 CAAccountingControlChannel::processXMLMessage ( const XERCES_CPP_NAMESPACE::DOMDocument *  a_doc)
virtual

processMessage - receives an XML msg and appends it to the AI message queue where it will be processed asynchronously

Implements CASyncControlChannel.

Definition at line 66 of file CAAccountingControlChannel.cpp.

67  {
68  #ifdef DEBUG
69  CAMsg::printMsg(LOG_DEBUG, "Invoking processJapMessage\n");
70  #endif
72  }
static SINT32 processJapMessage(fmHashTableEntry *pHashEntry, const XERCES_CPP_NAMESPACE::DOMDocument *a_DomDoc)
Handle a user (xml) message sent to us by the Jap through the ControlChannel.

References m_pHashEntry, CAMsg::printMsg(), and CAAccountingInstance::processJapMessage().

Here is the call graph for this function:

Member Data Documentation

◆ m_pHashEntry

fmHashTableEntry* CAAccountingControlChannel::m_pHashEntry
private

The documentation for this class was generated from the following files: