LwIP VFS plugin

This patch reintroduces the LwIP stack to libc as a VFS plugin
implementing the socket_fs interface. Rather than use LwIP's socket
emulation layer this plugin interfaces directly to LwIP raw API and is
single threaded.

The internal TCP parameters of the stack are untuned.

Fix #2050
Fix #2335
This commit is contained in:
Emery Hemingway 2016-09-18 19:46:54 +02:00 committed by Christian Helmuth
parent ac30e49df7
commit d9a4773194
40 changed files with 3282 additions and 177 deletions

View File

@ -0,0 +1,13 @@
assert_spec x86
proc append_socket_fs_build_components { } {
global build_components
append build_components { lib/vfs/lxip }
}
proc socket_fs_plugin {} { return lxip }
proc append_socket_fs_boot_modules {} {
global boot_modules
append boot_modules { lxip.lib.so vfs_lxip.lib.so }
}

View File

@ -0,0 +1,100 @@
/*
* \brief Some size definitions and macros needed by LwIP.
* \author Stefan Kalkowski
* \author Emery Hemingway
* \date 2009-11-10
*/
/*
* Copyright (C) 2009-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef __LWIP__ARCH__CC_H__
#define __LWIP__ARCH__CC_H__
#include <base/fixed_stdint.h>
#ifndef LWIP_RAND
genode_uint32_t genode_rand();
#define LWIP_RAND() genode_rand()
#endif
#ifndef LWIP_NO_STDDEF_H
#define LWIP_NO_STDDEF_H 1
typedef unsigned long size_t;
typedef long ptrdiff_t;
#endif /* LWIP_NO_STDDEF_H */
#ifndef LWIP_NO_STDINT_H
#define LWIP_NO_STDINT_H 1
typedef genode_uint8_t u8_t;
typedef genode_int8_t s8_t;
typedef genode_uint16_t u16_t;
typedef genode_int16_t s16_t;
typedef genode_uint32_t u32_t;
typedef genode_int32_t s32_t;
typedef unsigned long mem_ptr_t;
#endif /* LWIP_NO_STDINT_H */
#ifndef LWIP_NO_INTTYPES_H
#define LWIP_NO_INTTYPES_H 1
/* Define (sn)printf formatters */
#define U16_F "u" // we don't have hu
#define S16_F "d" // we don't have hd
#define X16_F "x" // we don't have hx
#define U32_F "u"
#define S32_F "d"
#define X32_F "x"
#endif /* LWIP_NO_INTTYPES_H */
#ifndef LWIP_PLATFORM_DIAG
void lwip_printf(const char *format, ...);
#define LWIP_PLATFORM_DIAG(x) do { lwip_printf x; } while(0)
#endif /* LWIP_PLATFORM_DIAG */
#ifdef GENODE_RELEASE
#define LWIP_PLATFORM_ASSERT(x)
#else /* GENODE_RELEASE */
void lwip_platform_assert(char const* msg, char const *file, int line);
#define LWIP_PLATFORM_ASSERT(x) \
do { \
lwip_platform_assert(x, __FILE__, __LINE__); \
} while (0)
#endif /* GENODE_RELEASE */
#ifndef LWIP_NO_LIMITS_H
#define LWIP_NO_LIMITS_H 1
#endif
#define LWIP_SKIP_PACKING_CHECK 1
#define PACK_STRUCT_FIELD(x) x
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif /* BYTE_ORDER */
void genode_free(void *ptr);
void *genode_malloc(unsigned long size);
void *genode_calloc(unsigned long number, unsigned long size);
#define mem_clib_free genode_free
#define mem_clib_malloc genode_malloc
#define mem_clib_calloc genode_calloc
#endif /* __LWIP__ARCH__CC_H__ */

View File

@ -0,0 +1,20 @@
/*
* \brief Header file with macros needed by LwIP.
* \author Stefan Kalkowski
* \date 2009-11-10
*/
/*
* Copyright (C) 2009-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef __LWIP__ARCH__PERF_H__
#define __LWIP__ARCH__PERF_H__
#define PERF_START
#define PERF_STOP(x)
#endif /* __LWIP__ARCH__PERF_H__ */

View File

@ -0,0 +1,22 @@
/*
* \brief Genode native lwIP initalization
* \author Emery Hemingway
* \date 2017-08-21
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__LWIP__GENODE_INIT_H_
#define _INCLUDE__LWIP__GENODE_INIT_H_
#include <timer/timeout.h>
#include <base/allocator.h>
namespace Lwip { void genode_init(Genode::Allocator &heap, Genode::Timeout_scheduler &timer); }
#endif

View File

@ -0,0 +1,133 @@
/*
* \brief Configuration file for LwIP, adapt it to your needs.
* \author Stefan Kalkowski
* \author Emery Hemingway
* \date 2009-11-10
*
* See lwip/src/include/lwip/opt.h for all options
*/
/*
* Copyright (C) 2009-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef __LWIP__LWIPOPTS_H__
#define __LWIP__LWIPOPTS_H__
/* Genode includes */
#include <base/fixed_stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Use lwIP without OS-awareness
*/
#define NO_SYS 1
#define SYS_LIGHTWEIGHT_PROT 0
#define LWIP_DNS 1 /* DNS support */
#define LWIP_DHCP 1 /* DHCP support */
#define LWIP_SOCKET 0 /* LwIP socket API */
#define LWIP_NETIF_LOOPBACK 1 /* Looping back to same address? */
#define LWIP_STATS 0 /* disable stating */
#define LWIP_TCP_TIMESTAMPS 1
#define TCP_MSS 1460
#define TCP_WND (32 * TCP_MSS)
#define TCP_SND_BUF (32 * TCP_MSS)
#define LWIP_WND_SCALE 3
#define TCP_RCV_SCALE 2
#define TCP_SND_QUEUELEN ((8 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
#define LWIP_NETIF_STATUS_CALLBACK 1 /* callback function used for interface changes */
#define LWIP_NETIF_LINK_CALLBACK 1 /* callback function used for link-state changes */
/***********************************
** Checksum calculation settings **
***********************************/
/* checksum calculation for outgoing packets can be disabled if the hardware supports it */
#define LWIP_CHECKSUM_ON_COPY 1 /* calculate checksum during memcpy */
/*********************
** Memory settings **
*********************/
#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1
/* MEM_ALIGNMENT > 4 e.g. for x86_64 are not supported, see Genode issue #817 */
#define MEM_ALIGNMENT 4
#define DEFAULT_ACCEPTMBOX_SIZE 128
#define TCPIP_MBOX_SIZE 128
#define RECV_BUFSIZE_DEFAULT (512*1024)
#define PBUF_POOL_SIZE 96
#define MEMP_NUM_SYS_TIMEOUT 16
#define MEMP_NUM_TCP_PCB 128
void genode_memcpy(void * dst, const void *src, unsigned long size);
#define MEMCPY(dst,src,len) genode_memcpy(dst,src,len)
/********************
** Debug settings **
********************/
/* #define LWIP_DEBUG */
/* #define DHCP_DEBUG LWIP_DBG_ON */
/* #define ETHARP_DEBUG LWIP_DBG_ON */
/* #define NETIF_DEBUG LWIP_DBG_ON */
/* #define PBUF_DEBUG LWIP_DBG_ON */
/* #define API_LIB_DEBUG LWIP_DBG_ON */
/* #define API_MSG_DEBUG LWIP_DBG_ON */
/* #define SOCKETS_DEBUG LWIP_DBG_ON */
/* #define ICMP_DEBUG LWIP_DBG_ON */
/* #define INET_DEBUG LWIP_DBG_ON */
/* #define IP_DEBUG LWIP_DBG_ON */
/* #define IP_REASS_DEBUG LWIP_DBG_ON */
/* #define RAW_DEBUG LWIP_DBG_ON */
/* #define MEM_DEBUG LWIP_DBG_ON */
/* #define MEMP_DEBUG LWIP_DBG_ON */
/* #define SYS_DEBUG LWIP_DBG_ON */
/* #define TCP_DEBUG LWIP_DBG_ON */
/*
----------------------------------
---------- DHCP options ----------
----------------------------------
*/
#define LWIP_DHCP_CHECK_LINK_UP 1
/*
----------------------------------------------
---------- Sequential layer options ----------
----------------------------------------------
*/
/* no Netconn API */
#define LWIP_NETCONN 0
/*
---------------------------------------
---------- IPv6 options ---------------
---------------------------------------
*/
#define LWIP_IPV6 1
#define IPV6_FRAG_COPYHEADER 1
#ifdef __cplusplus
}
#endif
#endif /* __LWIP__LWIPOPTS_H__ */

View File

@ -0,0 +1,416 @@
/*
* \brief LwIP netif for the Nic session
* \author Emery Hemingway
* \date 2016-09-28
*
* If you want to use the lwIP API in a native Genode
* component then this is the Nic client to use.
*/
/*
* Copyright (C) 2016-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef __LWIP__NIC_NETIF_H__
#define __LWIP__NIC_NETIF_H__
#if ETH_PAD_SIZE
#error ETH_PAD_SIZE defined but unsupported by lwip/nic_netif.h
#endif
#ifndef __cplusplus
#error lwip/nic_netif.h is a C++ only header
#endif
/* Genode includes */
#include <nic/packet_allocator.h>
#include <nic_session/connection.h>
#include <base/log.h>
namespace Lwip {
extern "C" {
/* LwIP includes */
#include <lwip/netif.h>
#include <netif/etharp.h>
#if LWIP_IPV6
#include <lwip/ethip6.h>
#endif
#include <lwip/init.h>
#include <lwip/dhcp.h>
}
class Nic_netif;
extern "C" {
/**
* Metadata for packet backed pbufs
*/
struct nic_netif_pbuf
{
struct pbuf_custom p { };
Nic_netif *netif = nullptr;
Nic::Packet_descriptor packet { };
};
static void nic_netif_pbuf_free(pbuf *p);
static err_t nic_netif_init(struct netif *netif);
static err_t nic_netif_linkoutput(struct netif *netif, struct pbuf *p);
static void nic_netif_status_callback(struct netif *netif);
}
}
class Lwip::Nic_netif
{
private:
enum {
PBUFS_QUEUE_SIZE = 128,
NIC_BUF_SIZE =
Nic::Packet_allocator::DEFAULT_PACKET_SIZE *
PBUFS_QUEUE_SIZE
};
nic_netif_pbuf _pbufs[PBUFS_QUEUE_SIZE];
unsigned _pbufs_next = 0;
unsigned _alloced = 0;
Nic::Packet_allocator _nic_tx_alloc;
Nic::Connection _nic;
struct netif _netif { };
ip_addr_t ip { };
ip_addr_t nm { };
ip_addr_t gw { };
Genode::Io_signal_handler<Nic_netif> _link_state_handler;
Genode::Io_signal_handler<Nic_netif> _rx_packet_handler;
public:
void free_pbuf(nic_netif_pbuf &pbuf)
{
if (!_nic.rx()->ready_to_ack()) {
Genode::error("Nic rx acknowledgement queue congested, blocking to free pbuf");
}
_nic.rx()->acknowledge_packet(pbuf.packet);
pbuf.packet = Nic::Packet_descriptor();
}
/*************************
** Nic signal handlers **
*************************/
void handle_link_state()
{
/*
* if the application wants to know what is going
* on then it should use 'set_link_callback'
*/
if (_nic.link_state()) {
netif_set_link_up(&_netif);
/* XXX: DHCP? */
} else {
netif_set_link_down(&_netif);
}
}
void handle_rx_packets()
{
auto &rx = *_nic.rx();
while (rx.packet_avail() && rx.ready_to_ack()) {
unsigned const initial_index = _pbufs_next;
while (_pbufs[_pbufs_next].packet.size()) {
_pbufs_next = (_pbufs_next+1) % PBUFS_QUEUE_SIZE;
if (_pbufs_next == initial_index) {
/* internal pbuf queue congested */
return;
}
}
Nic::Packet_descriptor const packet = rx.get_packet();
nic_netif_pbuf &nic_pbuf = _pbufs[_pbufs_next];
_pbufs_next = (_pbufs_next+1) % PBUFS_QUEUE_SIZE;
nic_pbuf.p.custom_free_function = nic_netif_pbuf_free;
nic_pbuf.netif = this;
nic_pbuf.packet = packet;
pbuf* p = pbuf_alloced_custom(
PBUF_RAW,
packet.size(),
PBUF_REF,
&nic_pbuf.p,
rx.packet_content(packet),
packet.size());
LINK_STATS_INC(link.recv);
if (_netif.input(p, &_netif) != ERR_OK) {
Genode::error("error forwarding Nic packet to lwIP");
pbuf_free(p);
}
}
}
void configure(Genode::Xml_node const &config)
{
if (config.attribute_value("dhcp", false)) {
err_t err = dhcp_start(&_netif);
if (err == ERR_OK)
Genode::log("configuring lwIP interface with DHCP");
else
Genode::error("failed to configure lwIP interface with DHCP, error ", -err);
} else /* get addressing from config */ {
typedef Genode::String<IPADDR_STRLEN_MAX> Str;
Str ip_str = config.attribute_value("ip_addr", Str());
ip_addr_t ipaddr;
if (!ipaddr_aton(ip_str.string(), &ipaddr)) {
Genode::error("lwIP configured with invalid IP address '",ip_str,"'");
throw ip_str;
}
if (IP_IS_V6_VAL(ipaddr)) {
netif_create_ip6_linklocal_address(&_netif, 1);
err_t err = netif_add_ip6_address(&_netif, ip_2_ip6(&ipaddr), NULL);
if (err != ERR_OK) {
Genode::error("failed to set lwIP IPv6 address to '",ip_str,"'");
throw err;
}
} else {
netif_set_ipaddr(&_netif, ip_2_ip4(&ipaddr));
if (config.has_attribute("netmask")) {
Str str = config.attribute_value("netmask", Str());
ip_addr_t ip;
ipaddr_aton(str.string(), &ip);
netif_set_netmask(&_netif, ip_2_ip4(&ip));
}
if (config.has_attribute("gateway")) {
Str str = config.attribute_value("gateway", Str());
ip_addr_t ip;
ipaddr_aton(str.string(), &ip);
netif_set_gw(&_netif, ip_2_ip4(&ip));
}
/* inform DHCP servers of our fixed IP address */
dhcp_inform(&_netif);
}
}
}
Nic_netif(Genode::Env &env,
Genode::Allocator &alloc,
Genode::Xml_node config)
:
_nic_tx_alloc(&alloc),
_nic(env, &_nic_tx_alloc, NIC_BUF_SIZE, NIC_BUF_SIZE,
config.attribute_value("label", Genode::String<160>("lwip")).string()),
_link_state_handler(env.ep(), *this, &Nic_netif::handle_link_state),
_rx_packet_handler( env.ep(), *this, &Nic_netif::handle_rx_packets)
{
Genode::memset(&_netif, 0x00, sizeof(_netif));
{
ip4_addr_t v4dummy;
IP4_ADDR(&v4dummy, 0, 0, 0, 0);
netif* r = netif_add(&_netif, &v4dummy, &v4dummy, &v4dummy,
this, nic_netif_init, ethernet_input);
if (r == NULL) {
Genode::error("failed to initialize Nic to lwIP interface");
throw r;
}
}
netif_set_default(&_netif);
netif_set_up(&_netif);
configure(config);
netif_set_status_callback(
&_netif, nic_netif_status_callback);
nic_netif_status_callback(&_netif);
}
virtual ~Nic_netif() { }
/**
* Status callback to override in subclass
*/
virtual void status_callback() { }
/**
* Callback issued by lwIP to initialize netif struct
*
* \noapi
*/
err_t init()
{
/*
* XXX: hostname and MTU could probably be
* set in the Nic client constructor
*/
#if LWIP_NETIF_HOSTNAME
/* Initialize interface hostname */
_netif.hostname = "";
#endif /* LWIP_NETIF_HOSTNAME */
_netif.name[0] = 'e';
_netif.name[1] = 'n';
_netif.output = etharp_output;
#if LWIP_IPV6
_netif.output_ip6 = ethip6_output;
#endif /* LWIP_IPV6 */
_netif.linkoutput = nic_netif_linkoutput;
/* Set physical MAC address */
Nic::Mac_address const mac = _nic.mac_address();
for(int i=0; i<6; ++i)
_netif.hwaddr[i] = mac.addr[i];
_netif.mtu = 1500; /* XXX: just a guess */
_netif.hwaddr_len = ETHARP_HWADDR_LEN;
_netif.flags = NETIF_FLAG_BROADCAST |
NETIF_FLAG_ETHARP |
NETIF_FLAG_LINK_UP;
/* set Nic session signal handlers */
_nic.link_state_sigh(_link_state_handler);
_nic.rx_channel()->sigh_packet_avail(_rx_packet_handler);
_nic.rx_channel()->sigh_ready_to_ack(_rx_packet_handler);
return ERR_OK;
}
/**
* Callback issued by lwIP to write a Nic packet
*
* \noapi
*/
err_t linkoutput(struct pbuf *p)
{
auto &tx = *_nic.tx();
/* flush acknowledgements */
while (tx.ack_avail())
tx.release_packet(tx.get_acked_packet());
if (!tx.ready_to_submit()) {
Genode::error("lwIP: Nic packet queue congested, cannot send packet");
return ERR_WOULDBLOCK;
}
Nic::Packet_descriptor packet;
try { packet = tx.alloc_packet(p->tot_len); }
catch (...) {
Genode::error("lwIP: Nic packet allocation failed, cannot send packet");
return ERR_WOULDBLOCK;
}
/*
* We iterate over the pbuf chain until we have read the entire
* pbuf into the packet.
*/
char *dst = tx.packet_content(packet);
for(struct pbuf *q = p; q != 0; q = q->next) {
char const *src = (char*)q->payload;
Genode::memcpy(dst, src, q->len);
dst += q->len;
}
tx.submit_packet(packet);
LINK_STATS_INC(link.xmit);
return ERR_OK;
}
bool ready()
{
return netif_is_up(&_netif) &&
!ip_addr_isany(&_netif.ip_addr);
}
};
/**************************
** LwIP netif callbacks **
**************************/
namespace Lwip {
extern "C" {
/**
* Free a packet buffer backed pbuf
*/
static void nic_netif_pbuf_free(pbuf *p)
{
nic_netif_pbuf *nic_pbuf = (nic_netif_pbuf*)(p);
nic_pbuf->netif->free_pbuf(*nic_pbuf);
}
/**
* Initialize the netif
*/
static err_t nic_netif_init(struct netif *netif)
{
Lwip::Nic_netif *nic_netif = (Lwip::Nic_netif *)netif->state;
return nic_netif->init();
}
/**
* Send a raw packet to the Nic session
*/
static err_t nic_netif_linkoutput(struct netif *netif, struct pbuf *p)
{
Lwip::Nic_netif *nic_netif = (Lwip::Nic_netif *)netif->state;
return nic_netif->linkoutput(p);
}
static void nic_netif_status_callback(struct netif *netif)
{
Lwip::Nic_netif *nic_netif = (Lwip::Nic_netif *)netif->state;
if (netif_is_up(netif)) {
if (IP_IS_V6_VAL(netif->ip_addr)) {
Genode::log("lwIP Nic interface up"
", address=",(char const*)ip6addr_ntoa(netif_ip6_addr(netif, 0)));
} else if (!ip4_addr_isany(netif_ip4_addr(netif))) {
typedef Genode::String<IPADDR_STRLEN_MAX> Str;
Str address((char const*)ip4addr_ntoa(netif_ip4_addr(netif)));
Str netmask((char const*)ip4addr_ntoa(netif_ip4_netmask(netif)));
Str gateway((char const*)ip4addr_ntoa(netif_ip4_gw(netif)));
Genode::log("lwIP Nic interface up"
" address=", address,
" netmask=", netmask,
" gateway=", gateway);
}
} else {
Genode::log("lwIP Nic interface down");
}
nic_netif->status_callback();
}
}
}
#endif /* __LWIP__NIC_NETIF_H__ */

View File

@ -0,0 +1,2 @@
INC_DIR += $(call select_from_ports,lwip)/include/lwip
INC_DIR += $(call select_from_repositories,include/lwip)

View File

@ -0,0 +1,41 @@
#
# lwIP TCP/IP library
#
# The library implements TCP and UDP as well as DNS and DHCP.
#
LWIP_PORT_DIR := $(call select_from_ports,lwip)
LWIPDIR := $(LWIP_PORT_DIR)/src/lib/lwip/lwip-2.0.3/src
-include $(LWIPDIR)/Filelists.mk
# Genode platform files
SRC_CC = printf.cc rand.cc sys_arch.cc
# Core files
SRC_C += $(notdir $(COREFILES))
# IPv4 files
SRC_C += $(notdir $(CORE4FILES))
# IPv6 files
SRC_C += $(notdir $(CORE6FILES))
# Network interface files
SRC_C += $(notdir $(NETIFFILES))
INC_DIR += $(REP_DIR)/include/lwip \
$(LWIP_PORT_DIR)/include/lwip \
$(LWIPDIR)/include \
$(LWIPDIR)/include/ipv4 \
$(LWIPDIR)/include/api \
$(LWIPDIR)/include/netif \
$(REP_DIR)/src/lib/lwip/include
vpath %.cc $(REP_DIR)/src/lib/lwip/platform
vpath %.c $(LWIPDIR)/core
vpath %.c $(LWIPDIR)/core/ipv4
vpath %.c $(LWIPDIR)/core/ipv6
vpath %.c $(LWIPDIR)/netif
CC_CXX_WARN_STRICT =

View File

@ -0,0 +1,11 @@
SRC_CC = vfs.cc
VFS_DIR = $(REP_DIR)/src/lib/vfs/lwip
INC_DIR += $(VFS_DIR)
LD_OPT += --version-script=$(VFS_DIR)/symbol.map
LIBS += lwip
vpath %.cc $(VFS_DIR)
SHARED_LIB = yes

View File

@ -0,0 +1 @@
1ac3301a29dcf5f4fc3981fb4338578c7d5d7fe5

View File

@ -0,0 +1,20 @@
LICENSE := BSD
VERSION := 2.0.3
DOWNLOADS := lwip.archive
URL(lwip) := http://download.savannah.nongnu.org/releases/lwip/lwip-$(VERSION).zip
SHA(lwip) := 1488829ca48890cc7e5e86c5e76a74b32a1bc9ac8dc01b2177b3a937650e9730
DIR(lwip) := src/lib/lwip
UNPACKED_DIR := src/lib/lwip/lwip-$(VERSION)
DIRS := \
include/lwip/lwip \
include/lwip/lwip/priv \
include/lwip/lwip/prot \
include/lwip/netif \
DIR_CONTENT(include/lwip/lwip/priv) := $(UNPACKED_DIR)/src/include/lwip/priv/*.h
DIR_CONTENT(include/lwip/lwip/prot) := $(UNPACKED_DIR)/src/include/lwip/prot/*.h
DIR_CONTENT(include/lwip/lwip) := $(UNPACKED_DIR)/src/include/lwip/*.h
DIR_CONTENT(include/lwip/netif) := $(UNPACKED_DIR)/src/include/netif/*.h

View File

@ -0,0 +1,22 @@
MIRROR_FROM_REP_DIR := \
$(shell cd $(REP_DIR); find include/lwip src/lib/lwip src/lib/vfs/lwip -type f) \
lib/import/import-lwip.mk \
lib/mk/lwip.mk \
lib/mk/vfs_lwip.mk \
recipes/src/vfs_lwip \
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/lwip)
MIRROR_FROM_PORT_DIR := $(shell cd $(PORT_DIR); find include src -type f)
content: $(MIRROR_FROM_REP_DIR) $(MIRROR_FROM_PORT_DIR) LICENSE
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
$(MIRROR_FROM_PORT_DIR):
mkdir -p $(dir $@)
cp -r $(PORT_DIR)/$@ $@
LICENSE:
cp $(PORT_DIR)/src/lib/lwip/lwip-*/COPYING $@

View File

@ -0,0 +1 @@
2018-02-21-c c71f513a9915a2c98a363d5818147da0857202be

View File

@ -0,0 +1,7 @@
base
libc
nic_session
os
so
timer_session
vfs

View File

@ -0,0 +1,135 @@
#
# \brief Test of fetchurl
# \author Emery Hemingway
# \date 2016-06-05
#
if {[have_spec odroid_xu] || [have_spec linux] ||
[expr [have_spec imx53] && [have_spec trustzone]]} {
puts "Run script does not support this platform."
exit 0
}
set build_components {
app/fetchurl
core init
drivers/nic
drivers/timer
server/report_rom
}
proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
return gpio_drv }
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
append_socket_fs_build_components
lappend_if [expr {[nic_drv_binary] == "nic_drv"}] build_components drivers/nic
lappend_if [expr {[nic_drv_binary] == "usb_drv"}] build_components drivers/usb
build $build_components
create_boot_directory
append config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RAM"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default caps="100"/>
<default-route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_platform_drv_config
append_if [have_spec gpio] config "
<start name=\"[gpio_drv]\" caps=\"140\">
<resource name=\"RAM\" quantum=\"4M\"/>
<provides><service name=\"Gpio\"/></provides>
<config/>
</start>"
append config {
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="nic_drv" caps="120">
<binary name="} [nic_drv_binary] {"/>
<resource name="RAM" quantum="16M"/>
<provides> <service name="Nic"/> </provides>
} [nic_drv_config] {
</start>
<start name="report_rom">
<resource name="RAM" quantum="4M"/>
<provides> <service name="ROM"/> <service name="Report"/> </provides>
<config verbose="yes"/>
</start>
<start name="fetchurl" caps="500">
<resource name="RAM" quantum="32M"/>
<config>
<report progress="yes"/>
<vfs>
<dir name="dev">
<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
<inline name="random">01234567890123456789</inline>
</dir>
<dir name="socket"> <} [socket_fs_plugin] { dhcp="yes"/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
<fetch url="http://genode.org/about/LICENSE" path="/dev/log" retry="3"/>
</config>
</start>
</config>
}
install_config $config
# generic modules
set boot_modules {
core init ld.lib.so
curl.lib.so
fetchurl
libc.lib.so vfs.lib.so
libcrypto.lib.so
libssh.lib.so
libssl.lib.so
pthread.lib.so
timer
zlib.lib.so
report_rom
}
# platform-specific modules
append_platform_drv_boot_modules
# vfs plugin modules
append_socket_fs_boot_modules
lappend boot_modules [nic_drv_binary]
lappend_if [have_spec gpio] boot_modules [gpio_drv]
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -nographic -net user"
run_genode_until {child "fetchurl" exited with exit value 0} 120

View File

@ -1,132 +1,2 @@
#
# \brief Test of 'fetchurl
# \author Emery Hemingway
# \date 2016-06-05
#
if {[have_spec odroid_xu] || [have_spec linux] ||
[expr [have_spec imx53] && [have_spec trustzone]]} {
puts "Run script does not support this platform."
exit 0
}
set build_components {
app/fetchurl
core init
drivers/nic
drivers/timer
lib/vfs/lxip
server/report_rom
}
proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
return gpio_drv }
lappend_if [have_spec gpio] build_components drivers/gpio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
lappend_if [expr {[nic_drv_binary] == "nic_drv"}] build_components drivers/nic
lappend_if [expr {[nic_drv_binary] == "usb_drv"}] build_components drivers/usb
build $build_components
create_boot_directory
append config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RAM"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default caps="100"/>
<default-route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</default-route>}
append_platform_drv_config
append_if [have_spec gpio] config "
<start name=\"[gpio_drv]\" caps=\"140\">
<resource name=\"RAM\" quantum=\"4M\"/>
<provides><service name=\"Gpio\"/></provides>
<config/>
</start>"
append config {
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="nic_drv" caps="120">
<binary name="} [nic_drv_binary] {"/>
<resource name="RAM" quantum="16M"/>
<provides> <service name="Nic"/> </provides>
} [nic_drv_config] {
</start>
<start name="report_rom">
<resource name="RAM" quantum="4M"/>
<provides> <service name="ROM"/> <service name="Report"/> </provides>
<config verbose="yes"/>
</start>
<start name="fetchurl" caps="500">
<resource name="RAM" quantum="32M"/>
<config>
<report progress="yes"/>
<vfs>
<dir name="dev">
<log/> <null/> <inline name="rtc">2000-01-01 00:00</inline>
<inline name="random">01234567890123456789</inline>
</dir>
<dir name="socket"> <lxip dhcp="yes"/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
<fetch url="http://genode.org/about/LICENSE" path="/dev/log" retry="3"/>
</config>
</start>
</config>
}
install_config $config
# generic modules
set boot_modules {
core init ld.lib.so
curl.lib.so
fetchurl
libc.lib.so vfs.lib.so
libcrypto.lib.so
libssh.lib.so
libssl.lib.so
lxip.lib.so
pthread.lib.so
timer
vfs_lxip.lib.so
zlib.lib.so
report_rom
}
# platform-specific modules
append_platform_drv_boot_modules
lappend boot_modules [nic_drv_binary]
lappend_if [have_spec gpio] boot_modules [gpio_drv]
build_boot_image $boot_modules
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -nographic -net user"
run_genode_until {child "fetchurl" exited with exit value 0} 120
source ${genode_dir}/repos/ports/run/vfs_lxip.inc
source ${genode_dir}/repos/libports/run/fetchurl.inc

View File

@ -0,0 +1,2 @@
source ${genode_dir}/repos/libports/run/vfs_lwip.inc
source ${genode_dir}/repos/libports/run/fetchurl.inc

View File

@ -8,7 +8,7 @@ if {[have_spec linux]} {
set build_components {
core init
drivers/timer
lib/vfs/lxip
lib/vfs/lwip
test/libc_getaddrinfo
}
@ -49,11 +49,11 @@ append config {
</start>
<start name="test-libc_getaddrinfo" caps="256">
<resource name="RAM" quantum="32M"/>
<resource name="RAM" quantum="16M"/>
<config>
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <lxip dhcp="yes"/> </dir>
<dir name="socket"> <lwip dhcp="yes"/> </dir>
</vfs>
<libc stdout="/dev/log" socket="/socket"/>
<arg value="test-libc_getenv"/>
@ -70,8 +70,9 @@ install_config $config
set boot_modules {
core init ld.lib.so
libc.lib.so libm.lib.so posix.lib.so
lxip.lib.so vfs_lxip.lib.so
vfs_lwip.lib.so
test-libc_getaddrinfo
vfs.lib.so
timer
}
@ -81,6 +82,6 @@ lappend boot_modules [nic_drv_binary]
build_boot_image $boot_modules
append qemu_args " -nographic -net nic,model=e1000 -net user -net dump,file=[run_dir]/dump.pcap"
append qemu_args " -nographic -net nic,model=e1000 -net user"
run_genode_until "child .* exited with exit value 0.*\n" 20

View File

@ -0,0 +1,90 @@
assert_spec x86
proc use_dynamic_rom { } { return false }
set build_components {
core init
drivers/timer
drivers/nic
server/vfs
lib/vfs/lwip
lib/vfs/audit
}
lappend_if [use_dynamic_rom] build_components server/dynamic_rom
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
append config {
<config verbose="yes">
<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"/>
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
}
append_platform_drv_config
append config {
<start name="nic_drv">
<binary name="} [nic_drv_binary] {"/>
<resource name="RAM" quantum="4M"/>
<provides> <service name="Nic"/> </provides>
</start>
<start name="socket_fs" caps="200">
<binary name="vfs"/>
<resource name="RAM" quantum="32M"/>
<provides> <service name="File_system"/> </provides>
<route>
<service name="ROM" label="socket_fs.config"> <child name="dynamic_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
<config ld_verbose="yes">
<vfs>
<dir name="lwip">
<lwip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1" nameserver="8.8.8.8"/>
<!-- <lwip dhcp="yes"/> -->
</dir>
<dir name="socket">
<audit path="/lwip"/>
</dir>
</vfs>
<default-policy root="/socket" writeable="yes" />
</config>
</start>
}
append boot_modules {
core init timer } [nic_drv_binary] {
ld.lib.so
libc.lib.so
vfs
vfs_audit.lib.so
vfs.lib.so
vfs_lwip.lib.so
}
lappend_if [use_dynamic_rom] boot_modules dynamic_rom
append_platform_drv_boot_modules
append qemu_args " -nographic -net nic,model=e1000 -net tap,ifname=tap0,downscript=no,script=no "
# vi: set ft=tcl :

View File

@ -0,0 +1,72 @@
source ${genode_dir}/repos/libports/run/netty_lwip.inc
append build_components { test/netty/tcp }
build $build_components
create_boot_directory
append config {
<start name="netty-server-80">
<binary name="test-netty_tcp"/>
<resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" port="80" read_write="no" nonblock="true">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <fs/> </dir>
<dir name="tmp"> <ram/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
</config>
</start>
<start name="netty-server-8080">
<binary name="test-netty_tcp"/>
<resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" mode="server" port="8080" nonblock="false">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <fs/> </dir>
<dir name="tmp"> <ram/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
</config>
</start>
<!--
<start name="netty-client-A">
<binary name="test-netty_tcp"/>
<resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" mode="client" ip="10.0.2.1" port="8080">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <fs/> </dir>
<dir name="tmp"> <ram/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
</config>
</start>
<start name="netty-client-B">
<binary name="test-netty_tcp"/>
<resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" mode="client" ip="10.0.2.1" port="13002">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <fs/> </dir>
<dir name="tmp"> <ram/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
</config>
</start>
-->
</config>
}
install_config $config
append boot_modules { test-netty_tcp }
build_boot_image $boot_modules
run_genode_until forever
# vi: set ft=tcl :

View File

@ -0,0 +1,45 @@
source ${genode_dir}/repos/libports/run/netty_lwip.inc
append build_components { test/netty/udp }
build $build_components
create_boot_directory
append config {
<start name="netty-server-7">
<binary name="test-netty_udp"/>
<resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" port="7" read_write="no" nonblock="true">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <fs/> </dir>
<dir name="tmp"> <ram/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
</config>
</start>
<start name="netty-server-7070">
<binary name="test-netty_udp"/>
<resource name="RAM" quantum="4M"/>
<config ld_verbose="yes" mode="server" port="7070" nonblock="false">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="socket"> <fs/> </dir>
<dir name="tmp"> <ram/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
</config>
</start>
</config>
}
install_config $config
append boot_modules { test-netty_udp }
build_boot_image $boot_modules
run_genode_until forever
# vi: set ft=tcl :

View File

@ -0,0 +1,13 @@
assert_spec x86
proc append_socket_fs_build_components { } {
global build_components
append build_components { lib/vfs/lwip }
}
proc socket_fs_plugin {} { return lwip }
proc append_socket_fs_boot_modules {} {
global boot_modules
append boot_modules { vfs_lwip.lib.so }
}

View File

@ -468,7 +468,7 @@ extern "C" int socket_fs_accept(int libc_fd, sockaddr *addr, socklen_t *addrlen)
/* TODO EOPNOTSUPP - no SOCK_STREAM */
/* TODO ECONNABORTED */
char accept_buf[8];
char accept_buf[MAX_CONTROL_PATH_LEN];
{
int n = 0;
/* XXX currently reading accept may return without new connection */

View File

@ -0,0 +1,34 @@
/*
* \brief Memory manipulation utilities
* \author Emery Hemingway
* \date 2017-08-21
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef __LWIP__INCLUDE__STRING_H__
#define __LWIP__INCLUDE__STRING_H__
#ifdef __cplusplus
extern "C" {
#endif
void *memcpy(void *dst, const void *src, size_t len);
void *memset(void *b, int c, size_t len);
size_t strlen(const char *s);
int memcmp(const void *b1, const void *b2, size_t len);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t len);
#ifdef __cplusplus
}
#endif
#endif /* __LWIP__INCLUDE__STRING_H__ */

View File

@ -0,0 +1,36 @@
/*
* \brief Print function for debugging functionality of lwIP.
* \author Stefan Kalkowski
* \date 2009-10-26
*/
/*
* Copyright (C) 2009-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <base/printf.h>
#include <base/console.h>
#include <base/lock.h>
#include <base/env.h>
extern "C" {
/* LwIP includes */
#include <arch/cc.h>
/* Simply map to Genode's printf implementation */
void lwip_printf(const char *format, ...)
{
va_list list;
va_start(list, format);
Genode::vprintf(format, list);
va_end(list);
}
}

View File

@ -0,0 +1,30 @@
/*
* \brief Simple random number generator for lwIP
* \author Emery Hemingway
* \date 2016-07-30
*/
// *Really* minimal PCG32 code / (c) 2014 M.E. O'Neill / pcg-random.org
// Licensed under Apache License 2.0 (NO WARRANTY, etc. see website)
/* Genode includes */
#include <trace/timestamp.h>
#include <base/fixed_stdint.h>
extern "C"
genode_uint32_t genode_rand()
{
using namespace Genode;
static uint64_t const inc = Trace::timestamp()|1;
static uint64_t state = Trace::timestamp();
uint64_t oldstate = state;
// Advance internal state
state = oldstate * 6364136223846793005ULL + inc;
// Calculate output function (XSH RR), uses old state for max ILP
uint32_t xorshifted = ((oldstate >> 18u) ^ oldstate) >> 27u;
uint32_t rot = oldstate >> 59u;
return (xorshifted >> rot) | (xorshifted << ((-rot) & 31));
}

View File

@ -0,0 +1,116 @@
/*
* \brief lwIP platform support
* \author Stefan Kalkowski
* \author Emery Hemingway
* \date 2016-12-01
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
/* Genode includes */
#include <timer_session/connection.h>
#include <util/reconstructible.h>
#include <base/sleep.h>
#include <lwip/genode_init.h>
extern "C" {
/* LwIP includes */
#include <lwip/timeouts.h>
#include <lwip/init.h>
#include <lwip/sys.h>
#include <arch/cc.h>
/* our abridged copy of string.h */
#include <string.h>
}
namespace Lwip {
static Genode::Allocator *_heap;
/**
* XXX: can this be replaced with an alarm?
*/
struct Sys_timer
{
void check_timeouts(Genode::Duration) {
sys_check_timeouts(); }
Genode::Timeout_scheduler &timer;
Timer::Periodic_timeout<Sys_timer> timeout {
timer, *this, &Sys_timer::check_timeouts,
Genode::Microseconds{250*1000} };
Sys_timer(Genode::Timeout_scheduler &timer) : timer(timer) { }
};
static Genode::Constructible<Sys_timer> _sys_timer;
void genode_init(Genode::Allocator &heap, Genode::Timeout_scheduler &timer)
{
LWIP_ASSERT("LwIP initialized with an allocator that does not track sizes",
!heap.need_size_for_free());
_heap = &heap;
_sys_timer.construct(timer);
lwip_init();
}
}
extern "C" {
void lwip_platform_assert(char const* msg, char const *file, int line)
{
Genode::error("Assertion \"", msg, "\" ", file, ":", line);
Genode::sleep_forever();
}
void genode_free(void *ptr)
{
Lwip::_heap->free(ptr, 0);
}
void *genode_malloc(unsigned long size)
{
void *ptr = nullptr;
return Lwip::_heap->alloc(size, &ptr) ? ptr : 0;
}
void *genode_calloc(unsigned long number, unsigned long size)
{
void *ptr = nullptr;
size *= number;
if (Lwip::_heap->alloc(size, &ptr)) {
Genode::memset(ptr, 0x00, size);
return ptr;
}
return nullptr;
}
u32_t sys_now(void) {
return Lwip::_sys_timer->timer.curr_time().trunc_to_plain_ms().value; }
void genode_memcpy(void * dst, const void *src, unsigned long size) {
Genode::memcpy(dst, src, size); }
int memcmp(const void *b1, const void *b2, ::size_t len) {
return Genode::memcmp(b1, b2, len); }
int strcmp(const char *s1, const char *s2)
{
size_t len = Genode::min(Genode::strlen(s1), Genode::strlen(s2));
return Genode::strcmp(s1, s2, len);
}
int strncmp(const char *s1, const char *s2, size_t len) {
return Genode::strcmp(s1, s2, len); }
}

View File

@ -0,0 +1,9 @@
{
global:
vfs_file_system_factory;
local:
*;
};

View File

@ -0,0 +1,2 @@
TARGET = dummy-vfs_lwip
LIBS = vfs_lwip

File diff suppressed because it is too large Load Diff

View File

@ -80,12 +80,14 @@ if {$use_usb_driver} { set network_driver "usb_drv" }
if {$use_nic_driver} { set network_driver "nic_drv" }
if {$use_wifi_driver} { set network_driver "wifi_drv" }
set build_components {
append build_components {
core init
drivers/timer
app/netperf
}
append build_components " $netperf_target "
append_socket_fs_build_components
lappend_if $use_nic_driver build_components drivers/nic
lappend_if $use_usb_driver build_components drivers/usb
lappend_if $use_nic_bridge build_components server/nic_bridge
@ -290,23 +292,27 @@ append_platform_drv_config
append config {
<start name="netserver_genode" caps="220" priority="-1">
}
append config "<binary name=\"$netperf_app\"/>"
append config {
<binary name="netserver"/>
<resource name="RAM" quantum="32M"/>
<config>
<arg value="netserver"/>
<arg value="-D"/>
<arg value="-4"/>
<arg value="-f"/>
<libc tx_buf_size="2M" rx_buf_size="2M"}
append_if [expr [have_spec linux] && !$use_nic_router] config " ip_addr=\"$lx_ip_addr\" netmask=\"255.255.255.0\" gateway=\"10.0.2.1\""
append config {
stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" socket="/socket"/>
<vfs>
<dir name="dev">
<log/> <inline name="rtc">2018-01-01 00:01</inline>
</dir>
<dir name="socket">
<} [socket_fs_plugin] { }
if {[expr [have_spec linux] && !$use_nic_router]} {
append config " ip_addr=\"$lx_ip_addr\" netmask=\"255.255.255.0\" gateway=\"10.0.2.1\""
} else {
append config " dhcp=\"yes\""
}
append config {/>
</dir>
</vfs>
</config>}
append_if $use_nic_bridge config {
@ -331,13 +337,14 @@ install_config $config
#
# generic modules
set boot_modules {
append boot_modules {
core init timer
ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so
netserver
}
append boot_modules " $netperf_app "
append boot_modules " $netperf_stack "
append_socket_fs_boot_modules
lappend_if $use_nic_bridge boot_modules nic_bridge
lappend_if $use_nic_router boot_modules nic_router

View File

@ -1,4 +0,0 @@
set netperf_target app/netperf/lwip
set netperf_app netserver_lwip
set netperf_stack lwip_legacy.lib.so
set ip_match_string "got IP address (\[0-9]{1,3}.\[0-9]{1,3}.\[0-9]{1,3}.\[0-9]{1,3}).*\n"

View File

@ -13,5 +13,7 @@ set use_usb_11 "no"
set use_usb_20 "yes"
set use_usb_30 "no"
source ${genode_dir}/repos/ports/run/netperf_lwip.inc
set ip_match_string "address=(\[0-9\]+\.\[0-9\]+\.\[0-9\]+\.\[0-9\]+).*\n"
source ${genode_dir}/repos/libports/run/vfs_lwip.inc
source ${genode_dir}/repos/ports/run/netperf.inc

View File

@ -1,4 +0,0 @@
set netperf_target app/netperf/lxip
set netperf_app netserver_lxip
set netperf_stack { lxip.lib.so }
set ip_match_string "ipaddr=(\[0-9\]+\.\[0-9\]+\.\[0-9\]+\.\[0-9\]+).*\n"

View File

@ -13,5 +13,7 @@ set use_usb_11 "no"
set use_usb_20 "yes"
set use_usb_30 "no"
source ${genode_dir}/repos/ports/run/netperf_lxip.inc
set ip_match_string "ipaddr=(\[0-9\]+\.\[0-9\]+\.\[0-9\]+\.\[0-9\]+).*\n"
source ${genode_dir}/repos/dde_linux/run/vfs_lxip.inc
source ${genode_dir}/repos/ports/run/netperf.inc

View File

@ -1,7 +0,0 @@
TARGET = netserver_lwip
LIBS += libc_lwip_nic_dhcp
include $(PRG_DIR)/../target.inc
CC_CXX_WARN_STRICT =

View File

@ -1,7 +0,0 @@
TARGET = netserver_lxip
LIBS += libc_lxip
include $(PRG_DIR)/../target.inc
CC_CXX_WARN_STRICT =

View File

@ -1,3 +1,4 @@
TARGET = netserver
NETPERF_DIR := $(call select_from_ports,netperf)/src/app/netperf
@ -10,12 +11,14 @@ SRC_C += netsys_none.c netsec_none.c netdrv_none.c netrt_none.c netslot_none.c
SRC_CC += timer.cc
INC_DIR += $(PRG_DIR)/..
INC_DIR += $(PRG_DIR)
CC_OPT += -DHAVE_CONFIG_H -DGENODE_BUILD
CC_WARN = -Wall -Wno-unused
vpath %.c $(NETPERF_DIR)/src
vpath timer.cc $(PRG_DIR)/..
CC_CXX_WARN_STRICT =
vpath timer.cc $(PRG_DIR)
vpath %.c $(NETPERF_DIR)/src
# vi: set ft=make :

View File

@ -14,6 +14,7 @@ extract
fault_detection
fb_bench
fetchurl
fetchurl_lwip
fpu
fs_log
fs_packet