mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Suspend link
This commit is contained in:
7 files changed
+162
-9
No files matched your search
@@ -122,6 +122,7 @@ class Link:
|
||||
self._streaming_pcap = None
|
||||
self._created = False
|
||||
self._link_type = "ethernet"
|
||||
self._suspend = False
|
||||
self._filters = {}
|
||||
|
||||
@property
|
||||
@@ -131,6 +132,15 @@ class Link:
|
||||
"""
|
||||
return self._filters
|
||||
|
||||
def get_active_filters(self):
|
||||
"""
|
||||
Return the active filters.
|
||||
If the node is suspend the filters will be override
|
||||
"""
|
||||
if self._suspend:
|
||||
return {"frequency_drop": [-1]}
|
||||
return self._filters
|
||||
|
||||
@asyncio.coroutine
|
||||
def update_filters(self, filters):
|
||||
"""
|
||||
@@ -155,6 +165,12 @@ class Link:
|
||||
if self._created:
|
||||
yield from self.update()
|
||||
|
||||
@asyncio.coroutine
|
||||
def update_suspend(self, value):
|
||||
if value != self._suspend:
|
||||
self._suspend = value
|
||||
yield from self.update()
|
||||
|
||||
@property
|
||||
def created(self):
|
||||
"""
|
||||
@@ -401,7 +417,8 @@ class Link:
|
||||
return {
|
||||
"nodes": res,
|
||||
"link_id": self._id,
|
||||
"filters": self._filters
|
||||
"filters": self._filters,
|
||||
"suspend": self._suspend
|
||||
}
|
||||
return {
|
||||
"nodes": res,
|
||||
@@ -411,5 +428,6 @@ class Link:
|
||||
"capture_file_name": self._capture_file_name,
|
||||
"capture_file_path": self.capture_file_path,
|
||||
"link_type": self._link_type,
|
||||
"filters": self._filters
|
||||
"filters": self._filters,
|
||||
"suspend": self._suspend
|
||||
}
|
||||
Reference in new issue
Block a user