2017-10-19 18:40:35 +00:00
|
|
|
|
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
|
|
|
|
set targets "core init drivers/timer server/nic_router server/nic_bridge
|
|
|
|
test/lwip/http_srv_static test/lwip/http_clnt test/lwip/udp
|
2018-02-08 14:33:08 +00:00
|
|
|
server/nic_loopback [platform_drv_build_components]"
|
2017-10-19 18:40:35 +00:00
|
|
|
|
|
|
|
proc client_bin { prot } {
|
|
|
|
if {$prot == "udp"} { return "test-lwip-udp-client" }
|
|
|
|
if {$prot == "http"} { return "test-http_clnt" } }
|
|
|
|
|
|
|
|
proc server_bin { prot } {
|
|
|
|
if {$prot == "udp"} { return "test-lwip-udp-server" }
|
|
|
|
if {$prot == "http"} { return "test-lwip_httpsrv_static" } }
|
|
|
|
|
2017-11-13 20:14:44 +00:00
|
|
|
proc client_config { name prot ip_addr gateway netmask nic srv_port srv_ip } {
|
2017-12-13 16:33:34 +00:00
|
|
|
global nr_of_clients
|
|
|
|
incr nr_of_clients
|
2017-10-19 18:40:35 +00:00
|
|
|
append result {
|
2017-11-13 20:14:44 +00:00
|
|
|
<start name="} $name {" caps="200" priority="-1">
|
2017-10-19 18:40:35 +00:00
|
|
|
<binary name="} [client_bin $prot] {" />
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="} $nic {"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
<config server_ip="} $srv_ip {" server_port="} $srv_port {">
|
|
|
|
<vfs> <dir name="dev"> <log/> </dir> </vfs>
|
2018-03-19 17:31:23 +00:00
|
|
|
}
|
|
|
|
if {$ip_addr == "dhcp"} {
|
|
|
|
append result {
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log"/>}
|
|
|
|
} else {
|
|
|
|
append result {
|
2017-10-19 18:40:35 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" ip_addr="} $ip_addr {"
|
2018-03-19 17:31:23 +00:00
|
|
|
gateway="} $gateway {" netmask="} $netmask {"/>}
|
|
|
|
}
|
|
|
|
append result {
|
2017-10-19 18:40:35 +00:00
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
2017-11-13 20:14:44 +00:00
|
|
|
proc server_config { name prot ip_addr gateway netmask nic port } {
|
2017-10-19 18:40:35 +00:00
|
|
|
append result {
|
2017-11-13 20:14:44 +00:00
|
|
|
<start name="} $name {" caps="200" priority="-1">
|
2017-10-19 18:40:35 +00:00
|
|
|
<binary name="} [server_bin $prot] {" />
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="} $nic {"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
<config port="} $port {">
|
|
|
|
<vfs> <dir name="dev"> <log/> </dir> </vfs>
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" ip_addr="} $ip_addr {"
|
|
|
|
gateway="} $gateway {" netmask="} $netmask {"/>
|
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
|
|
|
set boot_modules "
|
2018-02-08 14:33:08 +00:00
|
|
|
core init timer nic_router nic_bridge nic_loopback ld.lib.so
|
2018-04-23 08:49:21 +00:00
|
|
|
libc.lib.so vfs.lib.so lwip.lib.so [client_bin udp] [server_bin udp]
|
2018-02-08 14:33:08 +00:00
|
|
|
[client_bin http] [server_bin http] [platform_drv_boot_modules]"
|
2017-10-19 18:40:35 +00:00
|
|
|
|
2018-02-08 14:33:08 +00:00
|
|
|
append qemu_args "-nographic "
|