mirror of
https://github.com/GNS3/gns3-server
synced 2025-02-17 18:42:00 +00:00
Require Dynamips version 0.2.16 to change the default QinQ Ethernet type.
This commit is contained in:
parent
6dd381a745
commit
8031cf1030
@ -21,12 +21,12 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L558
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
from pkg_resources import parse_version
|
||||||
|
|
||||||
from .device import Device
|
from .device import Device
|
||||||
from ..nios.nio_udp import NIOUDP
|
from ..nios.nio_udp import NIOUDP
|
||||||
from ..dynamips_error import DynamipsError
|
from ..dynamips_error import DynamipsError
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -255,16 +255,19 @@ class EthernetSwitch(Device):
|
|||||||
raise DynamipsError("Port {} is not allocated".format(port_number))
|
raise DynamipsError("Port {} is not allocated".format(port_number))
|
||||||
|
|
||||||
nio = self._nios[port_number]
|
nio = self._nios[port_number]
|
||||||
|
if ethertype != "0x8100" and parse_version(self.hypervisor.version) < parse_version('0.2.16'):
|
||||||
|
raise DynamipsError("Dynamips version required is >= 0.2.16 to change the default QinQ Ethernet type, detected version is {}".format(self.hypervisor.version))
|
||||||
|
|
||||||
yield from self._hypervisor.send('ethsw set_qinq_port "{name}" {nio} {outer_vlan} {ethertype}'.format(name=self._name,
|
yield from self._hypervisor.send('ethsw set_qinq_port "{name}" {nio} {outer_vlan} {ethertype}'.format(name=self._name,
|
||||||
nio=nio,
|
nio=nio,
|
||||||
outer_vlan=outer_vlan,
|
outer_vlan=outer_vlan,
|
||||||
ethertype=ethertype if ethertype != "0x8100" else ""))
|
ethertype=ethertype if ethertype != "0x8100" else ""))
|
||||||
|
|
||||||
log.info('Ethernet switch "{name}" [{id}]: port {port} set as a QinQ ({ethertype}) port with outer VLAN {vlan_id}'.format(name=self._name,
|
log.info('Ethernet switch "{name}" [{id}]: port {port} set as a QinQ ({ethertype}) port with outer VLAN {vlan_id}'.format(name=self._name,
|
||||||
id=self._id,
|
id=self._id,
|
||||||
port=port_number,
|
port=port_number,
|
||||||
vlan_id=outer_vlan,
|
vlan_id=outer_vlan,
|
||||||
ethertype=ethertype))
|
ethertype=ethertype))
|
||||||
self._mappings[port_number] = ("qinq", outer_vlan, ethertype)
|
self._mappings[port_number] = ("qinq", outer_vlan, ethertype)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
Loading…
Reference in New Issue
Block a user