devel/libtuntap: add new port

PR:		213956
Submitted by:	Mahdi Mokhtari <mokhi64@gmail.com>

libtuntap is a library for configuring TUN or TAP devices in a portable manner.

TUN and TAP are virtual networking devices which allow
userland applications to receive packets sent to it.

The userland applications can also send their own packets to the devices
and they will be forwarded to the kernel.

https://github.com/LaKabane/libtuntap
This commit is contained in:
Jan Beich 2016-11-01 17:46:52 +00:00
parent f1023bd890
commit d0ddf84271
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=425062
7 changed files with 87 additions and 0 deletions

View file

@ -1404,6 +1404,7 @@
SUBDIR += libtifiles2
SUBDIR += libtool
SUBDIR += libtpl
SUBDIR += libtuntap
SUBDIR += libublio
SUBDIR += libukcprog
SUBDIR += libunicode

32
devel/libtuntap/Makefile Normal file
View file

@ -0,0 +1,32 @@
# Created by: Mahdi Mokhtari <mokhi64@gmail.com>
# $FreeBSD$
PORTNAME= libtuntap
DISTVERSION= 0.3-23
DISTVERSIONSUFFIX= -ga8bcade
CATEGORIES= devel net
MAINTAINER= mokhi64@gmail.com
COMMENT= Configuring TUN or TAP devices API in a portable manner
LICENSE= MIT
USES= cmake
USE_LDCONFIG= yes
USE_GITHUB= yes
GH_ACCOUNT= LaKabane
OPTIONS_DEFINE= CXX_WRPR TEST
OPTIONS_SUB= yes
CXX_WRPR_DESC= Build C++ wrapper library
TEST_DESC= Build regression tests
CXX_WRPR_USES= compiler:c++11-lang
CXX_WRPR_CMAKE_BOOL= ENABLE_CXX
CXX_WRPR_VARS= USE_CXXSTD=c++11
TEST_CMAKE_BOOL= ENABLE_REGRESS
TEST_TEST_TARGET= test
.include <bsd.port.mk>

3
devel/libtuntap/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1477977157
SHA256 (LaKabane-libtuntap-0.3-23-ga8bcade_GH0.tar.gz) = 3f2db000fa77a91ef056d996c763f7e1fc18c3529847308025629ea047d56a1d
SIZE (LaKabane-libtuntap-0.3-23-ga8bcade_GH0.tar.gz) = 22262

View file

@ -0,0 +1,14 @@
--- CMakeLists.txt.orig 2016-10-29 14:49:34 UTC
+++ CMakeLists.txt
@@ -124,6 +124,11 @@ if(UNIX)
install(TARGETS tuntap DESTINATION lib)
install(TARGETS tuntap-static DESTINATION lib)
install(FILES tuntap.h DESTINATION include)
+ if(ENABLE_CXX)
+ install(TARGETS tuntap++ DESTINATION lib)
+ install(TARGETS tuntap++-static DESTINATION lib)
+ install(FILES bindings/cpp/tuntap++.hh DESTINATION include)
+ endif(ENABLE_CXX)
endif(UNIX)
include(CMakeLists.txt.local OPTIONAL)

View file

@ -0,0 +1,20 @@
--- bindings/cpp/tuntap++.cc.orig 2016-10-29 14:49:34 UTC
+++ bindings/cpp/tuntap++.cc
@@ -7,7 +7,7 @@
namespace tuntap {
tun::tun()
- : _dev{tuntap_init()}
+ : _dev(tuntap_init())
{
tuntap_start(_dev, TUNTAP_MODE_TUNNEL, TUNTAP_ID_ANY);
}
@@ -84,7 +84,7 @@ tun::nonblocking(bool b)
}
tap::tap()
- : _dev{tuntap_init()}
+ : _dev(tuntap_init())
{
tuntap_start(_dev, TUNTAP_MODE_ETHERNET, TUNTAP_ID_ANY);
}

View file

@ -0,0 +1,9 @@
libtuntap is a library for configuring TUN or TAP devices in a portable manner.
TUN and TAP are virtual networking devices which allow
userland applications to receive packets sent to it.
The userland applications can also send their own packets to the devices
and they will be forwarded to the kernel.
WWW: https://github.com/LaKabane/libtuntap

View file

@ -0,0 +1,8 @@
include/tuntap.h
%%CXX_WRPR%%include/tuntap++.hh
lib/libtuntap.a
lib/libtuntap.so
lib/libtuntap.so.2.1
%%CXX_WRPR%%lib/libtuntap++.a
%%CXX_WRPR%%lib/libtuntap++.so
%%CXX_WRPR%%lib/libtuntap++.so.2.1