daemon: cleaned up InterfaceData class, it now leverages dataclass, removed extra bloat and no longer requires parameters as they are optional

This commit is contained in:
Blake Harnden 2020-06-09 08:48:18 -07:00
parent 6ddf1ac9a4
commit 18044f9474
5 changed files with 31 additions and 85 deletions

View file

@ -29,7 +29,9 @@ _EMANE_MODELS = [
_DIR = os.path.dirname(os.path.abspath(__file__))
def ping(from_node, to_node, ip_prefixes, count=3):
def ping(
from_node: CoreNode, to_node: CoreNode, ip_prefixes: IpPrefixes, count: int = 3
):
address = ip_prefixes.ip4_address(to_node)
try:
from_node.cmd(f"ping -c {count} {address}")

View file

@ -21,7 +21,7 @@ _MOBILITY_FILE = os.path.join(_PATH, "mobility.scen")
_WIRED = [PtpNet, HubNode, SwitchNode]
def ping(from_node, to_node, ip_prefixes):
def ping(from_node: CoreNode, to_node: CoreNode, ip_prefixes: IpPrefixes):
address = ip_prefixes.ip4_address(to_node)
try:
from_node.cmd(f"ping -c 1 {address}")