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

Function in6_getscope

scapy/utils6.py:853–879  ·  view source on GitHub ↗

Returns the scope of the address.

(addr)

Source from the content-addressed store, hash-verified

851
852
853def in6_getscope(addr):
854 # type: (str) -> int
855 """
856 Returns the scope of the address.
857 """
858 if in6_isgladdr(addr) or in6_isuladdr(addr):
859 scope = IPV6_ADDR_GLOBAL
860 elif in6_islladdr(addr):
861 scope = IPV6_ADDR_LINKLOCAL
862 elif in6_issladdr(addr):
863 scope = IPV6_ADDR_SITELOCAL
864 elif in6_ismaddr(addr):
865 if in6_ismgladdr(addr):
866 scope = IPV6_ADDR_GLOBAL
867 elif in6_ismlladdr(addr):
868 scope = IPV6_ADDR_LINKLOCAL
869 elif in6_ismsladdr(addr):
870 scope = IPV6_ADDR_SITELOCAL
871 elif in6_ismnladdr(addr):
872 scope = IPV6_ADDR_LOOPBACK
873 else:
874 scope = -1
875 elif addr == '::1':
876 scope = IPV6_ADDR_LOOPBACK
877 else:
878 scope = -1
879 return scope
880
881
882def in6_get_common_plen(a, b):

Callers 4

_in6_getifaddrFunction · 0.90
in6_getifaddrFunction · 0.90
_get_if_listFunction · 0.90
scope_cmpFunction · 0.85

Calls 9

in6_isgladdrFunction · 0.85
in6_isuladdrFunction · 0.85
in6_islladdrFunction · 0.85
in6_issladdrFunction · 0.85
in6_ismaddrFunction · 0.85
in6_ismgladdrFunction · 0.85
in6_ismlladdrFunction · 0.85
in6_ismsladdrFunction · 0.85
in6_ismnladdrFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…