mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 09:46:20 +00:00
Depot: nic_router-nat-dns
A runtime package that provides a Nic session with NAT via the nic_router and a DNS service via Stubby. Ref #2682
This commit is contained in:
parent
3faf7aab8f
commit
674b0ba947
26
repos/libports/recipes/api/libyaml/content.mk
Normal file
26
repos/libports/recipes/api/libyaml/content.mk
Normal file
@ -0,0 +1,26 @@
|
||||
MIRROR_FROM_REP_DIR := lib/import/import-libyaml.mk lib/mk/libyaml.mk
|
||||
|
||||
content: $(MIRROR_FROM_REP_DIR)
|
||||
|
||||
$(MIRROR_FROM_REP_DIR):
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/libyaml)
|
||||
|
||||
MIRROR_FROM_PORT_DIR := src/lib/yaml
|
||||
|
||||
content: $(MIRROR_FROM_PORT_DIR)
|
||||
|
||||
$(MIRROR_FROM_PORT_DIR):
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(PORT_DIR)/$@ $@
|
||||
|
||||
content: include
|
||||
|
||||
include:
|
||||
cp -r $(PORT_DIR)/include/yaml $@
|
||||
|
||||
content: LICENSE
|
||||
|
||||
LICENSE:
|
||||
cp $(PORT_DIR)/src/lib/yaml/LICENSE $@
|
1
repos/libports/recipes/api/libyaml/hash
Normal file
1
repos/libports/recipes/api/libyaml/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-03-21 d42d4203200d7a9eb379d0bc31e2e46dce5f9662
|
18
repos/ports/recipes/api/libgetdns/content.mk
Normal file
18
repos/ports/recipes/api/libgetdns/content.mk
Normal file
@ -0,0 +1,18 @@
|
||||
content: include lib/symbols/libgetdns LICENSE
|
||||
|
||||
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/getdns)
|
||||
|
||||
include:
|
||||
cp -r $(PORT_DIR)/$@ $@
|
||||
|
||||
lib/symbols/libgetdns:
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
LICENSE:
|
||||
cp $(PORT_DIR)/src/lib/getdns/$@ $@
|
||||
|
||||
content: include/config.h
|
||||
|
||||
include/config.h:
|
||||
mkdir -p $(dir $@)
|
||||
cp $(REP_DIR)/src/lib/getdns/config.h $@
|
1
repos/ports/recipes/api/libgetdns/hash
Normal file
1
repos/ports/recipes/api/libgetdns/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-03-21 4dab6fa890082e371da5b160aba6e2ee12d1d36f
|
2
repos/ports/recipes/pkg/nic_router-nat-dns/README
Normal file
2
repos/ports/recipes/pkg/nic_router-nat-dns/README
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
Runtime for using the NIC router for NAT and DNS
|
9
repos/ports/recipes/pkg/nic_router-nat-dns/archives
Normal file
9
repos/ports/recipes/pkg/nic_router-nat-dns/archives
Normal file
@ -0,0 +1,9 @@
|
||||
_/src/nic_router
|
||||
_/src/stubby
|
||||
_/src/libc
|
||||
_/src/libssl
|
||||
_/src/libgetdns
|
||||
_/src/libcrypto
|
||||
_/src/posix
|
||||
_/src/vfs_lxip
|
||||
_/src/vfs_jitterentropy
|
1
repos/ports/recipes/pkg/nic_router-nat-dns/hash
Normal file
1
repos/ports/recipes/pkg/nic_router-nat-dns/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-03-21 2634e2c0f5fe4a46a195e938490b7639a27bad4f
|
91
repos/ports/recipes/pkg/nic_router-nat-dns/runtime
Normal file
91
repos/ports/recipes/pkg/nic_router-nat-dns/runtime
Normal file
@ -0,0 +1,91 @@
|
||||
<runtime ram="48M" caps="600" binary="init">
|
||||
|
||||
<requires> <nic/> </requires>
|
||||
<provides> <nic/> </provides>
|
||||
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="CPU"/>
|
||||
<service name="LOG"/>
|
||||
<service name="PD"/>
|
||||
<service name="RM"/>
|
||||
<service name="ROM"/>
|
||||
<service name="Nic"/>
|
||||
<service name="Report"/>
|
||||
<service name="Rtc"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
<service name="Nic">
|
||||
<default-policy> <child name="router"/> </default-policy> </service>
|
||||
<start name="router" caps="300">
|
||||
<binary name="nic_router"/>
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
<provides> <service name="Nic"/> </provides>
|
||||
<config verbose_domain_state="yes">
|
||||
<default-policy domain="default" />
|
||||
<domain name="uplink">
|
||||
<nat domain="default" tcp-ports="1000" udp-ports="1000"/>
|
||||
</domain>
|
||||
<domain name="default" interface="10.0.1.1/24">
|
||||
<dhcp-server ip_first="10.0.1.4"
|
||||
ip_last="10.0.1.200"
|
||||
ip_lease_time_sec="360"
|
||||
dns_server="10.0.1.2"/>
|
||||
<tcp dst="0.0.0.0/0"><permit-any domain="uplink"/></tcp>
|
||||
<udp dst="0.0.0.0/0"><permit-any domain="uplink"/></udp>
|
||||
</domain>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="stubby" caps="300">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config>
|
||||
<vfs>
|
||||
<ram/>
|
||||
<dir name="etc">
|
||||
<inline name="resolv.conf">nameserver 9.9.9.9</inline> </dir>
|
||||
<dir name="dev">
|
||||
<log/> <null/> <rtc/>
|
||||
<jitterentropy name="random"/>
|
||||
</dir>
|
||||
<dir name="socket">
|
||||
<lxip ip_addr="10.0.1.2" netmask="255.255.255.0" gateway="10.0.1.1"/>
|
||||
</dir>
|
||||
<inline name="stubby.yaml">
|
||||
listen_addresses:
|
||||
- 10.0.1.2
|
||||
</inline>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
|
||||
<env key="HOME" value="/"/>
|
||||
<arg value="stubby"/>
|
||||
<arg value="-C"/>
|
||||
<arg value="/stubby.yaml"/>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <any-child/> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config>
|
||||
|
||||
<content>
|
||||
<rom label="ld.lib.so"/>
|
||||
<rom label="init"/>
|
||||
<rom label="nic_router"/>
|
||||
<rom label="libc.lib.so"/>
|
||||
<rom label="libcrypto.lib.so"/>
|
||||
<rom label="libgetdns.lib.so"/>
|
||||
<rom label="libm.lib.so"/>
|
||||
<rom label="libssl.lib.so"/>
|
||||
<rom label="lxip.lib.so"/>
|
||||
<rom label="posix.lib.so"/>
|
||||
<rom label="rtc_drv"/>
|
||||
<rom label="stubby"/>
|
||||
<rom label="vfs_jitterentropy.lib.so"/>
|
||||
<rom label="lxip.lib.so"/>
|
||||
<rom label="vfs_lxip.lib.so"/>
|
||||
</content>
|
||||
|
||||
</runtime>
|
24
repos/ports/recipes/src/libgetdns/content.mk
Normal file
24
repos/ports/recipes/src/libgetdns/content.mk
Normal file
@ -0,0 +1,24 @@
|
||||
MIRROR_FROM_REP_DIR = lib/import/import-libgetdns.mk lib/mk/libgetdns.mk
|
||||
|
||||
content: $(MIRROR_FROM_REP_DIR)
|
||||
|
||||
$(MIRROR_FROM_REP_DIR):
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
MIRROR_FROM_PORT_DIR = src/lib/getdns
|
||||
content: $(MIRROR_FROM_PORT_DIR)
|
||||
|
||||
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/getdns)
|
||||
|
||||
$(MIRROR_FROM_PORT_DIR):
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(PORT_DIR)/$@ $@
|
||||
|
||||
content: src/lib/getdns/target.mk LICENSE
|
||||
|
||||
src/lib/getdns/target.mk:
|
||||
mkdir -p $(dir $@)
|
||||
echo 'LIBS=libgetdns' > $@
|
||||
|
||||
LICENSE:
|
||||
cp $(PORT_DIR)/src/lib/getdns/$@ $@
|
1
repos/ports/recipes/src/libgetdns/hash
Normal file
1
repos/ports/recipes/src/libgetdns/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-03-21 5035aeac59355db341aaa33f97427c402db86737
|
8
repos/ports/recipes/src/libgetdns/used_apis
Normal file
8
repos/ports/recipes/src/libgetdns/used_apis
Normal file
@ -0,0 +1,8 @@
|
||||
base
|
||||
libc
|
||||
libcrypto
|
||||
libssl
|
||||
os
|
||||
vfs
|
||||
libyaml
|
||||
libgetdns
|
39
repos/ports/recipes/src/stubby/content.mk
Normal file
39
repos/ports/recipes/src/stubby/content.mk
Normal file
@ -0,0 +1,39 @@
|
||||
content: src/lib/getdns/stubby LICENSE
|
||||
|
||||
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/getdns)
|
||||
|
||||
STUBBY_SRC_DIR := $(PORT_DIR)/src/lib/getdns/stubby
|
||||
|
||||
MIRROR_FROM_PORT_DIR = src/lib/getdns/stubby include/sldns src/lib/getdns/src/gldns
|
||||
content: $(MIRROR_FROM_PORT_DIR)
|
||||
|
||||
include/sldns:
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(PORT_DIR)/src/lib/getdns/src/util/auxiliary/sldns $@
|
||||
|
||||
src/lib/getdns/src/gldns:
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(PORT_DIR)/$@ $@
|
||||
|
||||
src/lib/getdns/stubby:
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(STUBBY_SRC_DIR) $@
|
||||
|
||||
LICENSE:
|
||||
cp $(STUBBY_SRC_DIR)/COPYING $@
|
||||
|
||||
MIRROR_FROM_REP_DIR := \
|
||||
src/app/stubby \
|
||||
lib/mk/getdns-gldns.mk lib/import/import-libgetdns.mk \
|
||||
src/app/stubby/config.h \
|
||||
|
||||
content: $(MIRROR_FROM_REP_DIR)
|
||||
|
||||
$(MIRROR_FROM_REP_DIR):
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
content: include/config.h
|
||||
|
||||
include/config.h:
|
||||
mkdir -p $(dir $@)
|
||||
cp $(REP_DIR)/src/app/stubby/config.h $@
|
1
repos/ports/recipes/src/stubby/hash
Normal file
1
repos/ports/recipes/src/stubby/hash
Normal file
@ -0,0 +1 @@
|
||||
2018-03-21 042582be3689afb77603b9bf940054a022094e8f
|
11
repos/ports/recipes/src/stubby/used_apis
Normal file
11
repos/ports/recipes/src/stubby/used_apis
Normal file
@ -0,0 +1,11 @@
|
||||
base
|
||||
os
|
||||
vfs
|
||||
libc
|
||||
timer_session
|
||||
report_session
|
||||
posix
|
||||
libgetdns
|
||||
libcrypto
|
||||
libyaml
|
||||
libssl
|
202
repos/ports/run/stubby_deploy.run
Normal file
202
repos/ports/run/stubby_deploy.run
Normal file
@ -0,0 +1,202 @@
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
|
||||
create_boot_directory
|
||||
proc depot_user {} { return [get_cmd_arg --depot-user genodelabs] }
|
||||
|
||||
proc current_pkg { pkg } { return $pkg/[_current_depot_archive_version pkg $pkg] }
|
||||
|
||||
import_from_depot genodelabs/src/[base_src] \
|
||||
genodelabs/src/report_rom \
|
||||
genodelabs/src/fs_rom \
|
||||
genodelabs/src/ram_fs \
|
||||
genodelabs/src/vfs \
|
||||
genodelabs/src/init \
|
||||
genodelabs/src/ipxe_nic_drv \
|
||||
genodelabs/src/acpi_drv \
|
||||
genodelabs/src/platform_drv \
|
||||
genodelabs/src/rtc_drv \
|
||||
genodelabs/src/posix \
|
||||
genodelabs/src/libc \
|
||||
genodelabs/src/vfs_lxip \
|
||||
|
||||
create_tar_from_depot_binaries [run_dir]/genode/depot.tar \
|
||||
[depot_user]/pkg/nic_router-nat-dns \
|
||||
|
||||
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>
|
||||
<service name="Nic"> <child name="dynamic"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="100"/>}
|
||||
|
||||
append_platform_drv_config
|
||||
|
||||
append config {
|
||||
<start name="timer">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Timer"/> </provides>
|
||||
</start>
|
||||
|
||||
<start name="rtc_drv">
|
||||
<resource name="RAM" quantum="6M"/>
|
||||
<provides> <service name="Rtc"/> </provides>
|
||||
</start>
|
||||
|
||||
<start name="nic_drv">
|
||||
<resource name="RAM" quantum="6M"/>
|
||||
<provides> <service name="Nic"/> </provides>
|
||||
</start>
|
||||
|
||||
<start name="report_rom">
|
||||
<binary name="report_rom"/>
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
||||
<config verbose="no">
|
||||
<policy label="depot_deploy -> blueprint" report="depot_query -> blueprint"/>
|
||||
<policy label="depot_query -> query" report="depot_deploy -> query"/>
|
||||
<policy label="dynamic -> config" report="depot_deploy -> init.config"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="vfs">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides> <service name="File_system"/> </provides>
|
||||
<config>
|
||||
<vfs> <tar name="depot.tar"/> </vfs>
|
||||
<policy label="depot_query -> depot" root="/" />
|
||||
<policy label="fs_rom -> " root="/" />
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="fs_rom">
|
||||
<resource name="RAM" quantum="50M"/>
|
||||
<provides> <service name="ROM"/> </provides>
|
||||
<route>
|
||||
<service name="File_system"> <child name="vfs"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="depot_query">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<config query="rom">
|
||||
<vfs> <dir name="depot"> <fs label="depot"/> </dir> </vfs>
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" label="query"> <child name="report_rom"/> </service>
|
||||
<service name="File_system"> <child name="vfs"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="ram_fs">
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides> <service name="File_system"/> </provides>
|
||||
<config>
|
||||
<default-policy root="/" writeable="yes"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
<start name="depot_deploy">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<config arch="} [depot_spec] {">
|
||||
<static>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="RM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="PD"/>
|
||||
<service name="LOG"/>
|
||||
<service name="File_system"/>
|
||||
<service name="Nic"/>
|
||||
<service name="Rtc"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
<service name="Nic">
|
||||
<default-policy> <child name="nic_router"/> </default-policy> </service>
|
||||
</static>
|
||||
<common_routes>
|
||||
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
|
||||
<service name="ROM" label_last="init"> <parent/> </service>
|
||||
<service name="CPU"> <parent/> </service>
|
||||
<service name="PD"> <parent/> </service>
|
||||
<service name="LOG"> <parent/> </service>
|
||||
<service name="Timer"> <parent/> </service>
|
||||
<service name="Rtc"> <parent/> </service>
|
||||
<service name="Nic"> <parent/> </service>
|
||||
</common_routes>
|
||||
|
||||
<start name="nic_router" pkg="} [depot_user]/pkg/[current_pkg nic_router-nat-dns] {">
|
||||
<route>
|
||||
<service name="RM"> <parent/> </service>
|
||||
<service name="Rtc"> <parent/> </service>
|
||||
<service name="Nic"> <parent/> </service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
</config>
|
||||
<route>
|
||||
<service name="ROM" label="blueprint"> <child name="report_rom"/> </service>
|
||||
<service name="Report" label="query"> <child name="report_rom"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="dynamic" caps="8000">
|
||||
<resource name="RAM" quantum="160M"/>
|
||||
<binary name="init"/>
|
||||
<provides> <service name="Nic"/> </provides>
|
||||
<route>
|
||||
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
|
||||
<service name="ROM" label_last="init"> <parent/> </service>
|
||||
<service name="ROM" label="config"> <child name="report_rom"/> </service>
|
||||
<service name="ROM"> <child name="fs_rom"/> </service>
|
||||
<service name="Timer"> <child name="timer"/> </service>
|
||||
<service name="File_system"> <child name="ram_fs"/> </service>
|
||||
<service name="Nic"> <child name="nic_drv"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
<start name="test-libc_getaddrinfo" caps="256">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="etc">
|
||||
<inline name="resolv.conf">nameserver 10.0.1.2</inline>
|
||||
</dir>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<dir name="socket"> <lxip dhcp="yes"/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" socket="/socket"/>
|
||||
<arg value="test-libc_getenv"/>
|
||||
<arg value="genode.org"/>
|
||||
<arg value="genode-labs.com"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
</config>}
|
||||
|
||||
install_config $config
|
||||
|
||||
append qemu_args -nographic
|
||||
|
||||
build { app/depot_query app/depot_deploy test/libc_getaddrinfo }
|
||||
|
||||
build_boot_image { depot_query depot_deploy test-libc_getaddrinfo }
|
||||
|
||||
run_genode_until "child \"test-libc_getaddrinfo\" exited with exit value 0.*\n" 120
|
Loading…
x
Reference in New Issue
Block a user