|
Mixes for Privacy and Anonymity in the Internet
|
This is the AI (accounting instance or abrechnungsinstanz in german) class. More...
Classes | |
| struct | t_aiqueueitem |
Static Public Member Functions | |
| static SINT32 | init (CAFirstMix *callingMix) |
| Returns a reference to the Singleton instance. | |
| static SINT32 | clean () |
| static UINT32 | getAuthFlags (fmHashTableEntry *pHashEntry) |
| static SINT32 | cleanupTableEntry (fmHashTableEntry *pHashEntry) |
| This should always be called when closing a JAP connection to cleanup the data structures. | |
| static SINT32 | initTableEntry (fmHashTableEntry *pHashEntry) |
| This must be called whenever a JAP is connecting to init our per-user data structures. | |
| static SINT32 | handleJapPacket (fmHashTableEntry *pHashEntry, bool a_bControlMessage, bool a_bMessageToJAP) |
| This should be called by the FirstMix for every incoming Jap packet. | |
| static SINT32 | isIPAddressBlocked (const UINT8 ip[4]) |
| Check if an IP address is temporarily blocked by the accounting instance. | |
| 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. | |
| static UINT32 | getNrOfUsers () |
| static SINT32 | loginProcessStatus (fmHashTableEntry *pHashEntry) |
| static SINT32 | finishLoginProcess (fmHashTableEntry *pHashEntry) |
| this method is for the corresponding CAFirstMix login thread to verify the result of the settlement. | |
| static SINT32 | settlementTransaction () |
| static SettleEntry * | __handleSettleResult (CAXMLCostConfirmation *pCC, CAXMLErrorMessage *pErrMsg, CAAccountingDBInterface *dbInterface, UINT64 a_iSettlementTransactionNr) |
| static void | __commitSettlementToDatabase (SettleEntry *entryList, CAAccountingDBInterface *dbInterface) |
| only for internal use during the settleTransaction because the global settlement lock is not acquired | |
| static void | __commitSettlementToLoginTable (SettleEntry *entryList) |
| only for internal use during the settleTransaction because no login table locks are acquired | |
| static SINT32 | newSettlementTransaction () |
| static SINT32 | __newSettlementTransaction (UINT32 *nrOfSettledCCs) |
Static Public Attributes | |
| static const SINT32 | HANDLE_PACKET_CONNECTION_OK = 1 |
| static const SINT32 | HANDLE_PACKET_CONNECTION_UNCHECKED = 4 |
| static const SINT32 | HANDLE_PACKET_HOLD_CONNECTION = 0 |
| static const SINT32 | HANDLE_PACKET_PREPARE_FOR_CLOSING_CONNECTION = 2 |
| static const SINT32 | HANDLE_PACKET_CLOSE_CONNECTION = 3 |
| static const UINT32 | MAX_SETTLED_CCS = 10 |
Private Types | |
| typedef struct t_aiqueueitem | aiQueueItem |
Private Member Functions | |
| CAAccountingInstance (CAFirstMix *callingMix) | |
| private Constructor | |
| ~CAAccountingInstance () | |
| private destructor | |
| UINT32 | handleCostConfirmation (tAiAccountingInfo *pAccInfo, DOMElement *root) |
| Handles a cost confirmation sent by a jap. | |
| UINT32 | handleCostConfirmation_internal (tAiAccountingInfo *pAccInfo, DOMElement *root) |
| Handles a cost confirmation sent by a jap. | |
| UINT32 | handleAccountCertificate (tAiAccountingInfo *pAccInfo, DOMElement *root) |
| Handles an account certificate of a newly connected Jap. | |
| UINT32 | handleAccountCertificate_internal (tAiAccountingInfo *pAccInfo, DOMElement *root) |
| Handles an account certificate of a newly connected Jap. | |
| UINT32 | handleChallengeResponse (tAiAccountingInfo *pAccInfo, DOMElement *root) |
| Checks the response of the challenge-response auth. | |
| UINT32 | handleChallengeResponse_internal (tAiAccountingInfo *pAccInfo, DOMElement *root) |
| Handles the response to our challenge. | |
| bool | cascadeMatchesCC (CAXMLCostConfirmation *pCC) |
| SINT32 | prepareCCRequest (CAMix *callingMix, UINT8 *a_AiName) |
| creating the xml of a new CC is really the responsability of the CAXMLCostConfirmation class knowledge about the structure of a CC's XML should be encapsulated in it TODO: add constructor to that class that takes accountnumber, transferredbytes etc as params (should use a template internally into which it only inserts accNumber and bytes,to speed things up TODO: add toXMLElement method then replace manually building the xml here with contructing a CAXMLCostConfirmation and just add the xml returned by its toXMLElement method | |
Static Private Member Functions | |
| static SINT32 | handleJapPacket_internal (fmHashTableEntry *pHashEntry, bool a_bControlMessage, bool a_bMessageToJAP) |
| Called by FirstMix for each incoming JAP packet. | |
| static UINT64 | unlockLogin (fmHashTableEntry *ownerRef) |
| release login (particularly for use in error case) this function is thread-safe. | |
| static void | processJapMessageLoginHelper (fmHashTableEntry *pHashEntry, UINT32 handlerReturnvalue, bool finishLogin) |
| static SINT32 | getPrepaidBytes (tAiAccountingInfo *pAccInfos) |
| static SINT32 | makeInitialCCRequest (CAXMLCostConfirmation *pCC, XERCES_CPP_NAMESPACE::DOMDocument *&doc, SINT32 prepaidBytes) |
| new initialCCRequest containing the last CC and the prepaid bytes (this is a replacement for sending the prepaid with the challenge which is now deprecated). | |
| static SINT32 | makeCCRequest (const UINT64 accountNumber, const UINT64 transferredBytes, XERCES_CPP_NAMESPACE::DOMDocument *&doc) |
| static SINT32 | sendInitialCCRequest (tAiAccountingInfo *pAccInfo, CAXMLCostConfirmation *pCC, SINT32 prepaidBytes) |
| static SINT32 | sendCCRequest (tAiAccountingInfo *pAccInfo) |
| static SINT32 | makeAccountRequest (XERCES_CPP_NAMESPACE::DOMDocument *&doc) |
| static SINT32 | sendAILoginConfirmation (tAiAccountingInfo *pAccInfo, const UINT32 code, UINT8 *message) |
| static SINT32 | returnKickout (tAiAccountingInfo *pAccInfo) |
| When receiving this message, the Mix should kick the user out immediately. | |
| static SINT32 | returnPrepareKickout (tAiAccountingInfo *pAccInfo, CAXMLErrorMessage *a_error) |
| static void | setPrepaidBytesToZero (tAiAccountingInfo *pAccInfo) |
| static void | setPrepaidBytesToZero_internal (tAiAccountingInfo *pAccInfo) |
| static THREAD_RETURN | processThread (void *a_param) |
| The main loop of the AI thread - reads messages from the queue and starts process threads for these messages. | |
Private Attributes | |
| CAThreadPool * | m_aiThreadPool |
| reads messages from the queue and processes them | |
| CAMutex * | m_pMutex |
| this is for synchronizing the write access to the HashEntries | |
| Hashtable * | m_certHashCC |
| Hashtable * | m_currentAccountsHashtable |
| Stores the account number of all users currently logged in. | |
| CAFirstMix * | m_mix |
| UINT8 * | m_AiName |
| the name of this accounting instance | |
| UINT8 * | m_currentCascade |
| current cascade (identified by the concatenated hash values of the price certificates) | |
| UINT8 ** | m_allHashes |
| The hash values of the Mixes ordered beginning with the AI Mix. | |
| UINT32 | m_allHashesLen |
| CAAccountingBIInterface * | m_pPiInterface |
| the interface to the database | |
| UINT32 | m_iSoftLimitBytes |
| UINT32 | m_iHardLimitBytes |
| CATempIPBlockList * | m_pIPBlockList |
| Users that get kicked out because they sent no authentication certificate get their IP appended to this list. | |
| CAAccountingSettleThread * | m_pSettleThread |
| Signature verifying instance for BI signatures. | |
| bool | m_bThreadRunning |
| volatile UINT64 | m_nextSettleNr |
| volatile UINT64 | m_settleWaitNr |
| CAConditionVariable * | m_pSettlementMutex |
| volatile UINT32 | m_seqBIConnErrors |
Static Private Attributes | |
| static const UINT64 | PACKETS_BEFORE_NEXT_CHECK = 100 |
| static const UINT32 | MAX_TOLERATED_MULTIPLE_LOGINS = 10 |
| static XERCES_CPP_NAMESPACE::DOMDocument * | m_preparedCCRequest |
| static CAAccountingInstance * | ms_pInstance = NULL |
| Singleton: This is the reference to the only instance of this class. | |
| static SINT32 | m_prepaidBytesMinimum = 0 |
| static volatile UINT64 | m_iCurrentSettleTransactionNr = 0 |
Friends | |
| class | CAFirstMixA |
| class | CAFirstMix |
This is the AI (accounting instance or abrechnungsinstanz in german) class.
Its purpose is to count packets for every user and to decide wether the connection should be closed (e.g. when a user is betraying us, or simply when the account is empty and the user refuses to charge it).
It is a singleton class, only one instance exists at a time. On the first call to getInstance() the initialization is performed.
typedef struct t_aiqueueitem CAAccountingInstance::aiQueueItem [private] |
| CAAccountingInstance::CAAccountingInstance | ( | CAFirstMix * | callingMix | ) | [private] |
private Constructor
References Hashtable::compareUINT64(), CACmdLnOptions::getAiID(), CALibProxytest::getOptions(), CACmdLnOptions::getPaymentHardLimit(), CACmdLnOptions::getPaymentSoftLimit(), Hashtable::hashUINT64(), m_AiName, m_aiThreadPool, m_allHashes, m_allHashesLen, m_certHashCC, m_currentAccountsHashtable, m_currentCascade, m_iHardLimitBytes, m_iSoftLimitBytes, m_mix, m_nextSettleNr, m_pMutex, m_pPiInterface, m_pSettlementMutex, m_pSettleThread, m_seqBIConnErrors, m_settleWaitNr, MAX_LOGIN_QUEUE, NUM_LOGIN_WORKER_TRHEADS, prepareCCRequest(), CAMsg::printMsg(), Hashtable::put(), CAAccountingBIInterface::setPIServerConfiguration(), Hashtable::stringCompare(), and Hashtable::stringHash().
Referenced by init().
| CAAccountingInstance::~CAAccountingInstance | ( | ) | [private] |
private destructor
References BEGIN_STACK, Hashtable::clear(), FINISH_STACK, Hashtable::getMutex(), HASH_EMPTY_DELETE, HASH_EMPTY_NONE, INIT_STACK, CAMutex::lock(), m_AiName, m_aiThreadPool, m_allHashes, m_allHashesLen, m_certHashCC, m_currentAccountsHashtable, m_currentCascade, m_pMutex, m_pPiInterface, m_pSettlementMutex, m_pSettleThread, CAMsg::printMsg(), Hashtable::remove(), and CAMutex::unlock().
| void CAAccountingInstance::__commitSettlementToDatabase | ( | SettleEntry * | entryList, |
| CAAccountingDBInterface * | dbInterface | ||
| ) | [static] |
only for internal use during the settleTransaction because the global settlement lock is not acquired
References SettleEntry::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_BLOCKED, AUTH_INVALID_ACCOUNT, AUTH_UNKNOWN, SettleEntry::authFlags, SettleEntry::authRemoveFlags, CAAccountingDBInterface::clearAccountStatus(), SettleEntry::diffBytes, CAXMLErrorMessage::ERR_ACCOUNT_EMPTY, CAXMLErrorMessage::ERR_BLOCKED, CAXMLErrorMessage::ERR_KEY_NOT_FOUND, CAAccountingDBInterface::getPrepaidAmount(), m_currentCascade, ms_pInstance, SettleEntry::nextEntry, CAMsg::printMsg(), SettleEntry::storedStatus, and CAAccountingDBInterface::storePrepaidAmount().
Referenced by __newSettlementTransaction().
| void CAAccountingInstance::__commitSettlementToLoginTable | ( | SettleEntry * | entryList | ) | [static] |
only for internal use during the settleTransaction because no login table locks are acquired
References SettleEntry::accountNumber, AccountLoginHashEntry::authFlags, SettleEntry::authFlags, AccountLoginHashEntry::authRemoveFlags, SettleEntry::authRemoveFlags, AccountLoginHashEntry::confirmedBytes, SettleEntry::confirmedBytes, Hashtable::getValue(), m_currentAccountsHashtable, ms_pInstance, and SettleEntry::nextEntry.
Referenced by __newSettlementTransaction().
| SettleEntry * CAAccountingInstance::__handleSettleResult | ( | CAXMLCostConfirmation * | pCC, |
| CAXMLErrorMessage * | pErrMsg, | ||
| CAAccountingDBInterface * | dbInterface, | ||
| UINT64 | a_iSettlementTransactionNr | ||
| ) | [static] |
References SettleEntry::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_BLOCKED, AUTH_INVALID_ACCOUNT, AUTH_OUTDATED_CC, AUTH_SETTLED_ONCE, AUTH_UNKNOWN, AUTH_WAITING_FOR_FIRST_SETTLED_CC, SettleEntry::authFlags, SettleEntry::authRemoveFlags, SettleEntry::confirmedBytes, CAAccountingDBInterface::deleteCC(), SettleEntry::diffBytes, E_SUCCESS, CAXMLErrorMessage::ERR_ACCOUNT_EMPTY, CAXMLErrorMessage::ERR_BLOCKED, CAXMLErrorMessage::ERR_DATABASE_ERROR, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_KEY_NOT_FOUND, CAXMLErrorMessage::ERR_OK, CAXMLErrorMessage::ERR_OUTDATED_CC, CAXMLErrorMessage::ERR_SUCCESS_BUT_WITH_ERRORS, CAXMLCostConfirmation::getAccountNumber(), CAAccountingDBInterface::getAccountStatus(), CAXMLErrorMessage::getDescription(), CAXMLErrorMessage::getErrorCode(), CAXMLErrorMessage::getMessageObject(), CAXMLCostConfirmation::getTransferredBytes(), m_currentCascade, CAAccountingDBInterface::markAsSettled(), ms_pInstance, print64(), CAMsg::printMsg(), CAAccountingDBInterface::storeAccountStatus(), CAAccountingDBInterface::storeCostConfirmation(), and SettleEntry::storedStatus.
Referenced by __newSettlementTransaction().
| SINT32 CAAccountingInstance::__newSettlementTransaction | ( | UINT32 * | nrOfSettledCCs | ) | [static] |
References __commitSettlementToDatabase(), __commitSettlementToLoginTable(), __handleSettleResult(), cleanup(), CRITICAL_SUBSEQUENT_BI_CONN_ERRORS, E_NOT_CONNECTED, E_SUCCESS, E_UNKNOWN, CAAccountingDBInterface::getConnection(), Hashtable::getMutex(), CAAccountingDBInterface::getUnsettledCostConfirmations(), CAAccountingBIInterface::initBIConnection(), CAMutex::lock(), m_currentAccountsHashtable, m_currentCascade, m_iCurrentSettleTransactionNr, m_nextSettleNr, m_pPiInterface, m_pSettlementMutex, m_seqBIConnErrors, m_settleWaitNr, MAX_SETTLED_CCS, MONITORING_FIRE_PAY_EVENT, ms_pInstance, SettleEntry::nextEntry, CAMsg::printMsg(), CAAccountingDBInterface::releaseConnection(), CAAccountingBIInterface::settleAll(), CAConditionVariable::signal(), CAAccountingBIInterface::terminateBIConnection(), CAMutex::unlock(), and CAConditionVariable::wait().
Referenced by newSettlementTransaction().
| bool CAAccountingInstance::cascadeMatchesCC | ( | CAXMLCostConfirmation * | pCC | ) | [private] |
| static SINT32 CAAccountingInstance::clean | ( | ) | [static] |
References E_SUCCESS, m_preparedCCRequest, MONITORING_FIRE_PAY_EVENT, and ms_pInstance.
| SINT32 CAAccountingInstance::cleanupTableEntry | ( | fmHashTableEntry * | pHashEntry | ) | [static] |
This should always be called when closing a JAP connection to cleanup the data structures.
This should always be called when closing a JAP connection to cleanup the payment data structures and store prepaid bytes.
(pAccInfo->authFlags & AUTH_WAITING_FOR_FIRST_SETTLED_CC))
References t_accountinginfo::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_ACCOUNT_OK, AUTH_DELETE_ENTRY, AccountLoginHashEntry::authFlags, t_accountinginfo::authFlags, BEGIN_STACK, t_accountinginfo::clientVersion, AccountLoginHashEntry::confirmedBytes, t_accountinginfo::confirmedBytes, E_SUCCESS, E_UNKNOWN, FINISH_STACK, CAAccountingDBInterface::getConnection(), Hashtable::getMutex(), CALibProxytest::getOptions(), getPrepaidBytes(), CACmdLnOptions::getPrepaidInterval(), Hashtable::getValue(), INIT_STACK, isLoginOngoing(), CAMutex::lock(), m_currentAccountsHashtable, m_currentCascade, ms_pInstance, t_accountinginfo::mutex, t_accountinginfo::nrInQueue, AccountLoginHashEntry::ownerLock, AccountLoginHashEntry::ownerRef, t_fmhashtableentry::pAccountingInfo, t_accountinginfo::pChallenge, t_fmhashtableentry::peerIP, t_accountinginfo::pPublicKey, print64(), CAMsg::printMsg(), t_accountinginfo::pstrBIID, CAAccountingDBInterface::releaseConnection(), Hashtable::remove(), SAVE_STACK, CAAccountingDBInterface::storePrepaidAmount(), testLoginEntryOwner(), and CAMutex::unlock().
Referenced by CAAccountingControlChannel::~CAAccountingControlChannel().
| SINT32 CAAccountingInstance::finishLoginProcess | ( | fmHashTableEntry * | pHashEntry | ) | [static] |
this method is for the corresponding CAFirstMix login thread to verify the result of the settlement.
References t_accountinginfo::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_BLOCKED, AUTH_INVALID_ACCOUNT, AUTH_LOGIN_FAILED, AUTH_LOGIN_NOT_FINISHED, AUTH_LOGIN_SKIP_SETTLEMENT, AUTH_SETTLED_ONCE, AUTH_UNKNOWN, AccountLoginHashEntry::authFlags, t_accountinginfo::authFlags, AccountLoginHashEntry::authRemoveFlags, AccountLoginHashEntry::confirmedBytes, t_accountinginfo::confirmedBytes, CRITICAL_SETTLE_FLAGS, E_SUCCESS, CAXMLErrorMessage::ERR_ACCOUNT_EMPTY, CAXMLErrorMessage::ERR_BLOCKED, CAXMLErrorMessage::ERR_NO_BALANCE, CAXMLErrorMessage::ERR_NO_ERROR_GIVEN, CAXMLErrorMessage::ERR_OK, CAAccountingDBInterface::getAccountStatus(), CAAccountingDBInterface::getConnection(), Hashtable::getMutex(), getPrepaidBytes(), Hashtable::getValue(), CAMutex::lock(), m_currentAccountsHashtable, ms_pInstance, t_accountinginfo::mutex, t_fmhashtableentry::pAccountingInfo, t_accountinginfo::pControlChannel, CAMsg::printMsg(), CAAccountingDBInterface::releaseConnection(), sendAILoginConfirmation(), CAAbstractControlChannel::sendXMLMessage(), CAAbstractXMLEncodable::toXmlDocument(), t_accountinginfo::transferredBytes, and CAMutex::unlock().
Referenced by CAFirstMix::doUserLogin_internal().
| UINT32 CAAccountingInstance::getAuthFlags | ( | fmHashTableEntry * | pHashEntry | ) | [static] |
References t_accountinginfo::authFlags, and t_fmhashtableentry::pAccountingInfo.
Referenced by CAFirstMixA::checkUserConnections().
| UINT32 CAAccountingInstance::getNrOfUsers | ( | ) | [static] |
| SINT32 CAAccountingInstance::getPrepaidBytes | ( | tAiAccountingInfo * | pAccInfos | ) | [static, private] |
| UINT32 CAAccountingInstance::handleAccountCertificate | ( | tAiAccountingInfo * | pAccInfo, |
| DOMElement * | root | ||
| ) | [private] |
Handles an account certificate of a newly connected Jap.
References FINISH_STACK, handleAccountCertificate_internal(), and INIT_STACK.
Referenced by processJapMessage().
| UINT32 CAAccountingInstance::handleAccountCertificate_internal | ( | tAiAccountingInfo * | pAccInfo, |
| DOMElement * | root | ||
| ) | [private] |
Handles an account certificate of a newly connected Jap.
Parses accountnumber and publickey, checks the signature and generates and sends a challenge XML structure to the Jap. TODO: think about switching account without changing mixcascade (receive a new acc.cert. though we already have one)
References t_accountinginfo::accountNumber, AUTH_CHALLENGE_SENT, AUTH_DELETE_ENTRY, AUTH_FAKE, AUTH_GOT_ACCOUNTCERT, AUTH_TIMEOUT_STARTED, t_accountinginfo::authFlags, BEGIN_STACK, t_accountinginfo::challengeSentSeconds, createDOMDocument(), createDOMElement(), DOM_Output::dumpToMem(), E_SUCCESS, CABase64::encode(), CAXMLErrorMessage::ERR_BAD_REQUEST, CAXMLErrorMessage::ERR_BAD_SIGNATURE, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_KEY_NOT_FOUND, CAXMLErrorMessage::ERR_NO_ERROR_GIVEN, CAXMLErrorMessage::ERR_NO_RECORD_FOUND, CAXMLErrorMessage::ERR_OK, CAXMLErrorMessage::ERR_WRONG_FORMAT, CAAccountingDBInterface::getConnection(), getcurrentTime(), getDOMChildByName(), getDOMElementValue(), CALibProxytest::getOptions(), CAAccountingDBInterface::getPrepaidAmount(), getRandom(), INIT_STACK, len, CAMutex::lock(), m_currentCascade, t_accountinginfo::mutex, t_accountinginfo::pChallenge, t_accountinginfo::pControlChannel, t_accountinginfo::pPublicKey, CAMsg::printMsg(), t_accountinginfo::pstrBIID, CAAccountingDBInterface::releaseConnection(), CAAbstractControlChannel::sendXMLMessage(), setDOMElementAttribute(), setDOMElementValue(), CASignature::setVerifyKey(), CAAbstractXMLEncodable::toXmlDocument(), CAMutex::unlock(), and CAMultiSignature::verifyXML().
Referenced by handleAccountCertificate().
| UINT32 CAAccountingInstance::handleChallengeResponse | ( | tAiAccountingInfo * | pAccInfo, |
| DOMElement * | root | ||
| ) | [private] |
Checks the response of the challenge-response auth.
References FINISH_STACK, handleChallengeResponse_internal(), and INIT_STACK.
Referenced by processJapMessage().
| UINT32 CAAccountingInstance::handleChallengeResponse_internal | ( | tAiAccountingInfo * | pAccInfo, |
| DOMElement * | root | ||
| ) | [private] |
Handles the response to our challenge.
Checks the validity of the response and sets the user's authFlags Also gets the last CC of the user, and sends it to the JAP accordingly.
References AccountLoginHashEntry::accountNumber, t_accountinginfo::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_ACCOUNT_OK, AUTH_BLOCKED, AUTH_CHALLENGE_SENT, AUTH_DELETE_ENTRY, AUTH_FAKE, AUTH_GOT_ACCOUNTCERT, AUTH_INVALID_ACCOUNT, AUTH_MULTIPLE_LOGIN, AUTH_WAITING_FOR_FIRST_SETTLED_CC, AccountLoginHashEntry::authFlags, t_accountinginfo::authFlags, AccountLoginHashEntry::authRemoveFlags, BEGIN_STACK, t_accountinginfo::bytesToConfirm, cascadeMatchesCC(), t_fmhashtableentry::cleanupNotifier, CLIENT_VERSION_STR_LEN, t_accountinginfo::clientVersion, AccountLoginHashEntry::confirmedBytes, t_accountinginfo::confirmedBytes, AccountLoginHashEntry::count, CABase64::decode(), E_SUCCESS, CAXMLErrorMessage::ERR_ACCOUNT_EMPTY, CAXMLErrorMessage::ERR_BAD_SIGNATURE, CAXMLErrorMessage::ERR_BLOCKED, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_KEY_NOT_FOUND, CAXMLErrorMessage::ERR_MULTIPLE_LOGIN, CAXMLErrorMessage::ERR_NO_ERROR_GIVEN, CAXMLErrorMessage::ERR_NO_RECORD_FOUND, CAXMLErrorMessage::ERR_OK, CAXMLErrorMessage::ERR_WRONG_FORMAT, CAFirstMix::forceKickout(), CAAccountingDBInterface::getAccountStatus(), CAAccountingDBInterface::getConnection(), CAAccountingDBInterface::getCostConfirmation(), getDOMChildByName(), getDOMElementValue(), CAFirstMix::getLoginMutex(), Hashtable::getMutex(), CALibProxytest::getOptions(), CAAccountingDBInterface::getPrepaidAmount(), CACmdLnOptions::getPrepaidInterval(), CAXMLCostConfirmation::getTransferredBytes(), Hashtable::getValue(), CAXMLCostConfirmation::getXMLDocument(), INIT_STACK, CAMutex::lock(), AccountLoginHashEntry::loginOngoing, m_currentAccountsHashtable, m_currentCascade, m_mix, ms_pInstance, t_accountinginfo::mutex, AccountLoginHashEntry::ownerLock, AccountLoginHashEntry::ownerRef, t_accountinginfo::ownerRef, t_accountinginfo::pChallenge, t_accountinginfo::pControlChannel, t_accountinginfo::pPublicKey, PREPAID_PROTO_CLIENT_VERSION, print64(), CAMsg::printMsg(), Hashtable::put(), CAAccountingDBInterface::releaseConnection(), Hashtable::remove(), sendCCRequest(), sendInitialCCRequest(), CAAbstractControlChannel::sendXMLMessage(), testAndSetLoginOwner(), CAAbstractXMLEncodable::toXmlDocument(), t_accountinginfo::transferredBytes, CAMutex::unlock(), AccountLoginHashEntry::userID, t_accountinginfo::userID, CASignature::verifyDER(), and CAConditionVariable::wait().
Referenced by handleChallengeResponse().
| UINT32 CAAccountingInstance::handleCostConfirmation | ( | tAiAccountingInfo * | pAccInfo, |
| DOMElement * | root | ||
| ) | [private] |
Handles a cost confirmation sent by a jap.
References FINISH_STACK, handleCostConfirmation_internal(), and INIT_STACK.
Referenced by processJapMessage().
| UINT32 CAAccountingInstance::handleCostConfirmation_internal | ( | tAiAccountingInfo * | pAccInfo, |
| DOMElement * | root | ||
| ) | [private] |
Handles a cost confirmation sent by a jap.
References t_accountinginfo::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_ACCOUNT_OK, AUTH_DATABASE, AUTH_DELETE_ENTRY, AUTH_FAKE, AUTH_GOT_ACCOUNTCERT, AUTH_HARD_LIMIT_REACHED, AUTH_LOGIN_NOT_FINISHED, AUTH_LOGIN_SKIP_SETTLEMENT, AUTH_SENT_CC_REQUEST, AUTH_WAITING_FOR_FIRST_SETTLED_CC, t_accountinginfo::authFlags, BEGIN_STACK, t_accountinginfo::bytesToConfirm, cascadeMatchesCC(), t_accountinginfo::confirmedBytes, E_SUCCESS, E_UNKNOWN, CAXMLErrorMessage::ERR_BAD_REQUEST, CAXMLErrorMessage::ERR_BAD_SIGNATURE, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_NO_ERROR_GIVEN, CAXMLErrorMessage::ERR_NO_RECORD_FOUND, CAXMLErrorMessage::ERR_OK, CAXMLErrorMessage::ERR_WRONG_DATA, CAXMLErrorMessage::ERR_WRONG_FORMAT, CAXMLCostConfirmation::getAccountNumber(), CAAccountingDBInterface::getConnection(), getcurrentTimeMillis(), CAXMLCostConfirmation::getInstance(), CAXMLCostConfirmation::getNumberOfHashes(), CALibProxytest::getOptions(), getPrepaidBytes(), CACmdLnOptions::getPrepaidInterval(), CAXMLCostConfirmation::getTransferredBytes(), INIT_STACK, t_accountinginfo::lastHardLimitSeconds, CAMutex::lock(), m_allHashesLen, m_currentCascade, m_pSettleThread, t_accountinginfo::mutex, t_accountinginfo::pControlChannel, t_accountinginfo::pPublicKey, print64(), CAMsg::printMsg(), CAAccountingDBInterface::releaseConnection(), CAAbstractControlChannel::sendXMLMessage(), CAAccountingSettleThread::settle(), CAAccountingDBInterface::storeCostConfirmation(), CAAbstractXMLEncodable::toXmlDocument(), t_accountinginfo::transferredBytes, CAMutex::unlock(), and CASignature::verifyXML().
Referenced by handleCostConfirmation().
| SINT32 CAAccountingInstance::handleJapPacket | ( | fmHashTableEntry * | pHashEntry, |
| bool | a_bControlMessage, | ||
| bool | a_bMessageToJAP | ||
| ) | [static] |
This should be called by the FirstMix for every incoming Jap packet.
References FINISH_STACK, handleJapPacket_internal(), and INIT_STACK.
Referenced by CAFirstMixA::accountTrafficDownstream(), CAFirstMixA::accountTrafficUpstream(), and CAFirstMixB::loop().
| SINT32 CAAccountingInstance::handleJapPacket_internal | ( | fmHashTableEntry * | pHashEntry, |
| bool | a_bControlMessage, | ||
| bool | a_bMessageToJAP | ||
| ) | [static, private] |
Called by FirstMix for each incoming JAP packet.
Determines whether the packet should be let through or not
Possible return values, and FirstMix's reaction:
Do not make further checkings. Let the client use the remaining prepaid bytes, and then disconnect him afterwards. As the confirmedBytes are set to zero when the client connects and the account has been empty before, no other (unauthenticated) client may use these bytes.
References t_accountinginfo::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_BLOCKED, AUTH_DATABASE, AUTH_DELETE_ENTRY, AUTH_FATAL_ERROR, AUTH_HARD_LIMIT_REACHED, AUTH_INVALID_ACCOUNT, AUTH_LOGIN_NOT_FINISHED, AUTH_MULTIPLE_LOGIN, AUTH_OUTDATED_CC, AUTH_SENT_CC_REQUEST, AUTH_TIMEOUT_STARTED, AUTH_UNKNOWN, AUTH_WAITING_FOR_FIRST_SETTLED_CC, AccountLoginHashEntry::authFlags, t_accountinginfo::authFlags, AccountLoginHashEntry::authRemoveFlags, BEGIN_STACK, AccountLoginHashEntry::confirmedBytes, t_accountinginfo::confirmedBytes, CAXMLErrorMessage::ERR_ACCOUNT_EMPTY, CAXMLErrorMessage::ERR_BLOCKED, CAXMLErrorMessage::ERR_DATABASE_ERROR, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_KEY_NOT_FOUND, CAXMLErrorMessage::ERR_MULTIPLE_LOGIN, CAXMLErrorMessage::ERR_NO_CONFIRMATION, CAAccountingDBInterface::getConnection(), CAAccountingDBInterface::getCostConfirmation(), Hashtable::getMutex(), CALibProxytest::getOptions(), getPrepaidBytes(), CACmdLnOptions::getPrepaidInterval(), Hashtable::getValue(), CAXMLCostConfirmation::getXMLDocument(), HANDLE_PACKET_CLOSE_CONNECTION, HANDLE_PACKET_CONNECTION_OK, HANDLE_PACKET_CONNECTION_UNCHECKED, HANDLE_PACKET_PREPARE_FOR_CLOSING_CONNECTION, HARD_LIMIT_TIMEOUT, INIT_STACK, t_accountinginfo::lastHardLimitSeconds, CAMutex::lock(), m_currentAccountsHashtable, m_currentCascade, m_iHardLimitBytes, m_iSoftLimitBytes, MIXPACKET_SIZE, ms_pInstance, t_accountinginfo::mutex, t_accountinginfo::ownerRef, t_fmhashtableentry::pAccountingInfo, PACKETS_BEFORE_NEXT_CHECK, t_accountinginfo::pControlChannel, print64(), CAMsg::printMsg(), CAAccountingDBInterface::releaseConnection(), returnKickout(), returnPrepareKickout(), SAVE_STACK, sendCCRequest(), CAAbstractControlChannel::sendXMLMessage(), t_accountinginfo::sessionPackets, t_accountinginfo::transferredBytes, and CAMutex::unlock().
Referenced by handleJapPacket().
| static SINT32 CAAccountingInstance::init | ( | CAFirstMix * | callingMix | ) | [static] |
Returns a reference to the Singleton instance.
References CAAccountingInstance(), E_SUCCESS, MONITORING_FIRE_PAY_EVENT, and ms_pInstance.
| SINT32 CAAccountingInstance::initTableEntry | ( | fmHashTableEntry * | pHashEntry | ) | [static] |
This must be called whenever a JAP is connecting to init our per-user data structures.
References AUTH_HARD_LIMIT_REACHED, AUTH_LOGIN_NOT_FINISHED, AUTH_SENT_ACCOUNT_REQUEST, AUTH_SENT_CC_REQUEST, AUTH_TIMEOUT_STARTED, AUTH_WAITING_FOR_FIRST_SETTLED_CC, t_accountinginfo::authFlags, t_accountinginfo::authTimeoutStartSeconds, BEGIN_STACK, t_accountinginfo::bytesToConfirm, t_accountinginfo::clientVersion, t_accountinginfo::confirmedBytes, E_SUCCESS, E_UNKNOWN, FINISH_STACK, t_fmhashtableentry::id, INIT_STACK, t_accountinginfo::lastHardLimitSeconds, t_accountinginfo::mutex, t_accountinginfo::nrInQueue, t_accountinginfo::ownerRef, t_fmhashtableentry::pAccountingInfo, SAVE_STACK, t_accountinginfo::sessionPackets, t_accountinginfo::transferredBytes, and t_accountinginfo::userID.
Referenced by CAAccountingControlChannel::CAAccountingControlChannel().
| static SINT32 CAAccountingInstance::isIPAddressBlocked | ( | const UINT8 | ip[4] | ) | [static] |
Check if an IP address is temporarily blocked by the accounting instance.
This should be called by the FirstMix when a JAP is connecting.
| 1 | if the given IP is blocked |
| 0 | if it is not blocked |
| SINT32 CAAccountingInstance::loginProcessStatus | ( | fmHashTableEntry * | pHashEntry | ) | [static] |
| static SINT32 CAAccountingInstance::makeAccountRequest | ( | XERCES_CPP_NAMESPACE::DOMDocument *& | doc | ) | [static, private] |
| SINT32 CAAccountingInstance::makeCCRequest | ( | const UINT64 | accountNumber, |
| const UINT64 | transferredBytes, | ||
| XERCES_CPP_NAMESPACE::DOMDocument *& | doc | ||
| ) | [static, private] |
References BEGIN_STACK, createDOMDocument(), createDOMElement(), E_SUCCESS, FINISH_STACK, getDOMChildByName(), INIT_STACK, m_preparedCCRequest, and setDOMElementValue().
Referenced by sendCCRequest().
| SINT32 CAAccountingInstance::makeInitialCCRequest | ( | CAXMLCostConfirmation * | pCC, |
| XERCES_CPP_NAMESPACE::DOMDocument *& | doc, | ||
| SINT32 | prepaidBytes | ||
| ) | [static, private] |
new initialCCRequest containing the last CC and the prepaid bytes (this is a replacement for sending the prepaid with the challenge which is now deprecated).
References createDOMDocument(), createDOMElement(), E_SUCCESS, E_UNKNOWN, getDOMChildByName(), CAXMLCostConfirmation::getXMLDocument(), m_preparedCCRequest, CAMsg::printMsg(), setDOMElementAttribute(), and setDOMElementValue().
Referenced by sendInitialCCRequest().
| SINT32 CAAccountingInstance::newSettlementTransaction | ( | ) | [static] |
References __newSettlementTransaction(), E_SUCCESS, and MAX_SETTLED_CCS.
Referenced by CAFirstMix::doUserLogin_internal(), and CAAccountingSettleThread::mainLoop().
| SINT32 CAAccountingInstance::prepareCCRequest | ( | CAMix * | callingMix, |
| UINT8 * | a_AiName | ||
| ) | [private] |
creating the xml of a new CC is really the responsability of the CAXMLCostConfirmation class knowledge about the structure of a CC's XML should be encapsulated in it TODO: add constructor to that class that takes accountnumber, transferredbytes etc as params (should use a template internally into which it only inserts accNumber and bytes,to speed things up TODO: add toXMLElement method then replace manually building the xml here with contructing a CAXMLCostConfirmation and just add the xml returned by its toXMLElement method
| callingMix,: | the Mix instance to which the AI belongs (needed to get cascadeInfo to extract the price certificates to include in cost confirmations) |
References createDOMDocument(), createDOMElement(), E_SUCCESS, E_UNKNOWN, CABase64::encode(), getDOMChildByName(), getElementsByTagName(), CAMix::getMixCascadeInfo(), len, m_allHashes, m_allHashesLen, m_currentCascade, m_preparedCCRequest, DOM_Output::makeCanonical(), CAMsg::printMsg(), setDOMElementAttribute(), setDOMElementValue(), and strtrim().
Referenced by CAAccountingInstance().
| SINT32 CAAccountingInstance::processJapMessage | ( | fmHashTableEntry * | pHashEntry, |
| const XERCES_CPP_NAMESPACE::DOMDocument * | a_DomDoc | ||
| ) | [static] |
Handle a user (xml) message sent to us by the Jap through the ControlChannel.
Handle a user (xml) message sent to us by the Jap.
This function determines what type of message we have and sends the appropriate handle...() function to the ai thread.
This function is running inside the AiThread. It determines what type of message we have and calls the appropriate handle...() function
pHashEntry->pAccountingInfo->mutex->lock(); pItem->pAccInfo->nrInQueue++; ret = ms_pInstance->m_aiThreadPool->addRequest(processThread, pItem); if (ret !=E_SUCCESS) { pItem->pAccInfo->nrInQueue--; CAMsg::printMsg(LOG_CRIT, "CAAccountingInstance: Process could not add to AI thread pool!\n" ); delete pItem->pDomDoc; delete pItem; } pHashEntry->pAccountingInfo->mutex->unlock(); return ret; }
References AUTH_ACCOUNT_EMPTY, AUTH_BLOCKED, AUTH_INVALID_ACCOUNT, AUTH_LOGIN_SKIP_SETTLEMENT, t_accountinginfo::authFlags, BEGIN_STACK, E_SUCCESS, E_UNKNOWN, CAXMLErrorMessage::ERR_OK, FINISH_STACK, getPrepaidBytes(), handleAccountCertificate(), handleChallengeResponse(), handleCostConfirmation(), INIT_STACK, ms_pInstance, t_fmhashtableentry::pAccountingInfo, CAMsg::printMsg(), processJapMessageLoginHelper(), and SAVE_STACK.
Referenced by CAAccountingControlChannel::processXMLMessage().
| void CAAccountingInstance::processJapMessageLoginHelper | ( | fmHashTableEntry * | pHashEntry, |
| UINT32 | handlerReturnvalue, | ||
| bool | finishLogin | ||
| ) | [static, private] |
References AUTH_FAKE, AUTH_LOGIN_FAILED, AUTH_LOGIN_NOT_FINISHED, AUTH_MULTIPLE_LOGIN, t_accountinginfo::authFlags, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_MULTIPLE_LOGIN, CAXMLErrorMessage::ERR_OK, CAMutex::lock(), t_accountinginfo::mutex, t_fmhashtableentry::pAccountingInfo, t_accountinginfo::pControlChannel, CAAbstractControlChannel::sendXMLMessage(), CAAbstractXMLEncodable::toXmlDocument(), and CAMutex::unlock().
Referenced by processJapMessage().
| THREAD_RETURN CAAccountingInstance::processThread | ( | void * | a_param | ) | [static, private] |
The main loop of the AI thread - reads messages from the queue and starts process threads for these messages.
Processes JAP messages asynchronously by calls to the appropriate handlers.
References AUTH_DELETE_ENTRY, t_accountinginfo::authFlags, BEGIN_STACK, FINISH_STACK, CAAccountingInstance::t_aiqueueitem::handleFunc, INIT_STACK, CAMutex::lock(), ms_pInstance, t_accountinginfo::mutex, t_accountinginfo::nrInQueue, CAAccountingInstance::t_aiqueueitem::pAccInfo, CAAccountingInstance::t_aiqueueitem::pDomDoc, CAMsg::printMsg(), THREAD_RETURN_SUCCESS, and CAMutex::unlock().
| SINT32 CAAccountingInstance::returnKickout | ( | tAiAccountingInfo * | pAccInfo | ) | [static, private] |
When receiving this message, the Mix should kick the user out immediately.
References t_accountinginfo::accountNumber, HANDLE_PACKET_CLOSE_CONNECTION, t_accountinginfo::mutex, print64(), CAMsg::printMsg(), setPrepaidBytesToZero_internal(), and CAMutex::unlock().
Referenced by handleJapPacket_internal().
| SINT32 CAAccountingInstance::returnPrepareKickout | ( | tAiAccountingInfo * | pAccInfo, |
| CAXMLErrorMessage * | a_error | ||
| ) | [static, private] |
References AUTH_FATAL_ERROR, t_accountinginfo::authFlags, HANDLE_PACKET_PREPARE_FOR_CLOSING_CONNECTION, t_accountinginfo::mutex, t_accountinginfo::pControlChannel, CAMsg::printMsg(), CAAbstractControlChannel::sendXMLMessage(), CAAbstractXMLEncodable::toXmlDocument(), and CAMutex::unlock().
Referenced by handleJapPacket_internal().
| SINT32 CAAccountingInstance::sendAILoginConfirmation | ( | tAiAccountingInfo * | pAccInfo, |
| const UINT32 | code, | ||
| UINT8 * | message | ||
| ) | [static, private] |
| SINT32 CAAccountingInstance::sendCCRequest | ( | tAiAccountingInfo * | pAccInfo | ) | [static, private] |
References t_accountinginfo::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_SENT_CC_REQUEST, t_accountinginfo::authFlags, BEGIN_STACK, t_accountinginfo::bytesToConfirm, DOM_Output::dumpToMem(), E_SUCCESS, CALibProxytest::getOptions(), CACmdLnOptions::getPrepaidInterval(), INIT_STACK, makeCCRequest(), t_accountinginfo::pControlChannel, CAMsg::printMsg(), CAAbstractControlChannel::sendXMLMessage(), and t_accountinginfo::transferredBytes.
Referenced by handleChallengeResponse_internal(), and handleJapPacket_internal().
| SINT32 CAAccountingInstance::sendInitialCCRequest | ( | tAiAccountingInfo * | pAccInfo, |
| CAXMLCostConfirmation * | pCC, | ||
| SINT32 | prepaidBytes | ||
| ) | [static, private] |
| void CAAccountingInstance::setPrepaidBytesToZero | ( | tAiAccountingInfo * | pAccInfo | ) | [static, private] |
References CAMutex::lock(), t_accountinginfo::mutex, setPrepaidBytesToZero_internal(), and CAMutex::unlock().
| void CAAccountingInstance::setPrepaidBytesToZero_internal | ( | tAiAccountingInfo * | pAccInfo | ) | [static, private] |
References t_accountinginfo::confirmedBytes, and t_accountinginfo::transferredBytes.
Referenced by returnKickout(), and setPrepaidBytesToZero().
| SINT32 CAAccountingInstance::settlementTransaction | ( | ) | [static] |
References SettleEntry::accountNumber, AUTH_ACCOUNT_EMPTY, AUTH_BLOCKED, AUTH_INVALID_ACCOUNT, AUTH_OUTDATED_CC, AUTH_SETTLED_ONCE, AUTH_UNKNOWN, AUTH_WAITING_FOR_FIRST_SETTLED_CC, AccountLoginHashEntry::authFlags, SettleEntry::authFlags, AccountLoginHashEntry::authRemoveFlags, SettleEntry::authRemoveFlags, BEGIN_STACK, CAAccountingDBInterface::clearAccountStatus(), AccountLoginHashEntry::confirmedBytes, SettleEntry::confirmedBytes, CRITICAL_SUBSEQUENT_BI_CONN_ERRORS, CAAccountingDBInterface::deleteCC(), SettleEntry::diffBytes, E_NOT_CONNECTED, E_SUCCESS, E_UNKNOWN, CAXMLErrorMessage::ERR_ACCOUNT_EMPTY, CAXMLErrorMessage::ERR_BLOCKED, CAXMLErrorMessage::ERR_DATABASE_ERROR, CAXMLErrorMessage::ERR_INTERNAL_SERVER_ERROR, CAXMLErrorMessage::ERR_KEY_NOT_FOUND, CAXMLErrorMessage::ERR_OK, CAXMLErrorMessage::ERR_OUTDATED_CC, CAXMLErrorMessage::ERR_SUCCESS_BUT_WITH_ERRORS, FINISH_STACK, CAXMLCostConfirmation::getAccountNumber(), CAAccountingDBInterface::getAccountStatus(), CAAccountingDBInterface::getConnection(), CAXMLErrorMessage::getDescription(), CAXMLErrorMessage::getErrorCode(), CAXMLErrorMessage::getMessageObject(), Hashtable::getMutex(), CAAccountingDBInterface::getPrepaidAmount(), CAXMLCostConfirmation::getTransferredBytes(), CAAccountingDBInterface::getUnsettledCostConfirmations(), Hashtable::getValue(), INIT_STACK, CAAccountingBIInterface::initBIConnection(), CAMutex::lock(), m_currentAccountsHashtable, m_currentCascade, m_nextSettleNr, m_pPiInterface, m_pSettlementMutex, m_seqBIConnErrors, m_settleWaitNr, CAAccountingDBInterface::markAsSettled(), MAX_SETTLED_CCS, MONITORING_FIRE_PAY_EVENT, ms_pInstance, SettleEntry::nextEntry, print64(), CAMsg::printMsg(), CAAccountingDBInterface::releaseConnection(), SAVE_STACK, CAAccountingBIInterface::settle(), CAConditionVariable::signal(), CAAccountingDBInterface::storeAccountStatus(), CAAccountingDBInterface::storeCostConfirmation(), SettleEntry::storedStatus, CAAccountingDBInterface::storePrepaidAmount(), CAAccountingBIInterface::terminateBIConnection(), CAMutex::unlock(), and CAConditionVariable::wait().
| UINT64 CAAccountingInstance::unlockLogin | ( | fmHashTableEntry * | ownerRef | ) | [static, private] |
release login (particularly for use in error case) this function is thread-safe.
References t_accountinginfo::accountNumber, Hashtable::getMutex(), Hashtable::getValue(), CAMutex::lock(), m_currentAccountsHashtable, ms_pInstance, t_fmhashtableentry::pAccountingInfo, resetLoginOngoing(), and CAMutex::unlock().
Referenced by CAFirstMix::doUserLogin_internal().
friend class CAFirstMix [friend] |
friend class CAFirstMixA [friend] |
const SINT32 CAAccountingInstance::HANDLE_PACKET_CLOSE_CONNECTION = 3 [static] |
const SINT32 CAAccountingInstance::HANDLE_PACKET_CONNECTION_OK = 1 [static] |
const SINT32 CAAccountingInstance::HANDLE_PACKET_CONNECTION_UNCHECKED = 4 [static] |
Referenced by handleJapPacket_internal().
const SINT32 CAAccountingInstance::HANDLE_PACKET_HOLD_CONNECTION = 0 [static] |
const SINT32 CAAccountingInstance::HANDLE_PACKET_PREPARE_FOR_CLOSING_CONNECTION = 2 [static] |
UINT8* CAAccountingInstance::m_AiName [private] |
the name of this accounting instance
Referenced by CAAccountingInstance(), and ~CAAccountingInstance().
CAThreadPool* CAAccountingInstance::m_aiThreadPool [private] |
reads messages from the queue and processes them
Referenced by CAAccountingInstance(), and ~CAAccountingInstance().
UINT8** CAAccountingInstance::m_allHashes [private] |
The hash values of the Mixes ordered beginning with the AI Mix.
Referenced by CAAccountingInstance(), prepareCCRequest(), and ~CAAccountingInstance().
UINT32 CAAccountingInstance::m_allHashesLen [private] |
bool CAAccountingInstance::m_bThreadRunning [private] |
Hashtable* CAAccountingInstance::m_certHashCC [private] |
Referenced by CAAccountingInstance(), cascadeMatchesCC(), and ~CAAccountingInstance().
Stores the account number of all users currently logged in.
Referenced by __commitSettlementToLoginTable(), __newSettlementTransaction(), CAAccountingInstance(), cleanupTableEntry(), finishLoginProcess(), getNrOfUsers(), handleChallengeResponse_internal(), handleJapPacket_internal(), settlementTransaction(), unlockLogin(), and ~CAAccountingInstance().
UINT8* CAAccountingInstance::m_currentCascade [private] |
current cascade (identified by the concatenated hash values of the price certificates)
Referenced by __commitSettlementToDatabase(), __handleSettleResult(), __newSettlementTransaction(), CAAccountingInstance(), cleanupTableEntry(), handleAccountCertificate_internal(), handleChallengeResponse_internal(), handleCostConfirmation_internal(), handleJapPacket_internal(), prepareCCRequest(), settlementTransaction(), and ~CAAccountingInstance().
volatile UINT64 CAAccountingInstance::m_iCurrentSettleTransactionNr = 0 [static, private] |
Referenced by __newSettlementTransaction().
Referenced by CAAccountingInstance(), and handleJapPacket_internal().
Referenced by CAAccountingInstance(), and handleJapPacket_internal().
CAFirstMix* CAAccountingInstance::m_mix [private] |
Referenced by CAAccountingInstance(), and handleChallengeResponse_internal().
volatile UINT64 CAAccountingInstance::m_nextSettleNr [private] |
Referenced by __newSettlementTransaction(), CAAccountingInstance(), and settlementTransaction().
Users that get kicked out because they sent no authentication certificate get their IP appended to this list.
Connections from IP Addresses contained in this list get blocked, so that evil JAP users can't use the mix cascade without paying
CAMutex* CAAccountingInstance::m_pMutex [private] |
this is for synchronizing the write access to the HashEntries
Referenced by CAAccountingInstance(), getNrOfUsers(), and ~CAAccountingInstance().
the interface to the database
Referenced by __newSettlementTransaction(), CAAccountingInstance(), settlementTransaction(), and ~CAAccountingInstance().
SINT32 CAAccountingInstance::m_prepaidBytesMinimum = 0 [static, private] |
XERCES_CPP_NAMESPACE::DOMDocument * CAAccountingInstance::m_preparedCCRequest [static, private] |
Referenced by clean(), makeCCRequest(), makeInitialCCRequest(), and prepareCCRequest().
Referenced by __newSettlementTransaction(), CAAccountingInstance(), settlementTransaction(), and ~CAAccountingInstance().
Signature verifying instance for BI signatures.
this thread sends cost confirmations to the BI in regular intervals
Referenced by CAAccountingInstance(), handleCostConfirmation_internal(), and ~CAAccountingInstance().
volatile UINT32 CAAccountingInstance::m_seqBIConnErrors [private] |
Referenced by __newSettlementTransaction(), CAAccountingInstance(), and settlementTransaction().
volatile UINT64 CAAccountingInstance::m_settleWaitNr [private] |
Referenced by __newSettlementTransaction(), CAAccountingInstance(), and settlementTransaction().
const UINT32 CAAccountingInstance::MAX_SETTLED_CCS = 10 [static] |
Referenced by __newSettlementTransaction(), newSettlementTransaction(), and settlementTransaction().
const UINT32 CAAccountingInstance::MAX_TOLERATED_MULTIPLE_LOGINS = 10 [static, private] |
CAAccountingInstance * CAAccountingInstance::ms_pInstance = NULL [static, private] |
Singleton: This is the reference to the only instance of this class.
Referenced by __commitSettlementToDatabase(), __commitSettlementToLoginTable(), __handleSettleResult(), __newSettlementTransaction(), clean(), cleanupTableEntry(), finishLoginProcess(), getNrOfUsers(), handleChallengeResponse_internal(), handleJapPacket_internal(), init(), processJapMessage(), processThread(), settlementTransaction(), and unlockLogin().
const UINT64 CAAccountingInstance::PACKETS_BEFORE_NEXT_CHECK = 100 [static, private] |
Referenced by handleJapPacket_internal().
1.7.6.1