2017-03-08 14:40:18 +00:00
|
|
|
#
|
|
|
|
# Build components
|
|
|
|
#
|
|
|
|
|
|
|
|
proc enable_test_1 { } { return 1 }
|
|
|
|
proc enable_test_2 { } { return 1 }
|
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
source ${genode_dir}/repos/libports/run/nic_router.inc
|
2017-03-08 14:40:18 +00:00
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
lappend targets server/nic_dump
|
2017-03-08 14:40:18 +00:00
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
build $targets
|
2017-03-08 14:40:18 +00:00
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
proc test_1_config { } {
|
|
|
|
if {[enable_test_1]} { return "
|
2017-11-13 20:14:44 +00:00
|
|
|
[client_config udp_client_2 udp 10.0.2.212 10.0.2.1 255.255.255.0 nic_bridge 1 10.0.2.55]
|
|
|
|
[server_config udp_server_2 udp 18.17.16.15 18.17.16.14 255.255.0.0 nic_router 1 ]" }
|
2017-03-08 14:40:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proc test_2_config { } {
|
|
|
|
if {[enable_test_2]} { return "
|
2017-11-13 20:14:44 +00:00
|
|
|
[client_config http_client_1 http 10.0.2.201 10.0.2.1 255.255.255.0 nic_bridge 80 10.0.2.55]
|
|
|
|
[server_config http_server_1 http 192.168.1.18 192.168.1.1 255.255.255.0 nic_router 80 ]" }
|
2017-03-08 14:40:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
append config {
|
2017-10-19 18:40:35 +00:00
|
|
|
<config prio_levels="2">
|
2017-03-08 14:40:18 +00:00
|
|
|
<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>
|
|
|
|
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
|
|
|
|
2017-03-08 14:40:18 +00:00
|
|
|
} [platform_drv_config] {
|
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
<start name="timer" priority="0">
|
2017-03-08 14:40:18 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
|
|
|
|
2018-02-08 14:33:08 +00:00
|
|
|
<start name="nic_loopback" priority="-1">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
</start>
|
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
<start name="nic_dump" priority="-1">
|
2017-03-08 14:40:18 +00:00
|
|
|
<resource name="RAM" quantum="6M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
2018-04-06 09:56:33 +00:00
|
|
|
<config uplink="bridge"
|
|
|
|
downlink="router"
|
|
|
|
time="yes"
|
2018-04-06 13:47:12 +00:00
|
|
|
default="name"
|
2018-04-06 09:56:33 +00:00
|
|
|
eth="name"
|
|
|
|
arp="all"
|
|
|
|
ipv4="default"
|
|
|
|
dhcp="no"
|
|
|
|
udp="no"
|
|
|
|
icmp="all"
|
|
|
|
tcp="default" />
|
2017-03-08 14:40:18 +00:00
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_bridge"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
<start name="nic_router" caps="200" priority="-1">
|
2017-03-08 14:40:18 +00:00
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
2017-11-28 14:03:28 +00:00
|
|
|
<config verbose="no">
|
2017-03-08 14:40:18 +00:00
|
|
|
|
|
|
|
<policy label_prefix="udp_client_1" domain="udp_client_1" />
|
|
|
|
<policy label_prefix="http_client_3" domain="http_client_3" />
|
|
|
|
<policy label_prefix="udp_client_3" domain="udp_client_3" />
|
|
|
|
<policy label_prefix="http_server_1" domain="http_server_1" />
|
|
|
|
<policy label_prefix="http_server_2" domain="http_server_2" />
|
|
|
|
<policy label_prefix="udp_server_1" domain="udp_server_1" />
|
|
|
|
<policy label_prefix="udp_server_2" domain="udp_server_2" />
|
|
|
|
|
|
|
|
<domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1">
|
|
|
|
<tcp-forward port="80" domain="http_server_1" to="192.168.1.18" />
|
|
|
|
<tcp-forward port="8080" domain="http_server_2" to="192.168.2.72" />
|
|
|
|
<udp-forward port="1" domain="udp_server_2" to="18.17.16.15" />
|
|
|
|
<nat domain="http_client_3" tcp-ports="6" />
|
|
|
|
<ip dst="217.13.192.0/24" domain="udp_client_3" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="udp_client_1" interface="10.0.98.33/24">
|
|
|
|
<udp-forward port="1337" domain="udp_server_1" to="10.0.99.55" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="http_client_3" interface="100.200.0.1/24">
|
|
|
|
<tcp dst="10.0.0.0/16">
|
|
|
|
<permit port="2345" domain="uplink" />
|
|
|
|
</tcp>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="udp_client_3" interface="217.13.192.1/24">
|
|
|
|
<ip dst="10.0.2.0/24" domain="uplink" />
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="http_server_1" interface="192.168.1.1/24" />
|
|
|
|
<domain name="http_server_2" interface="192.168.2.1/24" />
|
|
|
|
<domain name="udp_server_1" interface="10.0.99.33/24" />
|
|
|
|
<domain name="udp_server_2" interface="18.17.16.14/24" />
|
|
|
|
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_dump"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
<start name="nic_bridge" caps="200" priority="-1">
|
2017-03-08 14:40:18 +00:00
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
<config>
|
|
|
|
<policy label_prefix="nic_dump" ip_addr="10.0.2.55" />
|
|
|
|
<policy label_prefix="http_client_1" ip_addr="10.0.2.201" />
|
|
|
|
<policy label_prefix="http_client_2" ip_addr="10.0.2.202" />
|
|
|
|
<policy label_prefix="http_server_3" ip_addr="10.0.2.203" />
|
|
|
|
<policy label_prefix="udp_client_2" ip_addr="10.0.2.212" />
|
|
|
|
<policy label_prefix="udp_server_3" ip_addr="10.0.2.213" />
|
|
|
|
</config>
|
|
|
|
<route>
|
2018-02-08 14:33:08 +00:00
|
|
|
<service name="Nic"> <child name="nic_loopback"/> </service>
|
2017-03-08 14:40:18 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
} [test_1_config] {
|
|
|
|
} [test_2_config] {
|
|
|
|
|
|
|
|
</config> }
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
lappend boot_modules nic_dump
|
2017-03-08 14:40:18 +00:00
|
|
|
|
2017-10-19 18:40:35 +00:00
|
|
|
build_boot_image $boot_modules
|
2017-03-08 14:40:18 +00:00
|
|
|
|
2017-12-13 16:33:34 +00:00
|
|
|
for {set i 0} {$i < $nr_of_clients} {incr i 1} {
|
|
|
|
append done_string {.*Test done.*\n}
|
|
|
|
}
|
|
|
|
|
|
|
|
run_genode_until $done_string 120
|