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

Class Raw

scapy/packet.py:1997–2023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1995
1996
1997class Raw(Packet):
1998 name = "Raw"
1999 fields_desc = [StrField("load", b"")]
2000
2001 def __init__(self, _pkt=b"", *args, **kwargs):
2002 # type: (bytes, *Any, **Any) -> None
2003 if _pkt and not isinstance(_pkt, bytes):
2004 if isinstance(_pkt, tuple):
2005 _pkt, bn = _pkt
2006 _pkt = bytes_encode(_pkt), bn
2007 else:
2008 _pkt = bytes_encode(_pkt)
2009 super(Raw, self).__init__(_pkt, *args, **kwargs)
2010
2011 def answers(self, other):
2012 # type: (Packet) -> int
2013 return 1
2014
2015 def mysummary(self):
2016 # type: () -> str
2017 cs = conf.raw_summary
2018 if cs:
2019 if callable(cs):
2020 return "Raw %s" % cs(self.load)
2021 else:
2022 return "Raw %r" % self.load
2023 return Packet.mysummary(self)
2024
2025
2026class Padding(Raw):

Callers 15

encryptMethod · 0.90
decryptMethod · 0.90
compute_icrcMethod · 0.90
IE_DispatcherFunction · 0.90
guess_payload_classMethod · 0.90
guess_payload_classMethod · 0.90
getfieldMethod · 0.90
_get_initial_requestsMethod · 0.90
_get_initial_requestsMethod · 0.90
__init__Method · 0.90
SOMEIPClass · 0.90
SecOC_CANFDClass · 0.90

Calls 1

StrFieldClass · 0.90

Tested by

no test coverage detected