network.ts
Constructor
#
# desc : constructor
# inpt :
# |- getIPv4Addr : e.g. 192.168.99.100
# |- getMask : e.g. 255.255.255.0
# |- getSubsetEnabled : whether to allow subnets (all-0 and all-1)
#
public constructor(getIPv4Addr, getMask, getSubsetEnabled)
API
- Show total number of available IPv4 addresses
# inpt : [None]
# retn : integer (>=1)
public showAvailIPv4Addr()
# inpt : [None]
# retn : {string | "Class A", ... , "Class E", "Undefined Class"}
public showNetworkType()
# inpt : {showType | string, ""}
# retn
# |- string, e.g. 0.0.0.255
# |- number[], e.g. [0, 0, 0, 255]
public showWildcard(showType) : string | number[]
- Show the available IPv4 address list
# inpt : None
# retn : a dictionary,
# |- e.g. {0: Object, 1: Object, 2: Object, 3: {start : 0, end : 255}}
public showIPv4AvailList()
- Show all available IPv4 addresses
# inpt : None
# retn : a dictionary,
# |- e.g. {status: 0, info: "Show all available IPv4 addresses.", data: Array[254]}
public showAllIPAddress()
Examples
var net = new RangeOfIPv4Addr("192.168.99.100","255.255.255.0",true);
net.showAvailIPv4Addr();
net.showNetworkType();
net.showWildcard("decstr");
net.showWildcard("");
net.showIPv4AvailList();
net.showAllIPAddress();