Return TypeFunction nameArguments
voidSetStatusIP(hzIpaddr,hzIpStatus,unsigned int,)

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

Function Logic:

0:START 1:ipa==(uint32_t)0xffffffff||ipa==(uint32_t)0x00000000||ipa==(uint32_t)0x7f000001 2: No text 3:hzMapS::Exists 4:!_hzGlobal_StatusIP.Exists(ipa) 5:items ofstream::fail 6:!s_status_ip_os.fail() 7:ofstream::flush 8:ipi ipi ipi 9:reason&HZ_IPSTATUS_BLACK 10:time ipi 11:reason&HZ_IPSTATUS_WHITE 12:time ipi 13:hzMapS::Insert 14:ipi 15:(ipi.m_bInfo|reason)!=ipi.m_bInfo 16:ipi 17:reason&HZ_IPSTATUS_BLACK 18:time ipi 19:reason&HZ_IPSTATUS_WHITE 20:time ipi 21:items ofstream::fail 22:s_status_ip_os.fail() 23:ofstream::flush 24: No text

Function body:

void SetStatusIP (hzIpaddr ipa, hzIpStatus reason, unsigned int nDelay)
{
   _hzfunc(__func__) ;
   hzIpinfo    ipi ;
   if (ipa == IPADDR_BAD || ipa == IPADDR_NULL || ipa == IPADDR_LOCAL)
       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 ((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() ;
   }
}