2
0
Форк 0
genodepkgs/tests/solo5/net_2if.dhall

85 рядки
2.9 KiB
Plaintext

let Genode = env:DHALL_GENODE
let Init = Genode.Init
let Child = Init.Child
let Res = Init.Resources
let init =
Init::{
, routes =
[ Genode.Init.ServiceRoute.parent "Timer"
, Genode.Init.ServiceRoute.child "Nic" "bridge"
]
, children = toMap
{ nic =
Child.flat
Child.Attributes::{
, binary = "nic_loopback"
, provides = [ "Nic" ]
}
, bridge =
Child.flat
Child.Attributes::{
, binary = "nic_bridge"
, resources = Res::{ caps = 200, ram = Genode.units.MiB 8 }
, provides = [ "Nic" ]
, routes = [ Genode.Init.ServiceRoute.child "Nic" "nic" ]
, config = Init.Config::{
, defaultPolicy = Some Init.Config.DefaultPolicy::{=}
, policies =
[ Init.Config.Policy::{
, attributes = toMap { ip_addr = "10.0.0.2" }
, label =
Init.LabelSelector.Type.Scoped "solo5 -> service0"
}
, Init.Config.Policy::{
, attributes = toMap { ip_addr = "10.1.0.2" }
, label =
Init.LabelSelector.Type.Scoped "solo5 -> service1"
}
]
}
}
, solo5 =
Child.flat
Child.Attributes::{
, binary = "solo5-test_net_2if"
, resources = Res::{ caps = 256, ram = Genode.units.MiB 5 }
, config = Init.Config::{
, content =
[ Genode.Prelude.XML.text
''
"<cmdline>limit</cmdline>"
''
]
}
}
, clients =
Child.flat
Child.Attributes::{
, binary = "sequence"
, exitPropagate = True
, resources = Res::{ caps = 256, ram = Genode.units.MiB 8 }
, config = Init.Config::{
, content =
[ Genode.Prelude.XML.text
''
<start name="ping0">
<binary name="ping"/>
<config interface="10.0.0.72/24" dst_ip="10.0.0.2" period_sec="1" count="4"/>
</start>
<start name="ping1">
<binary name="ping"/>
<config interface="10.1.0.72/24" dst_ip="10.1.0.2" period_sec="1" count="4"/>
</start>
''
]
}
}
}
}
in Init.toChild init Init.Attributes.default