From 6deca20deb8935b812f4d54b94d5cfaea67f8c1c Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Wed, 5 Oct 2022 09:45:52 +0000
Subject: [PATCH] Added support for emulated pakcet switches

Common:
- added device type for emulated pakcet switches

PathComp:
- added layer mapping for emulated pakcet switches
---
 src/common/DeviceTypes.py                                        | 1 +
 .../frontend/service/algorithms/tools/ConstantsMappings.py       | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/common/DeviceTypes.py b/src/common/DeviceTypes.py
index c5ea4c54f..1cda1fa21 100644
--- a/src/common/DeviceTypes.py
+++ b/src/common/DeviceTypes.py
@@ -18,6 +18,7 @@ class DeviceTypeEnum(Enum):
     EMULATED_DATACENTER       = 'emu-datacenter'
     EMULATED_OPEN_LINE_SYSTEM = 'emu-open-line-system'
     EMULATED_PACKET_ROUTER    = 'emu-packet-router'
+    EMULATED_PACKET_SWITCH    = 'emu-packet-switch'
     DATACENTER                = 'datacenter'
     MICROVAWE_RADIO_SYSTEM    = 'microwave-radio-system'
     OPTICAL_ROADM             = 'optical-roadm'
diff --git a/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py b/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py
index 2ff97b96c..8561ab110 100644
--- a/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py
+++ b/src/pathcomp/frontend/service/algorithms/tools/ConstantsMappings.py
@@ -83,6 +83,7 @@ DEVICE_TYPE_TO_LAYER = {
 
     DeviceTypeEnum.EMULATED_PACKET_ROUTER.value   : DeviceLayerEnum.PACKET_DEVICE,
     DeviceTypeEnum.PACKET_ROUTER.value            : DeviceLayerEnum.PACKET_DEVICE,
+    DeviceTypeEnum.EMULATED_PACKET_SWITCH.value   : DeviceLayerEnum.MAC_LAYER_DEVICE,
     DeviceTypeEnum.PACKET_SWITCH.value            : DeviceLayerEnum.MAC_LAYER_DEVICE,
     DeviceTypeEnum.P4_SWITCH.value                : DeviceLayerEnum.MAC_LAYER_DEVICE,
 
-- 
GitLab