Retrieve the record for the IP address.
| Return Type | Function name | Arguments |
|---|---|---|
| hzIpStatus | GetStatusIP | (hzIpaddr,) |
Declared in file: hzIpaddr.h
Defined in file : hzIpServer.cpp
Function Logic:
Function body:
hzIpStatus GetStatusIP (hzIpaddr ipa)
{
// Category: Internet Server
//
// Retrieve the record for the IP address.
_hzfunc(__func__) ;
hzIpinfo ipi ; // IP test blocker
uint32_t now ; // Epoch time
uint32_t ips ; // IP status as it currently applies
ips = (uint32_t) HZ_IPSTATUS_NULL ;
if (!_hzGlobal_StatusIP.Exists(ipa))
return HZ_IPSTATUS_NULL ;
// We have info on the IP address, but does it still apply?
now = time(0);
ipi = _hzGlobal_StatusIP[ipa] ;
if (ipi.m_bInfo & HZ_IPSTATUS_WHITE) // && (!ipi.m_tWhite || ipi.m_tWhite > now))
ips |= HZ_IPSTATUS_WHITE ;
// if (ipi.m_bInfo & HZ_IPSTATUS_BLACK && (!ipi.m_tWhite || ipi.m_tBlack > now))
if (ipi.m_bInfo & HZ_IPSTATUS_BLACK && (ipi.m_tBlack > now))
ips |= HZ_IPSTATUS_BLACK ;
return (hzIpStatus) ips ;
}