2021-01-08 16:27:24 +00:00
|
|
|
#
|
|
|
|
# To execute this run script on your Linux host you have to do some
|
|
|
|
# preparation:
|
|
|
|
#
|
2021-02-15 14:51:11 +00:00
|
|
|
# 1) Setup a TAP device:
|
2021-01-08 16:27:24 +00:00
|
|
|
# ! export USER=[YOUR_USER_NAME]
|
|
|
|
# ! export TAP_DEV=tap0
|
2021-02-15 14:51:11 +00:00
|
|
|
# ! sudo ip tuntap add dev $TAP_DEV mode tap user $USER
|
2021-01-08 16:27:24 +00:00
|
|
|
# ! sudo ip address flush dev $TAP_DEV
|
|
|
|
# ! sudo ip address add 10.0.2.1/24 brd 10.0.2.255 dev $TAP_DEV
|
|
|
|
# ! sudo ip link set dev $TAP_DEV addr 02:00:00:ca:fe:01
|
|
|
|
# ! sudo ip link set dev $TAP_DEV up
|
|
|
|
#
|
|
|
|
# 2) Now, start the test and connect using your favorite HTTP client, e.g.:
|
2021-02-15 14:51:11 +00:00
|
|
|
# ! cd build/x86_64
|
2021-01-08 16:27:24 +00:00
|
|
|
# ! make run/lwip_lx KERNEL=linux BOARD=linux
|
|
|
|
# ! lynx -dump http://10.0.2.55
|
|
|
|
#
|
|
|
|
# 3) Clean up your Linux when done testing:
|
|
|
|
# ! sudo ip tuntap delete $TAP_DEV mode tap
|
|
|
|
#
|
|
|
|
|
2017-03-09 13:03:46 +00:00
|
|
|
assert_spec linux
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build {
|
2023-09-12 14:21:03 +00:00
|
|
|
core init timer lib/ld lib/libc lib/vfs lib/vfs_lwip
|
2024-05-31 15:24:20 +00:00
|
|
|
driver/nic test/lwip/http_srv server/nic_router server/report_rom
|
2011-12-22 15:19:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2023-09-12 14:21:03 +00:00
|
|
|
install_config {
|
2011-12-22 15:19:25 +00:00
|
|
|
<config verbose="yes">
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2011-12-22 15:19:25 +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>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
<start name="timer">
|
2014-08-26 14:41:21 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
2011-12-22 15:19:25 +00:00
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2021-05-25 10:07:16 +00:00
|
|
|
<start name="devices_report_rom">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="1200K"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes"/>
|
|
|
|
</start>
|
|
|
|
|
2024-05-30 13:46:57 +00:00
|
|
|
<start name="linux_nic" ld="no">
|
2021-01-08 16:27:24 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2021-05-25 10:07:16 +00:00
|
|
|
<config>
|
|
|
|
<report mac_address="true"/>
|
|
|
|
</config>
|
2021-01-08 16:27:24 +00:00
|
|
|
<route>
|
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2021-05-25 10:07:16 +00:00
|
|
|
<service name="Report"> <child name="devices_report_rom"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
2011-12-22 15:19:25 +00:00
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<start name="nic_router" caps="200">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose_domain_state="yes">
|
|
|
|
|
|
|
|
<policy label_prefix="test-lwip_httpsrv" domain="downlink"/>
|
2024-05-30 13:46:57 +00:00
|
|
|
<policy label_prefix="linux_nic" domain="uplink"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1">
|
|
|
|
|
|
|
|
<nat domain="downlink"
|
|
|
|
tcp-ports="16384"
|
|
|
|
udp-ports="16384"
|
|
|
|
icmp-ids="16384"/>
|
|
|
|
|
|
|
|
<tcp-forward port="443" domain="downlink" to="10.0.3.2"/>
|
|
|
|
<tcp-forward port="80" domain="downlink" to="10.0.3.2"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24"/>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
<start name="test-lwip_httpsrv">
|
2013-09-24 08:34:27 +00:00
|
|
|
<resource name="RAM" quantum="5M"/>
|
2019-05-21 15:00:46 +00:00
|
|
|
<config ld_verbose="true">
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
2021-01-08 16:27:24 +00:00
|
|
|
<dir name="socket"> <lwip ip_addr="10.0.3.2" netmask="255.255.255.0" gateway="10.0.3.1"/> </dir>
|
2019-05-21 15:00:46 +00:00
|
|
|
</vfs>
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
|
2014-04-14 09:57:22 +00:00
|
|
|
</config>
|
2011-12-22 15:19:25 +00:00
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
2023-09-12 14:21:03 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
run_genode_until forever
|
|
|
|
|
|
|
|
# vi: set ft=tcl :
|