51 for(
UINT i=0;i<512;i++)
102 #ifndef MUXSOCKET_CIPHER_NO_ENCRYPTION
107 CAMsg::printMsg(LOG_WARN,
"MuxSocket: Using NULL cipher (no encryption)!\n");
191 memcpy(tmpBuff,pPacket,16);
209 memcpy(pPacket,tmpBuff,16);
220 memcpy(tmpBuff,pPacket,16);
227 memcpy(pPacket,tmpBuff,16);
236 pinoutPacket->
flags=htons(pinoutPacket->
flags);
254 CAMsg::printMsg(LOG_CRIT,
"Could not lock MuxSocket receive method! Error code: %d\n", retLock);
289 "Could not lock MuxSocket timed receive method! Error code: %d\n", retLock);
320 add64(timeE,msTimeout);
323 oSocketGroup.
add(*
this);
331 ret=oSocketGroup.
select(dt);
struct __t_hash_key_entry__ t_hashkeylistEntry
SYMCHANNELCIPHER_ALGORITHM
SINT32 getcurrentTimeMillis(UINT64 &u64Time)
Gets the current Systemtime in milli seconds.
SINT32 getRandom(UINT32 *val)
Gets 32 random bits.
UINT32 diff64(const UINT64 &bigop, const UINT64 &smallop)
bool isEqual64(UINT64 &op1, UINT64 &op2)
void add64(UINT64 &op1, UINT32 op2)
bool isGreater64(UINT64 &op1, UINT64 &op2)
#define GET_NET_ERROR_STR(x)
SINT32 receiveFully(UINT8 *buff, UINT32 len)
Receives all len bytes.
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
SINT32 close()
Closes the underlying socket.
SINT32 accept(UINT16 port)
SINT32 receive(MIXPACKET *pPacket)
Receives a whole MixPacket.
SINT32 connect(CASocketAddr &psa)
static t_hashkeylistEntry * ms_phashkeylistAvailableHashKeys
CASymCipherMuxSocket * m_pCipherOut
SINT32 send(MIXPACKET *pPacket)
Sends a MixPacket over the Network.
CASymCipherMuxSocket * m_pCipherIn
SINT32 setCASocket(CASocket *pSocket)
This will set the underlying CASocket.
static CAMutex * ms_pcsHashKeyList
SINT32 prepareForSend(MIXPACKET *inoutPacket)
SINT32 setCipher(SYMCHANNELCIPHER_ALGORITHM algCipher)
static SINT32 ms_nMaxHashKeyValue
t_hashkeylistEntry * m_pHashKeyEntry
CAMuxSocket(SYMCHANNELCIPHER_ALGORITHM algCipher)
This is an abstract class for representing a socket address used in CASocket, CADatagramSocket and CA...
virtual SINT32 getType() const =0
The type (family) of socket for which this address is useful.
virtual SINT32 receive(UINT8 *buff, UINT32 len)
Will receive some bytes from the socket.
virtual SINT32 listen(const CASocketAddr &psa)
Starts listening on address psa.
virtual SINT32 setReuseAddr(bool b)
virtual SINT32 sendFully(const UINT8 *buff, UINT32 len)
Sends all data over the network.
virtual SINT32 accept(CASocket &s)
Accepts a new connection.
virtual SINT32 connect(const CASocketAddr &psa)
static CASymChannelCipher * createCipher(SYMCHANNELCIPHER_ALGORITHM alg)
struct __t_hash_key_entry__ * next
#define CHANNEL_SIG_CRIME_ID_MASK
#define CHANNEL_SIG_CRIME