Set reason for noting the IP address. Add the IP address to _hzGlobal_StatusIP if not already present.

Return TypeFunction nameArguments
voidSetStatusIP(hzIpaddr,hzIpStatus,uint32_t,)

Declared in file: hzIpaddr.h
Defined in file : hzIpServer.cpp

Function Logic:

0:START 1:unknown 2: No text 3:unknown 4:items 5: No text 6:items 7:unknown 8:items 9:unknown 10:items 11:ipi reason ipi 12:unknown 13:ipi 14:items 15:ipi 16:unknown 17:ipi 18:unknown 19:items 20:items 21:unknown 22:items 23:items 24: No text

Function body:

void SetStatusIP (hzIpaddr ipa)hzIpStatus reason, uint32_t nDelay, 
{
   //  Category: Internet Server
   //  
   //  Set reason for noting the IP address. Add the IP address to _hzGlobal_StatusIP if not already present.
   _hzfunc(__func__) ;
   hzIpinfo    ipi ;       //  IP test blocker
   if (ipa == IPADDR_BAD || ipa == IPADDR_NULL || ipa == IPADDR_LOCAL)
       return ;
   if (_hzGlobal_Logins.Exists(ipa))
   {
       threadLog("Cannot set status of logged-in IP addr %s\n", ipa.Full()) ;
       return ;
   }
   threadLog("Setting Status of IP %s\n", *ipa) ;
   if (!_hzGlobal_StatusIP.Exists(ipa))
   {
       s_status_ip_os << ipa << "\n" ;
       if (!s_status_ip_os.fail())
           s_status_ip_os.flush() ;
       ipi.m_nSince = 1;
       //  ipi.m_nTotal = 1 ;
       ipi.m_bInfo |= (reason & 0xff);
       if (reason & HZ_IPSTATUS_BLACK)
           ipi.m_tBlack = time(0);
       //  if (reason & HZ_IPSTATUS_WHITE)
       //   ipi.m_tWhite = time(0) ;
       _hzGlobal_StatusIP.Insert(ipa, ipi) ;
   }
   else
   {
       ipi = _hzGlobal_StatusIP[ipa] ;
       //  If status has changed, note this in the file
       if ((ipi.m_bInfo | reason) != ipi.m_bInfo)
       {
           ipi.m_bInfo |= reason ;
           if (reason & HZ_IPSTATUS_BLACK)
               ipi.m_tBlack = nDelay ? nDelay + time(0): 0;
           //  if (reason & HZ_IPSTATUS_WHITE)
           //   ipi.m_tWhite = nDelay ? nDelay + time(0) : 0 ;
       }
       s_status_ip_os << ipa << "\n" ;
       if (s_status_ip_os.fail())
           threadLog("BLOCKED IP ADDR NOT RECORDED %s\n", *ipa) ;
       else
           s_status_ip_os.flush() ;
   }
}