genode/repos/os/run/nic_router_disable_arp.run
Martin Stein 1d2649b49a nic_router: act as "Uplink" server
Let the NIC router provide an Uplink service besides the Nic service that it
already provided. Requests for an Uplink session towards the NIC router are
assigned to Domains using the same <policy> configuration tags that are used in
order to assign Nic session requests. The MAC addresses of Uplink session
components are _NOT_ considered during the allocation of MAC addresses for NIC
session components at the same Domain. The task of avoiding MAC address clashes
between Uplink session components and Nic session components is therefore left
to the integrator. Apart from that, Uplink session components are treated by
the NIC router like any other interface.

Ref #3961
2021-01-25 13:57:43 +01:00

106 lines
2.5 KiB
Plaintext

if {![have_include power_on/qemu] || [have_spec foc] || [have_spec linux] ||
[have_spec rpi3] || [expr [have_spec imx53] && [have_spec trustzone]]} {
puts "Run script is not supported on this platform."
exit 0
}
create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
[depot_user]/pkg/[drivers_nic_pkg]
build { app/ping server/nic_router init }
append config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="200"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="drivers" caps="1000" managing_system="yes">
<resource name="RAM" quantum="32M"/>
<binary name="init"/>
<route>
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
<provides> <service name="Nic"/> </provides>
</start>
<start name="nic_router">
<resource name="RAM" quantum="10M"/>
<provides>
<service name="Nic"/>
<service name="Uplink"/>
</provides>
<config>
<policy label_prefix="ping" domain="downlink"/>
<uplink domain="uplink"/>
<domain name="uplink" use_arp="no" verbose_packets="yes">
<nat domain="downlink" icmp-ids="100"/>
</domain>
<domain name="downlink" interface="10.0.3.1/24">
<icmp dst="10.0.2.2/24" domain="uplink"/>
</domain>
</config>
<route>
<service name="Nic"> <child name="drivers"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="ping">
<resource name="RAM" quantum="8M"/>
<config interface="10.0.3.2/24"
gateway="10.0.3.1"
dst_ip="10.0.2.2"
period_sec="1"
count="2"/>
<route>
<service name="Nic"> <child name="nic_router"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>}
install_config $config
build_boot_image { ping nic_router init }
append qemu_args " -nographic "
append_qemu_nic_args
set done_string ".*child \"ping\" exited with exit value 0.*\n"
run_genode_until $done_string 10
grep_output { ARP }
compare_output_to {}