Module:IP: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
use Subnet instead of IPBlock, plus some more interface ideas
(don't allow setting a new IP address in IPAddress objects - this doesn't make much sense)
(use Subnet instead of IPBlock, plus some more interface ideas)
Line 46:
end
 
function obj:isInRangeisInSubnet(rangesubnet)
return false
end
 
function obj:getNextIP()
end
 
function obj:getPreviousIP()
end
 
Line 82 ⟶ 88:
 
--------------------------------------------------------------------------------
-- IPBlockSubnet class
-- Represents a block of ipv4 or ipv6 addresses.
--------------------------------------------------------------------------------
 
local IPBlockSubnet = {}
 
do
Line 93 ⟶ 99:
 
-- Constructor
function IPBlockSubnet.new(...options)
-- Set up structure
local obj = setmetatable({}, mt)
Line 102 ⟶ 108:
end
 
function obj:removeIPsaddIPsFromString(...s)
end
 
function obj:getPrefix()
return '1.2.3.40'
end
 
function obj:getHighestIP()
return '1.2.3.255'
end
 
Line 131 ⟶ 141:
function obj:containsIP(ip)
return false
end
 
function obj:overlapsSubnet(subnet)
end
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu