From b7bce56d84fa4f1d505f4b77014d0244f6e9f5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 27 Feb 2025 16:56:07 +0100 Subject: Add ifname member to the node type Changelog: Added `ifname` member to the `node` type --- README.md | 5 ++++- src/Network.hs | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 11d9b17..2c11170 100644 --- a/README.md +++ b/README.md @@ -178,8 +178,11 @@ and used by `spawn` or network configuration commands. Members: +`ifname` +: Name of the primary network interface of the node. + `ip` -: String representation of node's IP address. +: String representation of the node primary IP address. `network` : The network which the node belogs to. diff --git a/src/Network.hs b/src/Network.hs index 3059773..e12231d 100644 --- a/src/Network.hs +++ b/src/Network.hs @@ -109,8 +109,9 @@ instance ExprType Node where textExprValue n = T.pack "n:" <> textNodeName (nodeName n) recordMembers = map (first T.pack) - [ ("ip", RecordSelector $ textIpAddress . nodeIp) - , ("network", RecordSelector $ nodeNetwork) + [ ( "ifname", RecordSelector $ const ("veth0" :: Text) ) + , ( "ip", RecordSelector $ textIpAddress . nodeIp ) + , ( "network", RecordSelector $ nodeNetwork ) ] -- cgit v1.2.3