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

Method route

scapy/layers/l2.py:567–582  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

565 return self_psrc[:len(other_pdst)] == other_pdst[:len(self_psrc)]
566
567 def route(self):
568 # type: () -> Tuple[Optional[str], Optional[str], Optional[str]]
569 fld, dst = cast(Tuple[MultipleTypeField, str],
570 self.getfield_and_val("pdst"))
571 fld_inner, dst = fld._find_fld_pkt_val(self, dst)
572 scope = None
573 if isinstance(dst, (Net, _ScopedIP)):
574 scope = dst.scope
575 if isinstance(dst, Gen):
576 dst = next(iter(dst))
577 if isinstance(fld_inner, IP6Field):
578 return conf.route6.route(dst, dev=scope)
579 elif isinstance(fld_inner, IPField):
580 return conf.route.route(dst, dev=scope)
581 else:
582 return None, None, None
583
584 def extract_padding(self, s):
585 # type: (bytes) -> Tuple[bytes, bytes]

Callers 15

sendMethod · 0.45
sendMethod · 0.45
sendMethod · 0.45
p0f_getlocalsigsFunction · 0.45
getmacbyipFunction · 0.45
__init__Method · 0.45
arpcachepoisonFunction · 0.45
arp_mitmFunction · 0.45
arpingFunction · 0.45
make_replyMethod · 0.45
arpleakFunction · 0.45
parse_argsMethod · 0.45

Calls 2

getfield_and_valMethod · 0.45
_find_fld_pkt_valMethod · 0.45

Tested by

no test coverage detected