Mixe for Privacy and Anonymity in the Internet
Defines | Typedefs
StdAfx.h File Reference
#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.

Defines

#define MIX_VERSION   "00.11.08"
#define MIX_VERSION_TESTING   true
#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"
#define NO_INFOSERVICE_TRHEADS
#define LOG_COUNTRIES_INTERVALL   6
#define DELAY_USERS_BUCKET_GROW_INTERVALL   100
#define DELAY_USERS_BUCKET_GROW   10
#define NEW_FLOW_CONTROL
#define NEW_CHANNEL_ENCRYPTION
#define REPLAY_TIMESTAMP_PROPAGATION_INTERVALL   1
#define KEEP_ALIVE_TRAFFIC_RECV_WAIT_TIME   75000
#define KEEP_ALIVE_TRAFFIC_SEND_WAIT_TIME   65000
#define MAX_POLLFD   8192
#define CLIENTS_PER_IP   10
#define CHANNELS_PER_CLIENT   50
#define FIRST_MIX_RECEIVE_SYM_KEY_FROM_JAP_TIME_OUT   40000
#define LAST_MIX_TO_PROXY_CONNECT_TIMEOUT   2000
#define AI_LOGIN_SO_TIMEOUT   (UINT32) 10000
#define LAST_MIX_TO_PROXY_SEND_TIMEOUT   (UINT32)5000
#define MIX_TO_INFOSERVICE_TIMEOUT   30000
#define NUM_LOGIN_WORKER_TRHEADS   10
#define MAX_LOGIN_QUEUE   500
#define MAX_USER_SEND_QUEUE   100000
#define MAX_DATA_PER_CHANNEL   100000
#define USER_SEND_BUFFER_RESUME   10000
#define PAYMENT_ACCOUNT_CERT_TIMEOUT   180
#define CLEANUP_THREAD_SLEEP_INTERVAL   60
#define BALANCE_REQUEST_TIMEOUT   60
#define MAX_SIGNATURE_ELEMENTS   10
#define FLOW_CONTROL_SENDME_HARD_LIMIT   160
#define FLOW_CONTROL_SENDME_SOFT_LIMIT   80
#define MAX_READ_FROM_PREV_MIX_QUEUE_SIZE   10000000
#define MAX_READ_FROM_NEXT_MIX_QUEUE_SIZE   10000000
#define MAX_MIXIN_SEND_QUEUE_SIZE   10000000
#define MAX_NEXT_MIX_QUEUE_SIZE   10000000
#define DEFAULT_INFOSERVICE   "141.76.45.37"
#define MIX_POOL_TIMEOUT   200
#define DUMMY_CHANNEL   0
#define FM_PACKET_STATS_LOG_INTERVALL   1
#define LM_PACKET_STATS_LOG_INTERVALL   1
#define MIX_CASCADE_PROTOCOL_VERSION_0_1_2   12
#define MIX_CASCADE_PROTOCOL_VERSION_0_1_1   11
#define MIX_CASCADE_PROTOCOL_VERSION_0_1_0   10
#define MIX_CASCADE_PROTOCOL_VERSION_0_8   8
#define MIX_CASCADE_PROTOCOL_VERSION_0_7   7
#define MIX_CASCADE_PROTOCOL_VERSION_0_5   5
#define MIX_CASCADE_PROTOCOL_VERSION_0_4   4
#define MIX_CASCADE_PROTOCOL_VERSION_0_3   3
#define MIX_CASCADE_PROTOCOL_VERSION_0_2   2
#define MIX_CASCADE_PROTOCOL_VERSION   "0.81"
#define PAYMENT_VERSION   "2.0"
#define HAVE_UNIX_DOMAIN_PROTOCOL
#define HAVE_VSNPRINTF
#define HAVE_SNPRINTF
#define HAVE_POLL
#define HAVE_O_SYNC
#define HAVE_PTHREAD_MUTEX_INIT
#define HAVE_PTHREAD_COND_INIT
#define HAVE_SEM_INIT
#define HAVE_TCP_KEEPALIVE
#define MSG_NOSIGNAL   0
#define SOCKET   int
#define ioctlsocket(a, b, c)   ioctl(a,b,c)
#define closesocket(s)   close(s)
#define SOCKET_ERROR   -1
#define INVALID_SOCKET   -1
#define SD_RECEIVE   0
#define SD_SEND   1
#define SD_BOTH   2
#define GET_NET_ERROR   (errno)
#define SET_NET_ERROR(x)   (errno = x)
#define GET_NET_ERROR_STR(x)   (errno == E_TIMEDOUT ? "Connection timed out." : (errno == E_SOCKETCLOSED ? "Socket is closed." : strerror(x)))
#define RESETERROR   errno=0;
#define GETERROR   (errno)
#define ERR_INTERN_TIMEDOUT   ETIMEDOUT
#define ERR_INTERN_CONNREFUSED   ECONNREFUSED
#define ERR_INTERN_WOULDBLOCK   EAGAIN
#define ERR_INTERN_SOCKET_CLOSED   EBADF
#define HAVE_PTHREAD_CV
#define HAVE_PTHREAD_MUTEXES
#define HAVE_PTHREAD_SEMAPHORE
#define THREAD_RETURN   void*
#define THREAD_RETURN_ERROR   return(NULL)
#define THREAD_RETURN_SUCCESS   return (NULL)
#define ASSERT(cond, msg)
#define MY_XERCES_VERSION   "unknown"
#define PAYMENT_VERSION_INFO   " (payment)"
#define PAYMENT_COMPATIBILITY   "Payment"
#define DATA_RETENTION_LOG_INFO
#define NEW_FLOW_CONTROL_INFO   " (with new flow control)"
#define NEW_FLOW_CONTROL_COMPATIBILITY   "NewFlowControl"
#define NEW_CHANNEL_ENCRYPTION_INFO   " (with enhanced channel encryption)"
#define NEW_CHANNEL_ENCRYPTION_COMPATIBILITY   "NewChannelEncryption"
#define WITH_INTEGRITY_CHECK_INFO
#define WITH_INTEGRITY_CHECK_COMPATIBILITY
#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"
#define MIX_VERSION_COMPATIBILITY   PAYMENT_COMPATIBILITY " " NEW_FLOW_CONTROL_COMPATIBILITY " " NEW_CHANNEL_ENCRYPTION_COMPATIBILITY " " WITH_INTEGRITY_CHECK_COMPATIBILITY
#define MAX_ACCOUNTNUMBER   999999999999ULL
#define MIN_ACCOUNTNUMBER   100000000000ULL
#define ACCOUNT_NUMBER_SIZE   12

Typedefs

typedef int socklen_t
typedef struct sockaddr SOCKADDR
typedef SOCKADDRLPSOCKADDR
typedef struct hostent HOSTENT

Define Documentation

#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 
)
#define BALANCE_REQUEST_TIMEOUT   60

Definition at line 202 of file StdAfx.h.

#define CHANNELS_PER_CLIENT   50

Definition at line 179 of file StdAfx.h.

Definition at line 201 of file StdAfx.h.

Referenced by CATempIPBlockList::cleanupThreadMainLoop().

#define CLIENTS_PER_IP   10

Definition at line 178 of file StdAfx.h.

#define closesocket (   s)    close(s)

Definition at line 420 of file StdAfx.h.

Referenced by CADatagramSocket::close(), and CASocket::close().

Definition at line 657 of file StdAfx.h.

#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
#define DUMMY_CHANNEL   0
#define ERR_INTERN_CONNREFUSED   ECONNREFUSED
#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
#define ERR_INTERN_WOULDBLOCK   EAGAIN

Definition at line 433 of file StdAfx.h.

Referenced by CASocket::receive(), and CASocket::send().

Definition at line 181 of file StdAfx.h.

Referenced by CAFirstMix::doUserLogin_internal().

Definition at line 206 of file StdAfx.h.

Referenced by CALastMixA::loop().

Definition at line 207 of file StdAfx.h.

Referenced by CALocalProxy::init(), CALastMixA::loop(), and CALastMix::processKeyExchange().

Definition at line 232 of file StdAfx.h.

Referenced by CAFirstMix::init().

#define GET_NET_ERROR   (errno)
#define GET_NET_ERROR_STR (   x)    (errno == E_TIMEDOUT ? "Connection timed out." : (errno == E_SOCKETCLOSED ? "Socket is closed." : strerror(x)))
#define GETERROR   (errno)

Definition at line 430 of file StdAfx.h.

#define HAVE_O_SYNC

Definition at line 331 of file StdAfx.h.

#define HAVE_POLL

Definition at line 330 of file StdAfx.h.

Definition at line 333 of file StdAfx.h.

#define HAVE_PTHREAD_CV

Definition at line 454 of file StdAfx.h.

Definition at line 332 of file StdAfx.h.

Definition at line 457 of file StdAfx.h.

Definition at line 465 of file StdAfx.h.

#define HAVE_SEM_INIT

Definition at line 334 of file StdAfx.h.

#define HAVE_SNPRINTF

Definition at line 329 of file StdAfx.h.

Definition at line 336 of file StdAfx.h.

Definition at line 327 of file StdAfx.h.

#define HAVE_VSNPRINTF

Definition at line 328 of file StdAfx.h.

#define INVALID_SOCKET   -1

Definition at line 422 of file StdAfx.h.

Referenced by CADatagramSocket::create(), and CASocket::create().

#define ioctlsocket (   a,
  b,
 
)    ioctl(a,b,c)

Definition at line 419 of file StdAfx.h.

Referenced by CASocket::setNonBlocking().

Definition at line 163 of file StdAfx.h.

Referenced by CACmdLnOptions::setKeepAliveTraffic().

Definition at line 165 of file StdAfx.h.

Referenced by CACmdLnOptions::setKeepAliveTraffic().

Definition at line 184 of file StdAfx.h.

Referenced by CALastMixA::loop(), and CALastMixB::loop().

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

Definition at line 191 of file StdAfx.h.

#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
#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

Definition at line 190 of file StdAfx.h.

#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().

Definition at line 237 of file StdAfx.h.

Referenced by CALocalProxy::processKeyExchange().

Definition at line 236 of file StdAfx.h.

Definition at line 235 of file StdAfx.h.

Definition at line 245 of file StdAfx.h.

Referenced by CALocalProxy::processKeyExchange().

Definition at line 244 of file StdAfx.h.

Referenced by CALocalProxy::processKeyExchange().

Definition at line 243 of file StdAfx.h.

Referenced by CALocalProxy::processKeyExchange().

Definition at line 242 of file StdAfx.h.

Definition at line 240 of file StdAfx.h.

Definition at line 239 of file StdAfx.h.

#define MIX_POOL_TIMEOUT   200
#define MIX_TO_INFOSERVICE_TIMEOUT   30000
#define MIX_VERSION   "00.11.08"

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
#define MY_XERCES_VERSION   "unknown"

Definition at line 635 of file StdAfx.h.

Definition at line 157 of file StdAfx.h.

#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)"

Definition at line 663 of file StdAfx.h.

Definition at line 156 of file StdAfx.h.

#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)"

Definition at line 660 of file StdAfx.h.

Definition at line 78 of file StdAfx.h.

#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

Definition at line 200 of file StdAfx.h.

#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)"

Definition at line 647 of file StdAfx.h.

Definition at line 161 of file StdAfx.h.

Referenced by CAMiddleMix::init(), and CALastMix::init().

#define RESETERROR   errno=0;

Definition at line 429 of file StdAfx.h.

#define SD_BOTH   2

Definition at line 425 of file StdAfx.h.

#define SD_RECEIVE   0

Definition at line 423 of file StdAfx.h.

#define SD_SEND   1

Definition at line 424 of file StdAfx.h.

#define SET_NET_ERROR (   x)    (errno = x)
#define SOCKET   int

Definition at line 417 of file StdAfx.h.

Referenced by CASocketGroupEpoll::add(), and CAFirstMixA::sendToUsers().

#define SOCKET_ERROR   -1
#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)
#define USER_SEND_BUFFER_RESUME   10000

Definition at line 192 of file StdAfx.h.

Definition at line 671 of file StdAfx.h.

Referenced by CAMix::appendCompatibilityInfo(), and CAMix::checkCompatibility().

Definition at line 670 of file StdAfx.h.


Typedef Documentation

typedef struct hostent HOSTENT

Definition at line 418 of file StdAfx.h.

typedef SOCKADDR* LPSOCKADDR

Definition at line 416 of file StdAfx.h.

typedef struct sockaddr SOCKADDR

Definition at line 415 of file StdAfx.h.

typedef int socklen_t

Definition at line 351 of file StdAfx.h.