MCPcopy Create free account
hub / github.com/secdev/scapy / in4_isincluded

Function in4_isincluded

scapy/utils.py:840–848  ·  view source on GitHub ↗

Returns True when 'addr' belongs to prefix/mask. False otherwise.

(addr, prefix, mask)

Source from the content-addressed store, hash-verified

838
839
840def in4_isincluded(addr, prefix, mask):
841 # type: (str, str, int) -> bool
842 """
843 Returns True when 'addr' belongs to prefix/mask. False otherwise.
844 """
845 temp = inet_pton(socket.AF_INET, addr)
846 pref = in4_cidr2mask(mask)
847 zero = inet_pton(socket.AF_INET, prefix)
848 return zero == strand(temp, pref)
849
850
851def in4_ismaddr(str):

Callers 4

in4_ismaddrFunction · 0.85
in4_ismlladdrFunction · 0.85
in4_ismgladdrFunction · 0.85
in4_ismlsaddrFunction · 0.85

Calls 3

inet_ptonFunction · 0.90
in4_cidr2maskFunction · 0.85
strandFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…