# $Id$
## @file
# Adds sources list and defines required to LWIP pre-1.5.0 compilation
#
#
# Copyright (C) 2006-2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
LWIP_INCS += \
src/include \
src/include/ipv4 \
src/include/ipv6 \
vbox/include \
vbox
LWIP_SOURCES += \
src/api/api_lib.c \
src/api/api_msg.c \
src/api/err.c \
src/api/netbuf.c \
src/api/netdb.c \
src/api/netifapi.c \
src/api/sockets.c \
src/api/tcpip.c \
src/core/def.c \
src/core/dhcp.c \
src/core/dns.c \
src/core/inet_chksum.c \
src/core/init.c \
src/core/ipv4/autoip.c \
src/core/ipv4/icmp.c \
src/core/ipv4/igmp.c \
src/core/ipv4/ip4.c \
src/core/ipv4/ip4_addr.c \
src/core/ipv4/ip_frag.c \
src/core/ipv6/dhcp6.c \
src/core/ipv6/ethip6.c \
src/core/ipv6/icmp6.c \
src/core/ipv6/inet6.c \
src/core/ipv6/ip6.c \
src/core/ipv6/ip6_addr.c \
src/core/ipv6/ip6_frag.c \
src/core/ipv6/mld6.c \
src/core/ipv6/nd6.c \
src/core/mem.c \
src/core/memp.c \
src/core/netif.c \
src/core/pbuf.c \
src/core/raw.c \
src/core/stats.c \
src/core/sys.c \
src/core/tcp.c \
src/core/tcp_in.c \
src/core/tcp_out.c \
src/core/timers.c \
src/core/udp.c \
src/netif/etharp.c \
vbox/sys_arch.c \
vbox/VBoxLwipCore.cpp
# LWIP_SOURCES += \
# src/core/snmp/asn1_dec.c \
# src/core/snmp/asn1_enc.c \
# src/core/snmp/mib2.c \
# src/core/snmp/mib_structs.c \
# src/core/snmp/msg_in.c \
# src/core/snmp/msg_out.c \
# LWIP_SOURCES += \
# src/netif/slipif.c \
# LWIP_SOURCES += \
# src/netif/ppp/auth.c \
# src/netif/ppp/chap.c \
# src/netif/ppp/chpms.c \
# src/netif/ppp/fsm.c \
# src/netif/ppp/ipcp.c \
# src/netif/ppp/lcp.c \
# src/netif/ppp/magic.c \
# src/netif/ppp/md5.c \
# src/netif/ppp/pap.c \
# src/netif/ppp/ppp.c \
# src/netif/ppp/ppp_oe.c \
# src/netif/ppp/randm.c \
# src/netif/ppp/vj.c
define _def_vbox_lwip_use # VAR_BaseName, path/to/lwip/dir
$(strip $1)_SOURCES += \
$(foreach file, $(LWIP_SOURCES), $(strip $2)/$(file))
# if individual lwip files need special settings, add them here:
# $(strip $2)/src/foo/bar.c_CFLAGS += -magic
endef
define def_vbox_lwip_flags # PROTO_BaseName, VAR_BaseName, path/to/lwip/dir
# add anything configured for the component via PROTO_BaseName
$(foreach suffix, INCS DEFS,
$(if $(value $(strip $1)_LWIP_$(suffix)),
$(eval #
$(strip $2)_$(suffix) += $(value $(strip $1)_LWIP_$(suffix))
)))
# add lwip's own includes
$(strip $2)_INCS += $(foreach incdir, $(LWIP_INCS), $(strip $3)/$(incdir))
# disable lwip assertions for some build types
$(strip $2)_DEFS.release += LWIP_NOASSERT
$(strip $2)_DEFS.profile += LWIP_NOASSERT
$(strip $2)_DEFS.kprofile += LWIP_NOASSERT
endef
###
### Call this if you want to expose lwip to your component as a whole.
### In this case individual lwip files (added to _SOURCES of your
### component) will pick up lwip includes etc from your component
### settings.
###
### This is, for example, how NetworkServices/NAT uses it.
###
define def_vbox_lwip_public # VAR_BaseName, path/to/lwip/dir
$(eval $(call _def_vbox_lwip_use, $1, $2))
$(eval $(call def_vbox_lwip_flags, $1, $1, $2))
endef
###
### Call this if you want to expose lwip only to a few selected files.
### In this case each lwip file is configured with lwip includes etc
### separately and you are supposed to call def_vbox_lwip_flags
### yourself for those of your files that use lwip.
###
### This is, for example, how Devices uses it.
###
define def_vbox_lwip_private # VAR_BaseName, path/to/lwip/dir
$(eval $(call _def_vbox_lwip_use, $1, $2))
$(foreach file, $(LWIP_SOURCES), \
$(eval $(call def_vbox_lwip_flags, $1, $(strip $2)/$(file), $2)))
endef
ifeq ($(USERNAME), vvl)
$(foreach lwip_file, $(LWIP_SOURCES), $(eval $(lwip_file)_DEFS=RTMEM_WRAP_TO_EF_APIS))
LWIPTEST_SOURCES= Network/lwip-new/test/unit/core/test_mem.c \
Network/lwip-new/test/unit/etharp/test_etharp.c \
Network/lwip-new/test/unit/lwip_unittests.c \
Network/lwip-new/test/unit/tcp/tcp_helper.c \
Network/lwip-new/test/unit/tcp/test_tcp.c \
Network/lwip-new/test/unit/tcp/test_tcp_oos.c \
Network/lwip-new/test/unit/udp/test_udp.c
endif