From c5fa52bbdf09d86bbd029a1c88174cdc569b97a5 Mon Sep 17 00:00:00 2001
From: Phil <phil@secdev.org>
Date: Thu, 29 Oct 2009 16:08:01 +0100
Subject: [PATCH] Modified Packet.summary() to take conf.emph in account

---
 scapy/packet.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scapy/packet.py b/scapy/packet.py
index 8ae52acc..e761d0d7 100644
--- a/scapy/packet.py
+++ b/scapy/packet.py
@@ -923,6 +923,12 @@ A side effect is that, to obtain "{" and "}" characters, you must use
             found = 1
         if not ret:
             ret = self.__class__.__name__
+        if self.__class__ in conf.emph:
+            impf = []
+            for f in self.fields_desc:
+                if f in conf.emph:
+                    impf.append("%s=%s" % (f.name, f.i2repr(self, self.getfieldval(f.name))))
+            ret = "%s [%s]" % (ret," ".join(impf))
         ret = "%s%s" % (ret,s)
         return found,ret,needed
 
-- 
GitLab