|
Mixe for Privacy and Anonymity in the Internet
|
#include "doxygen.h"#include <sys/filio.h>#include <poll.h>#include <sys/epoll.h>#include <sys/ioctl.h>#include <sys/types.h>#include <sys/socket.h>#include <pwd.h>#include <sys/un.h>#include <sys/time.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <unistd.h>#include <stdlib.h>#include <strings.h>#include <syslog.h>#include <stdarg.h>#include <memory.h>#include <sys/resource.h>#include <sys/wait.h>#include <termios.h>#include <ctype.h>#include "basetypedefs.h"#include <assert.h>#include <pthread.h>#include <stdio.h>#include <time.h>#include <fcntl.h>#include <limits.h>#include <sys/stat.h>#include <signal.h>#include <errno.h>#include "trio/trio.hpp"#include "trio/triostr.hpp"#include "popt/system.h"#include "popt/popt.h"#include <openssl/rsa.h>#include <openssl/aes.h>#include <openssl/rand.h>#include <openssl/evp.h>#include <openssl/asn1.h>#include <openssl/pkcs12.h>#include <openssl/x509v3.h>#include <openssl/ssl.h>#include <openssl/dsa.h>#include <openssl/sha.h>#include <openssl/md5.h>#include <util/XercesDefs.hpp>#include <util/PlatformUtils.hpp>#include <util/XMLString.hpp>#include <util/XMLUniDefs.hpp>#include <framework/XMLFormatter.hpp>#include <util/TranscodingException.hpp>#include <framework/MemBufInputSource.hpp>#include <dom/DOM.hpp>#include <parsers/XercesDOMParser.hpp>#include <mysql/mysql.h>#include <postgresql/libpq-fe.h>#include "errorcodes.hpp"#include "typedefs.hpp"#include "controlchannelids.h"#include "gcm/gcm.h"Go to the source code of this file.
| #define ACCOUNT_NUMBER_SIZE 12 |
Definition at line 684 of file StdAfx.h.
Referenced by CAAccountingDBInterface::__clearAccountStatus().
| #define AI_LOGIN_SO_TIMEOUT (UINT32) 10000 |
Definition at line 183 of file StdAfx.h.
Referenced by CAFirstMix::doUserLogin_internal().
| #define ASSERT | ( | cond, | |
| msg | |||
| ) |
Definition at line 491 of file StdAfx.h.
Referenced by CAFirstMixA::closeConnection(), CASignature::decodeRS(), getDOMElementValue(), getNodeName(), getRandom(), CAFirstMixB::loop(), CASocketGroupEpoll::remove(), and CAAbstractXMLSignable::setSignature().
| #define BALANCE_REQUEST_TIMEOUT 60 |
| #define CHANNELS_PER_CLIENT 50 |
| #define CLEANUP_THREAD_SLEEP_INTERVAL 60 |
Definition at line 201 of file StdAfx.h.
Referenced by CATempIPBlockList::cleanupThreadMainLoop().
| #define CLIENTS_PER_IP 10 |
| #define closesocket | ( | s | ) | close(s) |
Definition at line 420 of file StdAfx.h.
Referenced by CADatagramSocket::close(), and CASocket::close().
| #define DATA_RETENTION_LOG_INFO |
| #define DEFAULT_INFOSERVICE "141.76.45.37" |
Definition at line 224 of file StdAfx.h.
Referenced by CACmdLnOptions::buildDefaultConfig().
| #define DELAY_USERS_BUCKET_GROW 10 |
Definition at line 135 of file StdAfx.h.
Referenced by CACmdLnOptions::CACmdLnOptions(), and CAFirstMixChannelList::CAFirstMixChannelList().
| #define DELAY_USERS_BUCKET_GROW_INTERVALL 100 |
Definition at line 134 of file StdAfx.h.
Referenced by CACmdLnOptions::CACmdLnOptions(), and CAFirstMixChannelList::CAFirstMixChannelList().
| #define DUMMY_CHANNEL 0 |
Definition at line 230 of file StdAfx.h.
Referenced by CAPool::CAPool(), fm_loopReadFromMix(), fm_loopSendToMix(), lm_loopReadFromMix(), lm_loopSendToMix(), mm_loopReadFromMixAfter(), mm_loopReadFromMixBefore(), mm_loopSendToMixAfter(), and mm_loopSendToMixBefore().
| #define ERR_INTERN_CONNREFUSED ECONNREFUSED |
Definition at line 432 of file StdAfx.h.
Referenced by CASocket::connect(), CAMiddleMix::connectToNextMix(), and CAFirstMix::connectToNextMix().
| #define ERR_INTERN_SOCKET_CLOSED EBADF |
Definition at line 434 of file StdAfx.h.
Referenced by CASocket::accept(), and CAFirstMixA::accountTrafficDownstream().
| #define ERR_INTERN_TIMEDOUT ETIMEDOUT |
Definition at line 431 of file StdAfx.h.
Referenced by CASocket::connect(), CAMiddleMix::connectToNextMix(), and CAFirstMix::connectToNextMix().
| #define ERR_INTERN_WOULDBLOCK EAGAIN |
Definition at line 433 of file StdAfx.h.
Referenced by CASocket::receive(), and CASocket::send().
| #define FIRST_MIX_RECEIVE_SYM_KEY_FROM_JAP_TIME_OUT 40000 |
Definition at line 181 of file StdAfx.h.
Referenced by CAFirstMix::doUserLogin_internal().
| #define FLOW_CONTROL_SENDME_HARD_LIMIT 160 |
Definition at line 206 of file StdAfx.h.
Referenced by CALastMixA::loop().
| #define FLOW_CONTROL_SENDME_SOFT_LIMIT 80 |
Definition at line 207 of file StdAfx.h.
Referenced by CALocalProxy::init(), CALastMixA::loop(), and CALastMix::processKeyExchange().
| #define FM_PACKET_STATS_LOG_INTERVALL 1 |
Definition at line 232 of file StdAfx.h.
Referenced by CAFirstMix::init().
| #define GET_NET_ERROR (errno) |
Definition at line 426 of file StdAfx.h.
Referenced by CASocket::accept(), CASocket::close(), CASocket::connect(), CAMiddleMix::connectToNextMix(), CAFirstMix::connectToNextMix(), CASocket::create(), CACmdLnOptions::createSockets(), CAFirstMix::doUserLogin_internal(), fm_loopAcceptUsers(), CALastMix::init(), CASocket::listen(), mm_loopReadFromMixAfter(), CAMsg::openLog(), CAMiddleMix::processKeyExchange(), CALastMix::processKeyExchange(), CAFirstMix::processKeyExchange(), CASocket::receive(), CAMuxSocket::receive(), CASocketGroup::select(), CASocket::send(), CAMuxSocket::send(), CAInfoService::sendMixHelo(), CAInfoService::sendStatus(), CAFirstMixA::sendToUsers(), CASocket::setKeepAlive(), CAMsg::setLogOptions(), CACmdLnOptions::setNrOfFileDescriptors(), CACmdLnOptions::setTargetInterfaces(), and CACmdLnOptions::setUserID().
| #define GET_NET_ERROR_STR | ( | x | ) | (errno == E_TIMEDOUT ? "Connection timed out." : (errno == E_SOCKETCLOSED ? "Socket is closed." : strerror(x))) |
Definition at line 428 of file StdAfx.h.
Referenced by CAMiddleMix::connectToNextMix(), CAFirstMix::connectToNextMix(), CASocket::create(), CACmdLnOptions::createSockets(), CAFirstMix::doUserLogin_internal(), CALastMix::init(), CAFirstMix::init(), mm_loopReadFromMixAfter(), CAMiddleMix::processKeyExchange(), CALastMix::processKeyExchange(), CAFirstMix::processKeyExchange(), CASocket::receive(), CAMuxSocket::receive(), CAInfoService::sendMixHelo(), CAInfoService::sendStatus(), CAFirstMixA::sendToUsers(), CASocket::setKeepAlive(), CAMsg::setLogOptions(), CACmdLnOptions::setNrOfFileDescriptors(), CACmdLnOptions::setTargetInterfaces(), and CACmdLnOptions::setUserID().
| #define HAVE_O_SYNC |
| #define HAVE_PTHREAD_COND_INIT |
| #define HAVE_PTHREAD_CV |
| #define HAVE_PTHREAD_MUTEX_INIT |
| #define HAVE_PTHREAD_MUTEXES |
| #define HAVE_PTHREAD_SEMAPHORE |
| #define HAVE_SEM_INIT |
| #define HAVE_SNPRINTF |
| #define HAVE_TCP_KEEPALIVE |
| #define HAVE_UNIX_DOMAIN_PROTOCOL |
| #define HAVE_VSNPRINTF |
| #define INVALID_SOCKET -1 |
Definition at line 422 of file StdAfx.h.
Referenced by CADatagramSocket::create(), and CASocket::create().
| #define ioctlsocket | ( | a, | |
| b, | |||
| c | |||
| ) | ioctl(a,b,c) |
Definition at line 419 of file StdAfx.h.
Referenced by CASocket::setNonBlocking().
| #define KEEP_ALIVE_TRAFFIC_RECV_WAIT_TIME 75000 |
Definition at line 163 of file StdAfx.h.
Referenced by CACmdLnOptions::setKeepAliveTraffic().
| #define KEEP_ALIVE_TRAFFIC_SEND_WAIT_TIME 65000 |
Definition at line 165 of file StdAfx.h.
Referenced by CACmdLnOptions::setKeepAliveTraffic().
| #define LAST_MIX_TO_PROXY_CONNECT_TIMEOUT 2000 |
Definition at line 182 of file StdAfx.h.
Referenced by CALastMixA::loop(), CALastMixB::loop(), and CACmdLnOptions::setTargetInterfaces().
| #define LAST_MIX_TO_PROXY_SEND_TIMEOUT (UINT32)5000 |
Definition at line 184 of file StdAfx.h.
Referenced by CALastMixA::loop(), and CALastMixB::loop().
| #define LM_PACKET_STATS_LOG_INTERVALL 1 |
Definition at line 233 of file StdAfx.h.
Referenced by CALastMix::init().
| #define LOG_COUNTRIES_INTERVALL 6 |
Definition at line 108 of file StdAfx.h.
Referenced by iplist_loopDoLogCountries().
| #define MAX_ACCOUNTNUMBER 999999999999ULL |
Definition at line 682 of file StdAfx.h.
Referenced by CAAccountingDBInterface::__clearAccountStatus().
| #define MAX_DATA_PER_CHANNEL 100000 |
| #define MAX_LOGIN_QUEUE 500 |
Definition at line 187 of file StdAfx.h.
Referenced by CAAccountingInstance::CAAccountingInstance(), and CAFirstMix::init().
| #define MAX_MIXIN_SEND_QUEUE_SIZE 10000000 |
Definition at line 212 of file StdAfx.h.
Referenced by CALastMixA::loop(), and CALastMixB::loop().
| #define MAX_NEXT_MIX_QUEUE_SIZE 10000000 |
Definition at line 213 of file StdAfx.h.
Referenced by CAFirstMixB::loop(), and CAFirstMixA::loop().
| #define MAX_POLLFD 8192 |
Definition at line 176 of file StdAfx.h.
Referenced by CALastMixChannelList::add(), CAFirstMixChannelList::add(), CAChainTable::CAChainTable(), CAFirstMixChannelList::CAFirstMixChannelList(), CALastMixChannelList::CALastMixChannelList(), CASocketGroupEpoll::CASocketGroupEpoll(), CAChainTable::createEntry(), CAFirstMixChannelList::decDelayBuckets(), fml_loopDelayBuckets(), CAFirstMixChannelList::hasDelayBuckets(), CALastMixB::loop(), CASocketGroupEpoll::select(), CAFirstMixChannelList::setDelayParameters(), and CASocketGroup::setPoolForWrite().
| #define MAX_READ_FROM_NEXT_MIX_QUEUE_SIZE 10000000 |
Definition at line 211 of file StdAfx.h.
Referenced by fm_loopReadFromMix(), and mm_loopReadFromMixAfter().
| #define MAX_READ_FROM_PREV_MIX_QUEUE_SIZE 10000000 |
Definition at line 210 of file StdAfx.h.
Referenced by lm_loopReadFromMix(), and mm_loopReadFromMixBefore().
| #define MAX_SIGNATURE_ELEMENTS 10 |
Definition at line 204 of file StdAfx.h.
Referenced by CACertStore::verifyMixCert(), and CAMultiSignature::verifyXML().
| #define MAX_USER_SEND_QUEUE 100000 |
| #define MIN_ACCOUNTNUMBER 100000000000ULL |
Definition at line 683 of file StdAfx.h.
Referenced by CAAccountingDBInterface::__clearAccountStatus().
| #define MIX_CASCADE_PROTOCOL_VERSION "0.81" |
Definition at line 248 of file StdAfx.h.
Referenced by CAFirstMix::processKeyExchange().
| #define MIX_CASCADE_PROTOCOL_VERSION_0_1_0 10 |
Definition at line 237 of file StdAfx.h.
Referenced by CALocalProxy::processKeyExchange().
| #define MIX_CASCADE_PROTOCOL_VERSION_0_1_1 11 |
| #define MIX_CASCADE_PROTOCOL_VERSION_0_1_2 12 |
| #define MIX_CASCADE_PROTOCOL_VERSION_0_2 2 |
Definition at line 245 of file StdAfx.h.
Referenced by CALocalProxy::processKeyExchange().
| #define MIX_CASCADE_PROTOCOL_VERSION_0_3 3 |
Definition at line 244 of file StdAfx.h.
Referenced by CALocalProxy::processKeyExchange().
| #define MIX_CASCADE_PROTOCOL_VERSION_0_4 4 |
Definition at line 243 of file StdAfx.h.
Referenced by CALocalProxy::processKeyExchange().
| #define MIX_CASCADE_PROTOCOL_VERSION_0_5 5 |
| #define MIX_CASCADE_PROTOCOL_VERSION_0_7 7 |
| #define MIX_CASCADE_PROTOCOL_VERSION_0_8 8 |
| #define MIX_POOL_TIMEOUT 200 |
Definition at line 229 of file StdAfx.h.
Referenced by fm_loopReadFromMix(), fm_loopSendToMix(), lm_loopReadFromMix(), lm_loopSendToMix(), mm_loopReadFromMixAfter(), and mm_loopReadFromMixBefore().
| #define MIX_TO_INFOSERVICE_TIMEOUT 30000 |
Definition at line 185 of file StdAfx.h.
Referenced by CAInfoService::sendCascadeHelo(), CAInfoService::sendMixHelo(), and CAInfoService::sendStatus().
| #define MIX_VERSION "00.11.08" |
Definition at line 36 of file StdAfx.h.
Referenced by CAMix::appendCompatibilityInfo(), CAMix::checkCompatibility(), and CACmdLnOptions::processXmlConfiguration().
| #define MIX_VERSION_COMPATIBILITY PAYMENT_COMPATIBILITY " " NEW_FLOW_CONTROL_COMPATIBILITY " " NEW_CHANNEL_ENCRYPTION_COMPATIBILITY " " WITH_INTEGRITY_CHECK_COMPATIBILITY |
Definition at line 675 of file StdAfx.h.
Referenced by CAMix::checkCompatibility().
| #define MIX_VERSION_INFO "Mix-Version: " MIX_VERSION PAYMENT_VERSION_INFO DATA_RETENTION_LOG_INFO NEW_FLOW_CONTROL_INFO NEW_CHANNEL_ENCRYPTION_INFO WITH_INTEGRITY_CHECK_INFO "\nUsing: " OPENSSL_VERSION_TEXT "\nUsing Xerces-C: " MY_XERCES_VERSION "\n" |
Definition at line 674 of file StdAfx.h.
Referenced by CACmdLnOptions::parse(), and CACmdLnOptions::setLoggingOptions().
| #define MIX_VERSION_TESTING true |
Definition at line 39 of file StdAfx.h.
Referenced by CACmdLnOptions::parse(), and CACmdLnOptions::setLoggingOptions().
| #define MIX_VERSION_TESTING_TEXT "This is a testing/development version. Please do not expect it to work in a productive environment, and don't be surprised if you get unpredictive results or segmentation faults. If you don't like experiments, go and get the stable code.\n" |
Definition at line 41 of file StdAfx.h.
Referenced by CACmdLnOptions::parse(), and CACmdLnOptions::setLoggingOptions().
| #define MSG_NOSIGNAL 0 |
Definition at line 366 of file StdAfx.h.
Referenced by CADatagramSocket::receive(), CASocket::receive(), CADatagramSocket::send(), and CASocket::send().
| #define MY_XERCES_VERSION "unknown" |
| #define NEW_CHANNEL_ENCRYPTION |
| #define NEW_CHANNEL_ENCRYPTION_COMPATIBILITY "NewChannelEncryption" |
Definition at line 664 of file StdAfx.h.
Referenced by CAMix::appendCompatibilityInfo(), and CAMix::checkCompatibility().
| #define NEW_CHANNEL_ENCRYPTION_INFO " (with enhanced channel encryption)" |
| #define NEW_FLOW_CONTROL |
| #define NEW_FLOW_CONTROL_COMPATIBILITY "NewFlowControl" |
Definition at line 661 of file StdAfx.h.
Referenced by CAMix::appendCompatibilityInfo(), and CAMix::checkCompatibility().
| #define NEW_FLOW_CONTROL_INFO " (with new flow control)" |
| #define NO_INFOSERVICE_TRHEADS |
| #define NUM_LOGIN_WORKER_TRHEADS 10 |
Definition at line 186 of file StdAfx.h.
Referenced by CAAccountingInstance::CAAccountingInstance(), and CAFirstMix::init().
| #define PAYMENT_ACCOUNT_CERT_TIMEOUT 180 |
| #define PAYMENT_COMPATIBILITY "Payment" |
Definition at line 648 of file StdAfx.h.
Referenced by CAMix::appendCompatibilityInfo(), and CAMix::checkCompatibility().
| #define PAYMENT_VERSION "2.0" |
Definition at line 258 of file StdAfx.h.
Referenced by CAMix::initMixCascadeInfo(), and CAFirstMix::processKeyExchange().
| #define PAYMENT_VERSION_INFO " (payment)" |
| #define REPLAY_TIMESTAMP_PROPAGATION_INTERVALL 1 |
Definition at line 161 of file StdAfx.h.
Referenced by CAMiddleMix::init(), and CALastMix::init().
| #define RESETERROR errno=0; |
| #define SD_RECEIVE 0 |
| #define SET_NET_ERROR | ( | x | ) | (errno = x) |
Definition at line 427 of file StdAfx.h.
Referenced by CASocket::connect(), CAFirstMix::doUserLogin_internal(), CASocket::listen(), CAMsg::openLog(), CASocket::receiveFullyT(), CASocket::receiveLine(), CASingleSocketGroup::select_once(), and CASocket::sendFullyTimeOut().
| #define SOCKET int |
Definition at line 417 of file StdAfx.h.
Referenced by CASocketGroupEpoll::add(), and CAFirstMixA::sendToUsers().
| #define SOCKET_ERROR -1 |
Definition at line 421 of file StdAfx.h.
Referenced by CASocket::accept(), CADatagramSocket::bind(), CADatagramSocket::close(), CADatagramSocket::create(), CASocket::getLocalIP(), CASocket::getLocalPort(), CASocket::getNonBlocking(), CASocket::getPeerIP(), CASocket::getPeerPort(), CASocket::getRecvBuff(), CASocket::getSendBuff(), CASocket::getSendTimeOut(), CASocket::listen(), CALastMixA::loop(), CAFirstMixB::loop(), CALastMixB::loop(), CALocalProxy::loop(), mm_loopReadFromMixAfter(), mm_loopReadFromMixBefore(), CATLSClientSocket::receive(), CASocket::receive(), CAMuxSocket::receive(), CASocketGroup::select(), CADatagramSocket::send(), CATLSClientSocket::send(), CASocket::send(), and CASocket::setKeepAlive().
| #define THREAD_RETURN void* |
Definition at line 485 of file StdAfx.h.
Referenced by CAInfoService::sendHelo().
| #define THREAD_RETURN_ERROR return(NULL) |
Definition at line 486 of file StdAfx.h.
Referenced by consumer(), and producer().
| #define THREAD_RETURN_SUCCESS return (NULL) |
Definition at line 487 of file StdAfx.h.
Referenced by CATempIPBlockList::cleanupThreadMainLoop(), consumer(), db_loopMaintenance(), fm_loopAcceptUsers(), fm_loopDoUserLogin(), fm_loopLog(), fm_loopReadFromMix(), fm_loopSendToMix(), fml_loopDelayBuckets(), CAInfoService::InfoLoop(), iplist_loopDoLogCountries(), lm_loopLog(), lm_loopReadFromMix(), lm_loopSendToMix(), CAAccountingSettleThread::mainLoop(), mm_loopReadFromMixAfter(), mm_loopReadFromMixBefore(), mm_loopSendToMixAfter(), mm_loopSendToMixBefore(), CAAccountingInstance::processThread(), producer(), replaydb_loopMaintenance(), rp_loopPropagateTimestamp(), CAInfoService::TCascadeHelo(), CAInfoService::TCascadeStatus(), threadReConfigure(), CAInfoService::TMixHelo(), and worker_thread_main_loop().
| #define USER_SEND_BUFFER_RESUME 10000 |
Definition at line 671 of file StdAfx.h.
Referenced by CAMix::appendCompatibilityInfo(), and CAMix::checkCompatibility().
| #define WITH_INTEGRITY_CHECK_INFO |
| typedef SOCKADDR* LPSOCKADDR |
1.7.6.1