daemon: updated linkconfig to calculate a limit when bw/delay are present, updated and simplified logic as well, leveraging code from outstanding pull request, updated code to factor in the mtu of the iface being configured

This commit is contained in:
Blake Harnden 2020-10-17 08:18:49 -07:00
parent 83ba6cea70
commit 380d411833
9 changed files with 65 additions and 78 deletions

View file

@ -19,6 +19,8 @@ if TYPE_CHECKING:
from core.emulator.session import Session
from core.nodes.base import CoreNetworkBase, CoreNode
DEFAULT_MTU: int = 1500
class CoreInterface:
"""
@ -338,7 +340,7 @@ class Veth(CoreInterface):
node: "CoreNode",
name: str,
localname: str,
mtu: int = 1500,
mtu: int = DEFAULT_MTU,
server: "DistributedServer" = None,
start: bool = True,
) -> None:
@ -403,7 +405,7 @@ class TunTap(CoreInterface):
node: "CoreNode",
name: str,
localname: str,
mtu: int = 1500,
mtu: int = DEFAULT_MTU,
server: "DistributedServer" = None,
start: bool = True,
) -> None: