MCPcopy Index your code
hub / github.com/sshuttle/sshuttle / _maskbits

Function _maskbits

sshuttle/server.py:49–56  ·  view source on GitHub ↗
(netmask)

Source from the content-addressed store, hash-verified

47
48
49def _maskbits(netmask):
50 # FIXME: IPv4 only
51 if not netmask:
52 return 32
53 for i in range(32):
54 if netmask[0] & _shl(1, i):
55 return 32 - i
56 return 0
57
58
59def _shl(n, bits):

Callers 2

_route_netstatFunction · 0.85
_route_windowsFunction · 0.85

Calls 1

_shlFunction · 0.85

Tested by

no test coverage detected