test suite reviews and discussions
 help / color / mirror / Atom feed
From: Haiyang Zhao <haiyangx.zhao@intel.com>
To: dts@dpdk.org, Lijuan.Tu@intel.com
Cc: Haiyang Zhao <haiyangx.zhao@intel.com>
Subject: [dts] [PATCH V1] framework/packet: remove sctp in required scapy module
Date: Wed, 13 Jan 2021 13:33:21 +0800	[thread overview]
Message-ID: <20210113053321.4580-1-haiyangx.zhao@intel.com> (raw)

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


             reply	other threads:[~2021-01-13  5:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  5:33 Haiyang Zhao [this message]
2021-01-13  5:42 ` Zhao, HaiyangX
2021-01-13  8:49 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210113053321.4580-1-haiyangx.zhao@intel.com \
    --to=haiyangx.zhao@intel.com \
    --cc=Lijuan.Tu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).