tightvnc/server-config-lib/IpAccessRule.cpp
//
// TODO: Create own inet_addr method that will support TCHAR strings
//
Create own inet_addr method that will support TCHAR strings
Create own inet_addr method that will support TCHAR strings
bool IpAccessRule::isIncludingAddress(unsigned long ip) const
{
  AnsiStringStorage firstIpAnsi(&m_firstIp);
  AnsiStringStorage lastIpAnsi(&m_lastIp);
  unsigned long firstIp = inet_addr(firstIpAnsi.getString());
  unsigned long lastIp  = firstIp;
  if (!m_lastIp.isEmpty()) {
    lastIp = inet_addr(lastIpAnsi.getString());
  }
  if (ip == firstIp || ip == lastIp) {
    return true;
  }
  if (compareIp(ip, firstIp) == 1 && compareIp(ip, lastIp) == -1) {
    return true;
  }
  return false;
}
bool IpAccessRule :: isIncludingAddress ( unsigned long ip ) const { AnsiStringStorage firstIpAnsi ( & m_firstIp ) ; AnsiStringStorage lastIpAnsi ( & m_lastIp ) ; unsigned long firstIp = inet_addr ( firstIpAnsi . getString ( ) ) ; unsigned long lastIp = firstIp ; if ( ! m_lastIp . isEmpty ( ) ) { lastIp = inet_addr ( lastIpAnsi . getString ( ) ) ; } if ( ip == firstIp || ip == lastIp ) { return true ; } if ( compareIp ( ip , firstIp ) == 1 && compareIp ( ip , lastIp ) == -1 ) { return true ; } return false ; }
TODO: Create own inet_addr method that will support TCHAR strings
TODO : Create own inet_addr method that will support TCHAR strings