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

Method __div__

scapy/packet.py:631–641  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

629 return self.build()
630
631 def __div__(self, other):
632 # type: (Any) -> Self
633 if isinstance(other, Packet):
634 cloneA = self.copy()
635 cloneB = other.copy()
636 cloneA.add_payload(cloneB)
637 return cloneA
638 elif isinstance(other, (bytes, str, bytearray, memoryview)):
639 return self / conf.raw_layer(load=bytes_encode(other))
640 else:
641 return other.__rdiv__(self) # type: ignore
642 __truediv__ = __div__
643
644 def __rdiv__(self, other):

Callers

nothing calls this directly

Calls 4

copyMethod · 0.95
bytes_encodeFunction · 0.90
__rdiv__Method · 0.80
add_payloadMethod · 0.45

Tested by

no test coverage detected