Raw
is a class of the packet.py
file of Scapy . You can view the source code here .
class Raw(Packet):
name = "Raw"
fields_desc = [ StrField("load", "") ]
def answers(self, other):
return 1
#s = str(other)
#t = self.load
#l = min(len(s), len(t))
#return s[:l] == t[:l]
def mysummary(self):
cs = conf.raw_summary
if cs:
if callable(cs):
return "Raw %s" % cs(self.load)
else:
return "Raw %r" % self.load
return Packet.mysummary(self)
The letter b
or B
preceding the string in Python 2 is ignored :
A prefix b
or B
is ignored in Python 2; this indicates that the
literal must become a byte literal in Python 3. The prefix u
or b
can be followed by a r
prefix.
In Python 3, according to documentation :
(In free translation)
Bytes
literals are always prefixed with b
or B
; they produce an instance of type bytes
instead of type str
.
They can only contain ASCII characters; bytes
with a numeric value of
128 or greater should be expressed with escapes.
You should pass the variables ans
and unans
because the function sr
returns a tuple returning packages and responses and unanswered packets.