29 #if !defined ONLY_LOCAL_PROXY || defined INCLUDE_FIRST_MIX
46 m_Random=
new UINT8[56];
62 m_Random=
new UINT8[56];
70 for(
UINT32 i=0;i<=0xFFFF;i++)
108 UINT16 hashvalue=(ip[2]<<8)|ip[3];
117 memcpy(m_Random,ip,4);
118 MD5(m_Random,56,hash);
119 CAMsg::printMsg(LOG_DEBUG,
"Inserting new IP-Address: %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X !\n",hash[0],hash[1],hash[2],hash[3],hash[4],hash[5],hash[6],hash[7],hash[8],hash[9],hash[10],hash[11],hash[12],hash[13],hash[14],hash[15]);
122 CAMsg::printMsg(LOG_DEBUG,
"Inserting new IP-Address: {%u.%u.%u.%u} !\n",ip[0],ip[1],ip[2],ip[3]);
125 memcpy(entry->
ip,ip,2);
133 CAMsg::printMsg(LOG_DEBUG,
"New IP-Address inserted: %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X !\n",hash[0],hash[1],hash[2],hash[3],hash[4],hash[5],hash[6],hash[7],hash[8],hash[9],hash[10],hash[11],hash[12],hash[13],hash[14],hash[15]);
136 CAMsg::printMsg(LOG_DEBUG,
"New IP-Address inserted: {%u.%u.%u.%u} !\n",ip[0],ip[1],ip[2],ip[3]);
147 if(memcmp(entry->
ip,ip,2)==0)
150 CAMsg::printMsg(LOG_DEBUG,
"Inserting IP-Address: {%u.%u.%u.%u} !\n",ip[0],ip[1],ip[2],ip[3]);
155 CAMsg::printMsg(LOG_CRIT,
"Possible flooding attack from: %u.%u.x.x !\n",ip[0],ip[1],ip[2],ip[3]);
163 CAMsg::printMsg(LOG_DEBUG,
"IP-Address inserted: {%u.%u.%u.%u} !\n",ip[0],ip[1],ip[2],ip[3]);
170 }
while(entry!=NULL);
174 memcpy(entry->
ip,ip,2);
194 UINT16 hashvalue=(ip[2]<<8)|ip[3];
201 CAMsg::printMsg(LOG_INFO,
"Try to remove IP which is not in the hashtable of the IP-list - possible inconsistences in IPList!\n");
209 if(memcmp(entry->
ip,ip,2)==0)
217 memcpy(m_Random,ip,4);
218 MD5(m_Random,56,hash);
219 CAMsg::printMsg(LOG_DEBUG,
"Removing IP-Address: %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X !\n",hash[0],hash[1],hash[2],hash[3],hash[4],hash[5],hash[6],hash[7],hash[8],hash[9],hash[10],hash[11],hash[12],hash[13],hash[14],hash[15]);
222 CAMsg::printMsg(LOG_DEBUG,
"Removing IP-Address: {%u.%u.%u.%u} !\n",ip[0],ip[1],ip[2],ip[3]);
241 CAMsg::printMsg(LOG_INFO,
"Try to remove IP which is not in list - possible inconsistences in IPList!\n");
struct _iplist_t IPLISTENTRY
#define MAX_IP_CONNECTIONS
The default value of allowed insertions, until insertIP() will return an error.
volatile PIPLIST VOLATILE_PIPLIST
SINT32 getRandom(UINT32 *val)
Gets 32 random bits.
SINT32 insertIP(const UINT8 ip[4])
Inserts the IP-Address into the list.
~CAIPList()
Deletes the IPList and frees all used resources.
UINT32 m_allowedConnections
volatile VOLATILE_PIPLIST * m_HashTable
CAIPList()
TODO: Fix LOG_TRAFFIC output which is not done anymore, as per default no log message are ommited....
SINT32 removeIP(const UINT8 ip[4])
Removes the IP-Address from the list.
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
This structure is used for building the IP-List.
UINT8 ip[2]
Next element, NULL if element is the last one.
volatile UINT8 count
First two Bytes of the IP-Address.