Genode Packages collection https://git.sr.ht/~ehmry/genodepkgs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

net_2if.dhall 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. let Genode = env:DHALL_GENODE
  2. let Init = Genode.Init
  3. let Child = Init.Child
  4. let Res = Init.Resources
  5. let init =
  6. Init::{
  7. , routes =
  8. [ Genode.Init.ServiceRoute.parent "Timer"
  9. , Genode.Init.ServiceRoute.child "Nic" "bridge"
  10. ]
  11. , children = toMap
  12. { nic =
  13. Child.flat
  14. Child.Attributes::{
  15. , binary = "nic_loopback"
  16. , provides = [ "Nic" ]
  17. }
  18. , bridge =
  19. Child.flat
  20. Child.Attributes::{
  21. , binary = "nic_bridge"
  22. , resources = Res::{ caps = 200, ram = Genode.units.MiB 8 }
  23. , provides = [ "Nic" ]
  24. , routes = [ Genode.Init.ServiceRoute.child "Nic" "nic" ]
  25. , config = Init.Config::{
  26. , defaultPolicy = Some Init.Config.DefaultPolicy::{=}
  27. , policies =
  28. [ Init.Config.Policy::{
  29. , attributes = toMap { ip_addr = "10.0.0.2" }
  30. , label =
  31. Init.LabelSelector.Type.Scoped "solo5 -> service0"
  32. }
  33. , Init.Config.Policy::{
  34. , attributes = toMap { ip_addr = "10.1.0.2" }
  35. , label =
  36. Init.LabelSelector.Type.Scoped "solo5 -> service1"
  37. }
  38. ]
  39. }
  40. }
  41. , solo5 =
  42. Child.flat
  43. Child.Attributes::{
  44. , binary = "solo5-test_net_2if"
  45. , resources = Res::{ caps = 256, ram = Genode.units.MiB 5 }
  46. , config = Init.Config::{
  47. , content =
  48. [ Genode.Prelude.XML.text
  49. ''
  50. "<cmdline>limit</cmdline>"
  51. ''
  52. ]
  53. }
  54. }
  55. , clients =
  56. Child.flat
  57. Child.Attributes::{
  58. , binary = "sequence"
  59. , exitPropagate = True
  60. , resources = Res::{ caps = 256, ram = Genode.units.MiB 8 }
  61. , config = Init.Config::{
  62. , content =
  63. [ Genode.Prelude.XML.text
  64. ''
  65. <start name="ping0">
  66. <binary name="ping"/>
  67. <config interface="10.0.0.72/24" dst_ip="10.0.0.2" period_sec="1" count="4"/>
  68. </start>
  69. <start name="ping1">
  70. <binary name="ping"/>
  71. <config interface="10.1.0.72/24" dst_ip="10.1.0.2" period_sec="1" count="4"/>
  72. </start>
  73. ''
  74. ]
  75. }
  76. }
  77. }
  78. }
  79. in Init.toChild init Init.Attributes.default