nixos-module: add nic_router
This commit is contained in:
parent
576c1ca41a
commit
78cf596db3
|
@ -111,6 +111,7 @@
|
||||||
"log_core"
|
"log_core"
|
||||||
"nit_fb"
|
"nit_fb"
|
||||||
"nitpicker"
|
"nitpicker"
|
||||||
|
"nic_router"
|
||||||
"part_block"
|
"part_block"
|
||||||
"platform_drv"
|
"platform_drv"
|
||||||
"posix"
|
"posix"
|
||||||
|
|
|
@ -660,6 +660,75 @@ let rootInit =
|
||||||
(Some "nic_drv")
|
(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 =
|
||||||
Init.toChild
|
Init.toChild
|
||||||
Init::{ children = params.guests }
|
Init::{ children = params.guests }
|
||||||
|
@ -701,7 +770,7 @@ let rootInit =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
, ServiceRoute.child "File_system" "chroot"
|
, ServiceRoute.child "File_system" "chroot"
|
||||||
, ServiceRoute.child "Nic" "nic_drv"
|
, ServiceRoute.child "Nic" "nic_router"
|
||||||
, ServiceRoute.child "Rtc" "rtc"
|
, ServiceRoute.child "Rtc" "rtc"
|
||||||
, ServiceRoute.parentLabel
|
, ServiceRoute.parentLabel
|
||||||
"ROM"
|
"ROM"
|
||||||
|
|
Loading…
Reference in New Issue