From e6906d142a749beb49c7efab8170828b1b9f1ea4 Mon Sep 17 00:00:00 2001
From: Phil <phil@secdev.org>
Date: Thu, 29 Oct 2009 15:44:22 +0100
Subject: [PATCH] Had packet.show() and packet.__repr__() take conf.emph in
 account

---
 scapy/packet.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scapy/packet.py b/scapy/packet.py
index 656645c9..b4abb001 100644
--- a/scapy/packet.py
+++ b/scapy/packet.py
@@ -226,7 +226,7 @@ class Packet(BasePacket):
                 val =  f.i2repr(self, self.overloaded_fields[f.name])
             else:
                 continue
-            if isinstance(f, Emph):
+            if isinstance(f, Emph) or f in conf.emph:
                 ncol = ct.emph_field_name
                 vcol = ct.emph_field_value
             else:
@@ -775,7 +775,7 @@ Creates an EPS file describing a packet. If filename is not provided a temporary
         for f in self.fields_desc:
             if isinstance(f, ConditionalField) and not f._evalcond(self):
                 continue
-            if isinstance(f, Emph):
+            if isinstance(f, Emph) or f in conf.emph:
                 ncol = ct.emph_field_name
                 vcol = ct.emph_field_value
             else:
-- 
GitLab