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

Function cset_sort

scapy/utils6.py:58–72  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

56 with some specific destination that uses this prefix.
57 """
58 def cset_sort(x, y):
59 # type: (str, str) -> int
60 x_global = 0
61 if in6_isgladdr(x):
62 x_global = 1
63 y_global = 0
64 if in6_isgladdr(y):
65 y_global = 1
66 res = y_global - x_global
67 if res != 0 or y_global != 1:
68 return res
69 # two global addresses: if one is native, it wins.
70 if not in6_isaddr6to4(x):
71 return -1
72 return -res
73
74 cset = iter([]) # type: Iterator[Tuple[str, int, str]]
75 if in6_isgladdr(addr) or in6_isuladdr(addr):

Callers

nothing calls this directly

Calls 2

in6_isgladdrFunction · 0.85
in6_isaddr6to4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…