summaryrefslogtreecommitdiff
path: root/src/Network.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-11-29 21:40:16 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2024-11-29 21:40:16 +0100
commit1670b628cc7accea1c7ecd9359a7dccb6bd50a45 (patch)
treeefad1d67a737fe654acb8ccfeb3b06fcf767de63 /src/Network.hs
parent56878ad193071539a1fd83298c4509fe21b880fd (diff)
Represent root network as an internal variable
Diffstat (limited to 'src/Network.hs')
-rw-r--r--src/Network.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Network.hs b/src/Network.hs
index aa06952..c841acb 100644
--- a/src/Network.hs
+++ b/src/Network.hs
@@ -5,6 +5,7 @@ module Network (
NodeName(..), textNodeName, unpackNodeName,
nextNodeName,
+ rootNetworkVar,
newInternet, delInternet,
newSubnet,
newNode,
@@ -112,6 +113,9 @@ instance ExprType Node where
]
+rootNetworkVar :: TypedVarName Network
+rootNetworkVar = TypedVarName (VarName "$ROOT_NET")
+
nextPrefix :: IpPrefix -> [Word8] -> Word8
nextPrefix _ used = maximum (0 : used) + 1