MCPcopy Index your code
hub / github.com/secdev/scapy / valid_net

Function valid_net

scapy/utils.py:777–786  ·  view source on GitHub ↗
(addr)

Source from the content-addressed store, hash-verified

775
776
777def valid_net(addr):
778 # type: (str) -> bool
779 try:
780 addr = plain_str(addr)
781 except UnicodeDecodeError:
782 return False
783 if '/' in addr:
784 ip, mask = addr.split('/', 1)
785 return valid_ip(ip) and mask.isdigit() and 0 <= int(mask) <= 32
786 return valid_ip(addr)
787
788
789def valid_ip6(addr):

Callers 1

ARPClass · 0.90

Calls 2

plain_strFunction · 0.90
valid_ipFunction · 0.85

Tested by

no test coverage detected