Module:IP: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
allow strings to isInSubnet
(make private constructors for IPAddress and Subnet strings as well as for RawIPs)
(allow strings to isInSubnet)
Line 413:
function obj:isInSubnet(subnet)
checkSelf('isInSubnet', self)
local tp = type(subnet)
checkTypeMulti('isInSubnet', 1, subnet, {'string', 'table'})
if tp == 'string' then
subnet = makeSubnet(subnet)
elseif tp == 'table' then
-- TODO: check if Subnet object
else
checkTypeMulti('isInSubnet', 1, subnet, {'string', 'table'})
end
return subnet:containsIP(self)
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu