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

Method hashret

scapy/layers/inet.py:591–604  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

589 return conf.route.route(dst, dev=scope)
590
591 def hashret(self):
592 if ((self.proto == socket.IPPROTO_ICMP) and
593 (isinstance(self.payload, ICMP)) and
594 (self.payload.type in [3, 4, 5, 11, 12])):
595 return self.payload.payload.hashret()
596 if not conf.checkIPinIP and self.proto in [4, 41]: # IP, IPv6
597 return self.payload.hashret()
598 if self.dst == "224.0.0.251": # mDNS
599 return struct.pack("B", self.proto) + self.payload.hashret()
600 if conf.checkIPsrc and conf.checkIPaddr:
601 return (strxor(inet_pton(socket.AF_INET, self.src),
602 inet_pton(socket.AF_INET, self.dst)) +
603 struct.pack("B", self.proto) + self.payload.hashret())
604 return struct.pack("B", self.proto) + self.payload.hashret()
605
606 def answers(self, other):
607 if not conf.checkIPinIP: # skip IP in IP and IPv6 in IP

Callers 3

hashretMethod · 0.45
hashretMethod · 0.45
hashretMethod · 0.45

Calls 2

strxorFunction · 0.90
inet_ptonFunction · 0.90

Tested by

no test coverage detected