summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-02-27 16:56:07 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-02-27 21:00:40 +0100
commitb7bce56d84fa4f1d505f4b77014d0244f6e9f5ba (patch)
tree9a4b929145ece1521bc5b9d28b4da759c2912ba4
parent13f549d68fb235522ae98bf04d2e09abdb1442ea (diff)
Add ifname member to the node type
Changelog: Added `ifname` member to the `node` type
-rw-r--r--README.md5
-rw-r--r--src/Network.hs5
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 )
]