Browse Source

nixos-module: add nic_router

remotes/praha/master
Emery Hemingway 1 year ago
parent
commit
78cf596db3
  1. 1
      nixos-modules/default.nix
  2. 71
      nixos-modules/dhall/root.dhall

1
nixos-modules/default.nix

@ -111,6 +111,7 @@
"log_core"
"nit_fb"
"nitpicker"
"nic_router"
"part_block"
"platform_drv"
"posix"

71
nixos-modules/dhall/root.dhall

@ -660,6 +660,75 @@ let rootInit =
(Some "nic_drv")
]
}
, nic_router =
Child.flat
Child.Attributes::{
, binary = "nic_router"
, config = Init.Config::{
, content =
[ XML.leaf
{ name = "uplink"
, attributes = toMap { domain = "uplink" }
}
, XML.element
{ name = "domain"
, attributes = toMap { name = "uplink" }
, content =
[ XML.leaf
{ name = "nat"
, attributes = toMap
{ domain = "default"
, tcp-ports = "1024"
, udp-ports = "1024"
, icmp-ids = "1024"
}
}
]
}
, XML.element
{ name = "domain"
, attributes = toMap
{ name = "default", interface = "10.0.1.1/24" }
, content =
[ XML.leaf
{ name = "dhcp-server"
, attributes = toMap
{ ip_first = "10.0.1.2"
, ip_last = "10.0.1.200"
, dns_server_from = "uplink"
}
}
]
# Prelude.List.map
Text
XML.Type
( λ(proto : Text)
→ XML.element
{ name = proto
, attributes = toMap
{ dst = "0.0.0.0/0"
, domain = "uplink"
}
, content =
[ XML.leaf
{ name = "permit-any"
, attributes = toMap
{ domain = "uplink" }
}
]
}
)
[ "tcp", "udp", "icmp" ]
}
]
, defaultPolicy = Some DefaultPolicy::{
, attributes = toMap { domain = "default" }
}
}
, provides = [ "Nic" ]
, resources = Init.Resources::{ ram = Genode.units.MiB 8 }
, routes = [ ServiceRoute.child "Nic" "nic_drv" ]
}
, init =
Init.toChild
Init::{ children = params.guests }
@ -701,7 +770,7 @@ let rootInit =
}
}
, ServiceRoute.child "File_system" "chroot"
, ServiceRoute.child "Nic" "nic_drv"
, ServiceRoute.child "Nic" "nic_router"
, ServiceRoute.child "Rtc" "rtc"
, ServiceRoute.parentLabel
"ROM"

Loading…
Cancel
Save