Skip to content
Snippets Groups Projects
Commit 41b2d37c authored by Phil's avatar Phil
Browse files

Added Raw.mysummary() that can be configured with conf.raw_summary

Either False, or True or a function to be applied to Raw.load
parent 666ad184
No related branches found
No related tags found
No related merge requests found
...@@ -315,6 +315,7 @@ extensions_paths: path or list of paths where extensions are to be looked for ...@@ -315,6 +315,7 @@ extensions_paths: path or list of paths where extensions are to be looked for
promisc = 1 promisc = 1
sniff_promisc = 1 sniff_promisc = 1
raw_layer = None raw_layer = None
raw_summary = False
default_l2 = None default_l2 = None
l2types = Num2Layer() l2types = Num2Layer()
l3types = Num2Layer() l3types = Num2Layer()
......
...@@ -1067,6 +1067,14 @@ class Raw(Packet): ...@@ -1067,6 +1067,14 @@ class Raw(Packet):
# t = self.load # t = self.load
# l = min(len(s), len(t)) # l = min(len(s), len(t))
# return s[:l] == t[:l] # 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)
class Padding(Raw): class Padding(Raw):
name = "Padding" name = "Padding"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment