test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] framework/packet: remove sctp in required scapy module
@ 2021-01-13  5:33 Haiyang Zhao
  2021-01-13  5:42 ` Zhao, HaiyangX
  2021-01-13  8:49 ` Tu, Lijuan
  0 siblings, 2 replies; 3+ messages in thread
From: Haiyang Zhao @ 2021-01-13  5:33 UTC (permalink / raw)
  To: dts, Lijuan.Tu; +Cc: Haiyang Zhao

sctp is in scapy.layers and is been imported by default,
so remove the importing sctp code.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/packet.py | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/framework/packet.py b/framework/packet.py
index 2cd64d02..6d9bf246 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -52,8 +52,13 @@ from utils import convert_ip2int
 from utils import convert_int2ip
 
 scapy_modules_required = {'gtp': ['GTP_U_Header', 'GTPPDUSessionContainer'],
-                          'lldp': ['LLDPDU', 'LLDPDUManagementAddress'], 'Dot1BR': ['Dot1BR'], 'pfcp': ['PFCP'],
-                          'nsh': ['NSH'], 'igmp': ['IGMP'], 'mpls': ['MPLS'], 'sctp': ['SCTP', 'SCTPChunkData']}
+                          'lldp': ['LLDPDU', 'LLDPDUManagementAddress'],
+                          'Dot1BR': ['Dot1BR'],
+                          'pfcp': ['PFCP'],
+                          'nsh': ['NSH'],
+                          'igmp': ['IGMP'],
+                          'mpls': ['MPLS'],
+                          }
 local_modules = [m[:-3] for m in os.listdir(DEP_FOLDER + '/scapy_modules') if (m.endswith('.py') and not m.startswith('__'))]
 
 for m in scapy_modules_required:
@@ -63,14 +68,9 @@ for m in scapy_modules_required:
             for clazz in scapy_modules_required[m]:
                 locals().update({clazz: getattr(module, clazz)})
         else:
-            if m == 'sctp':
-                module = import_module(f'scapy.layers.{m}')
-                for clazz in scapy_modules_required[m]:
-                    locals().update({clazz: getattr(module, clazz)})
-            else:
-                module = import_module(f'scapy.contrib.{m}')
-                for clazz in scapy_modules_required[m]:
-                    locals().update({clazz: getattr(module, clazz)})
+            module = import_module(f'scapy.contrib.{m}')
+            for clazz in scapy_modules_required[m]:
+                locals().update({clazz: getattr(module, clazz)})
     except Exception as e:
         print(e)
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-13  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  5:33 [dts] [PATCH V1] framework/packet: remove sctp in required scapy module Haiyang Zhao
2021-01-13  5:42 ` Zhao, HaiyangX
2021-01-13  8:49 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).