xowf::IpRange method allow_access (public)

 <instance of xowf::IpRange[i]> allow_access ip

Defined in packages/xowf/tcl/iprange-procs.tcl

Check, if provided IP address is in the provided ranges of disallowed or allowed addresses. First, the explicitly disallowed addresses are checked, then the explicitly allowed ones. Addresses can be specified in the following formats:

  • IP address in CIDR format (e.g., 127.208.0.0/16)
  • IP address containing wildcard "*"
  • literal IP address

Parameters:
ip (required)
Returns:
boolean value expressing success

Testcases:
No testcase defined.
Source code:
foreach spec ${:disallowed} {
  if {[:match $spec $ip]} {
    return 0
  }
}

foreach spec ${:allowed} {
  if {[:match $spec $ip]} {
    return 1
  }
}
return 0
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: