[tcp] add third_party module for TCPlp (#6885)

This commit creates a module in third_party for TCPlp code. It is a
placeholder for now; the actual code will be added in future commits.
This commit is contained in:
Sam Kumar 2021-08-06 22:04:31 -07:00 committed by GitHub
parent c39c4cb2df
commit 6fa60be75c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 157 additions and 1 deletions

View File

@ -1007,6 +1007,7 @@ src/lib/url/Makefile
third_party/Makefile
third_party/jlink/Makefile
third_party/mbedtls/Makefile
third_party/tcplp/Makefile
examples/Makefile
examples/apps/Makefile
examples/apps/cli/Makefile

View File

@ -40,6 +40,7 @@ CPPFLAGS_COMMON += \
$(NULL)
LDADD_COMMON += \
$(top_builddir)/third_party/tcplp/libtcplp.a \
$(NULL)
LDFLAGS_COMMON += \

View File

@ -40,6 +40,7 @@ CPPFLAGS_COMMON += \
$(NULL)
LDADD_COMMON += \
$(top_builddir)/third_party/tcplp/libtcplp.a \
$(NULL)
LDFLAGS_COMMON += \

View File

@ -57,6 +57,7 @@ LIBTOOLFLAGS_COMMON = --preserve-dup-deps
LDADD_COMMON = \
$(top_builddir)/src/posix/platform/libopenthread-posix.a \
-lutil \
$(top_builddir)/third_party/tcplp/libtcplp.a \
$(NULL)
if OPENTHREAD_TARGET_LINUX

View File

@ -43,6 +43,7 @@ AM_CPPFLAGS = \
COMMON_LDADD = \
$(top_builddir)/src/core/libopenthread-ftd.a \
$(top_builddir)/third_party/mbedtls/libmbedcrypto.a \
$(top_builddir)/third_party/tcplp/libtcplp.a \
$(LIB_FUZZING_ENGINE) \
$(NULL)

View File

@ -73,6 +73,7 @@ AM_CPPFLAGS += \
endif
COMMON_LDADD = \
$(top_builddir)/third_party/tcplp/libtcplp.a \
$(NULL)
if OPENTHREAD_ENABLE_NCP
@ -296,4 +297,3 @@ endif # OPENTHREAD_BUILD_COVERAGE
endif # OPENTHREAD_BUILD_TESTS
include $(abs_top_nlbuild_autotools_dir)/automake/post.am

View File

@ -29,3 +29,5 @@
if(NOT OT_EXTERNAL_MBEDTLS)
add_subdirectory(mbedtls)
endif()
add_subdirectory(tcplp)

View File

@ -38,9 +38,11 @@ EXTRA_DIST = \
DIST_SUBDIRS = \
jlink \
mbedtls \
tcplp \
$(NULL)
SUBDIRS = \
tcplp \
$(NULL)
if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS

46
third_party/tcplp/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,46 @@
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
project("TCPlp" C)
set(src_tcplp
tcplp.c
)
set(tcplp_static_target "tcplp")
add_library(${tcplp_static_target} STATIC ${src_tcplp})
set_target_properties(${tcplp_static_target} PROPERTIES OUTPUT_NAME tcplp)
target_include_directories(${tcplp_static_target}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/bsdtcp
${CMAKE_CURRENT_SOURCE_DIR}/lib
PRIVATE
${OT_PUBLIC_INCLUDES}
$<TARGET_PROPERTY:ot-config,INTERFACE_INCLUDE_DIRECTORIES>
)

68
third_party/tcplp/Makefile.am vendored Normal file
View File

@ -0,0 +1,68 @@
#
# Copyright (c) 2021, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
include $(abs_top_nlbuild_autotools_dir)/automake/pre.am
EXTRA_DIST = \
tcplp.h \
$(NULL)
lib_LIBRARIES = \
libtcplp.a \
$(NULL)
# Do not enable -Wsign-compare for TCPlp
override CFLAGS := $(filter-out -Wsign-compare,$(CFLAGS))
override CFLAGS := $(CFLAGS) -Wno-sign-compare
# Do not enable -Wunused-parameter for TCPlp
override CFLAGS := $(filter-out -Wunused-parameter,$(CFLAGS))
override CFLAGS := $(CFLAGS) -Wno-unused-parameter
# Do not enable -Waddress-of-packed-member for TCPlp
override CFLAGS := $(filter-out -Waddress-of-packed-member,$(CFLAGS))
override CFLAGS := $(CFLAGS) -Wno-address-of-packed-member
# Do not enable -pedantic-errors for TCPlp
override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS))
TCPLP_SRCDIR = $(top_srcdir)/third_party/tcplp
libtcplp_a_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/core \
-I$(TCPLP_SRCDIR)/bsdtcp \
-I$(TCPLP_SRCDIR)/lib \
$(TCPLP_CPPFLAGS) \
$(NULL)
libtcplp_a_SOURCES = \
tcplp.c
$(NULL)
include $(abs_top_nlbuild_autotools_dir)/automake/post.am

33
third_party/tcplp/README.md vendored Normal file
View File

@ -0,0 +1,33 @@
# TCPlp
This module will contain a port of TCPlp for OpenThread. Currently, it only
contains part of the implementation; the rest will be added in future pull
requests.
## URL
Based on https://github.com/ucbrise/tcplp.
## License
BSD 3-Clause
TCPlp is derived from the TCP stack in the FreeBSD Operating System. Files
taken from FreeBSD retain their original copyright notices and licenses (which
are BSD-like licenses). New code contributed as part of TCPlp is provided
under the BSD 3-Clause License.
## Description
TCPlp is a full-scale TCP stack for low-power wireless networks and
resource-constrained embedded systems. It is designed to support performant and
efficient TCP operation over IEEE 802.15.4 networks. It is based on the TCP
stack in the FreeBSD operating system.
TCPlp is a software artifact that accompanies an NSDI 2020 paper:
Sam Kumar, Michael P Andersen, Hyung-Sin Kim, and David E. Culler. Performant TCP for Low-Power Wireless Networks. NSDI 2020.
The paper is available at the following locations:
* https://www.usenix.org/conference/nsdi20/presentation/kumar
* https://arxiv.org/abs/1811.02721

0
third_party/tcplp/tcplp.c vendored Normal file
View File

0
third_party/tcplp/tcplp.h vendored Normal file
View File