MCPcopy Index your code
hub / github.com/retspen/webvirtcloud / network_size

Function network_size

vrtManager/network.py:6–17  ·  view source on GitHub ↗

Func return gateway, mask and dhcp pool.

(net, dhcp=None)

Source from the content-addressed store, hash-verified

4
5
6def network_size(net, dhcp=None):
7 """
8 Func return gateway, mask and dhcp pool.
9 """
10 mask = IP(net).strNetmask()
11 addr = IP(net)
12 gateway = addr[1].strNormal()
13 dhcp_pool = [addr[2].strNormal(), addr[addr.len() - 2].strNormal()]
14 if dhcp:
15 return gateway, mask, dhcp_pool
16 else:
17 return gateway, mask, None
18
19
20class wvmNetworks(wvmConnect):

Callers 1

networksFunction · 0.90

Calls 4

IPClass · 0.90
strNetmaskMethod · 0.80
strNormalMethod · 0.80
lenMethod · 0.80

Tested by

no test coverage detected