* [dts] [PATCH V1] framework/packet: add Dot1BR module to sys search path
@ 2021-10-27 10:19 Dong, JunX
0 siblings, 0 replies; only message in thread
From: Dong, JunX @ 2021-10-27 10:19 UTC (permalink / raw)
To: dts; +Cc: PingX.Yu, weix.ling, junx.dong
From: "Dong, JunX" <junx.dong@intel.com>
Signed-off-by: Dong, JunX <junx.dong@intel.com>
---
framework/packet.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/framework/packet.py b/framework/packet.py
index e6fd74a0..633dd36f 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -35,22 +35,24 @@ Base on scapy(python program for packet manipulation)
from importlib import import_module
from socket import AF_INET6
-
from scapy.all import *
-
from .utils import convert_int2ip, convert_ip2int
# load extension layers
exec_file = os.path.realpath(__file__)
DTS_PATH = exec_file.replace('/framework/packet.py', '')
+
# exec_file might be .pyc file, if so, remove 'c'.
TMP_PATH = DTS_PATH[:-1] + '/output/tmp/pcap/' if exec_file.endswith('.pyc') else DTS_PATH + '/output/tmp/pcap/'
if not os.path.exists(TMP_PATH):
os.system('mkdir -p %s' % TMP_PATH)
+# add /tmp/dep to sys.path
+sys.path.append('/tmp/dep')
+
scapy_modules_required = {'scapy.contrib.gtp': ['GTP_U_Header', 'GTPPDUSessionContainer'],
'scapy.contrib.lldp': ['LLDPDU', 'LLDPDUManagementAddress'],
- 'dep.scapy_modules.Dot1BR': ['Dot1BR'],
+ 'Dot1BR': ['Dot1BR'],
'scapy.contrib.pfcp': ['PFCP'],
'scapy.contrib.nsh': ['NSH'],
'scapy.contrib.igmp': ['IGMP'],
--
2.24.1.windows.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-27 10:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-27 10:19 [dts] [PATCH V1] framework/packet: add Dot1BR module to sys search path Dong, JunX
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).