1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

UDP-based Data Transfer

The UDT software is a C++ library containing the UDT API implementation
and programming examples.

WWW: http://udt.sourceforge.net/
This commit is contained in:
Mikhail Teterin 2012-02-15 03:40:32 +00:00
parent a6cde6cb09
commit 60c027a588
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=291401
9 changed files with 1548 additions and 0 deletions

View File

@ -1137,6 +1137,7 @@
SUBDIR += ucarp
SUBDIR += udptunnel
SUBDIR += udpxy
SUBDIR += udt
SUBDIR += ulxmlrpcpp
SUBDIR += unfs3
SUBDIR += unison

44
net/udt/Makefile Normal file
View File

@ -0,0 +1,44 @@
# New ports collection makefile for: udt
# Date created: 24 January 2012
# Whom: Mikhail Teterin
#
# $FreeBSD$
PORTNAME= udt
PORTVERSION= 4.10
CATEGORIES= net
MASTER_SITES= SF
DISTNAME= udt.sdk.${PORTVERSION}
MAINTAINER= mi@aldan.algebra.com
COMMENT= C++ library containing the UDT API implementation
PATCH_WRKSRC= ${WRKDIR}/udt${PORTVERSION:R}
WRKSRC= ${PATCH_WRKSRC}/src
MAKEFILE= ${FILESDIR}/BSDmakefile
USE_OPENSSL= yes
MAKE_JOBS_SAFE= yes
EXTRACT_AFTER_ARGS= |${TAR} -xpf - --exclude '*md5*' \
--exclude udt${PORTVERSION:R}/win
USE_LDCONFIG= yes
UDT_APPS= appclient appserver recvfile sendfile test
post-build:
# Building sample applications:
.for a in ${UDT_APPS}
${CXX} ${CXXFLAGS} ${WRKSRC:H}/app/$a.cpp -o ${WRKSRC:H}/app/udt-$a \
-I${WRKSRC} -L${WRKSRC} -ludt
.endfor
post-install:
# Installing sample applications:
${INSTALL_PROGRAM} ${UDT_APPS:S|^|${WRKSRC:H}/app/udt-|} ${PREFIX}/bin/
.if !defined(NOPORTDOCS)
# Installing documentation tree into ${DOCSDIR}
${MKDIR} ${DOCSDIR}
cd ${WRKSRC:H}/doc && ${COPYTREE_SHARE} \* ${DOCSDIR}
.else
EXTRACT_AFTER_ARGS+= --exclude udt${PORTVERSION:R}/doc
.endif
.include <bsd.port.mk>

2
net/udt/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (udt.sdk.4.10.tar.gz) = b690a717513119f5f5fac2f46789f19deb95f65e5e8a88f6229e173b0a7d6d2d
SIZE (udt.sdk.4.10.tar.gz) = 145833

28
net/udt/files/BSDmakefile Normal file
View File

@ -0,0 +1,28 @@
LIB= udt
SHLIB_MAJOR=4
SHLIB_MINOR=10
NO_PROFILE= yes # Ports don't install profile-libraries
LIBDIR= ${PREFIX}/lib
INCLUDEDIR= ${PREFIX}/include
INCS= udt.h
LDADD= -lcrypto -lpthread
SRCS= common.cpp window.cpp list.cpp buffer.cpp packet.cpp channel.cpp \
queue.cpp ccc.cpp cache.cpp core.cpp epoll.cpp api.cpp
WARNS= 4
CXXFLAGS+= -D${MACHINE_ARCH:U:S/I386/IA32/:S/SPARC64/SPARC/} -DBSD
#CXXFLAGS+= -Wsystem-headers -Werror -Wall -Wno-format-y2k -W \
# -Wno-unused-parameter -Wpointer-arith -Wreturn-type \
# -Wcast-qual -Wwrite-strings -Wswitch -Wcast-align \
# -Wunused-parameter
.if defined(OPENSSLLIB) && ${OPENSSLLIB} != "/usr/lib"
LDADD= -L${OPENSSLLIB}
.endif
.if defined(OPENSSLINC) && ${OPENSSLINC} != "/usr/include"
CXXFLAGS+= -I${OPENSSLINC}
.endif
.include <bsd.lib.mk>

1242
net/udt/files/patch-by-value Normal file

File diff suppressed because it is too large Load Diff

24
net/udt/files/patch-md5 Normal file
View File

@ -0,0 +1,24 @@
Use OpenSSL's md5-implementation instead of UDT's own.
Rejected by author because of concerns for Windows computers
and mobile devices.
--- src/common.cpp 2011-12-26 12:09:11.000000000 -0500
+++ src/common.cpp 2012-01-26 17:48:01.000000000 -0500
@@ -56,5 +56,5 @@
#include <cmath>
-#include "md5.h"
+#include <openssl/md5.h>
#include "common.h"
@@ -742,8 +742,4 @@
void CMD5::compute(const char* input, unsigned char result[16])
{
- md5_state_t state;
-
- md5_init(&state);
- md5_append(&state, (const md5_byte_t *)input, strlen(input));
- md5_finish(&state, result);
+ MD5((const unsigned char *)input, strlen(input), result);
}

128
net/udt/files/patch-warning Normal file
View File

@ -0,0 +1,128 @@
Accepted (largely) by the author already. See:
https://sourceforge.net/tracker/?func=detail&atid=670041&aid=3480628&group_id=115059
--- src/channel.cpp 2011-12-26 12:09:11.000000000 -0500
+++ src/channel.cpp 2012-01-27 10:55:29.000000000 -0500
@@ -252,5 +252,5 @@
#ifndef WIN32
msghdr mh;
- mh.msg_name = (sockaddr*)addr;
+ mh.msg_name = (void *)addr;
mh.msg_namelen = m_iSockAddrSize;
mh.msg_iov = (iovec*)packet.m_PacketVector;
--- src/epoll.cpp 2011-12-26 12:09:11.000000000 -0500
+++ src/epoll.cpp 2012-01-27 11:56:49.000000000 -0500
@@ -108,5 +108,9 @@
}
-int CEPoll::add_ssock(const int eid, const SYSSOCKET& s, const int* events)
+int CEPoll::add_ssock(const int eid, const SYSSOCKET& s, const int*
+#ifdef LINUX
+events /* XXX Only on Linux are we using this parameter currently */
+#endif
+)
{
CGuard pg(m_EPollLock);
--- src/queue.cpp 2011-12-26 12:09:11.000000000 -0500
+++ src/queue.cpp 2012-01-27 10:55:29.000000000 -0500
@@ -488,8 +488,8 @@
}
-void CSndQueue::init(const CChannel* c, const CTimer* t)
+void CSndQueue::init(CChannel* c, CTimer* t)
{
- m_pChannel = (CChannel*)c;
- m_pTimer = (CTimer*)t;
+ m_pChannel = c;
+ m_pTimer = t;
m_pSndUList = new CSndUList;
m_pSndUList->m_pWindowLock = &m_WindowLock;
@@ -710,5 +710,5 @@
}
-void CHash::insert(const int32_t& id, const CUDT* u)
+void CHash::insert(int32_t id, CUDT* u)
{
CBucket* b = m_pBucket[id % m_iHashSize];
@@ -716,5 +716,5 @@
CBucket* n = new CBucket;
n->m_iID = id;
- n->m_pUDT = (CUDT*)u;
+ n->m_pUDT = u;
n->m_pNext = b;
@@ -938,5 +938,5 @@
}
-void CRcvQueue::init(const int& qsize, const int& payload, const int& version, const int& hsize, const CChannel* cc, const CTimer* t)
+void CRcvQueue::init(int qsize, int payload, int version, int hsize, CChannel* cc, CTimer* t)
{
m_iPayloadSize = payload;
@@ -947,6 +947,6 @@
m_pHash->init(hsize);
- m_pChannel = (CChannel*)cc;
- m_pTimer = (CTimer*)t;
+ m_pChannel = cc;
+ m_pTimer = t;
m_pRcvUList = new CRcvUList;
@@ -1021,5 +1021,5 @@
{
if (NULL != self->m_pListener)
- ((CUDT*)self->m_pListener)->listen(addr, unit->m_Packet);
+ self->m_pListener->listen(addr, unit->m_Packet);
else if (NULL != (u = self->m_pRendezvousQueue->retrieve(addr, id)))
{
@@ -1160,5 +1160,5 @@
}
-int CRcvQueue::setListener(const CUDT* u)
+int CRcvQueue::setListener(CUDT* u)
{
CGuard lslock(m_LSLock);
@@ -1167,5 +1167,5 @@
return -1;
- m_pListener = (CUDT*)u;
+ m_pListener = u;
return 0;
}
--- src/queue.h 2011-12-26 12:09:11.000000000 -0500
+++ src/queue.h 2012-01-27 10:55:29.000000000 -0500
@@ -312,5 +312,5 @@
// None.
- void insert(const int32_t& id, const CUDT* u);
+ void insert(int32_t id, CUDT* u);
// Functionality:
@@ -385,5 +385,5 @@
// None.
- void init(const CChannel* c, const CTimer* t);
+ void init(CChannel* c, CTimer* t);
// Functionality:
@@ -445,5 +445,5 @@
// None.
- void init(const int& size, const int& payload, const int& version, const int& hsize, const CChannel* c, const CTimer* t);
+ void init(int size, int payload, int version, int hsize, CChannel* c, CTimer* t);
// Functionality:
@@ -480,5 +480,5 @@
private:
- int setListener(const CUDT* u);
+ int setListener(CUDT* u);
void removeListener(const CUDT* u);
@@ -494,5 +494,5 @@
private:
pthread_mutex_t m_LSLock;
- volatile CUDT* m_pListener; // pointer to the (unique, if any) listening UDT entity
+ CUDT* m_pListener; // pointer to the (unique, if any) listening UDT entity
CRendezvousQueue* m_pRendezvousQueue; // The list of sockets in rendezvous mode

6
net/udt/pkg-descr Normal file
View File

@ -0,0 +1,6 @@
UDP-based Data Transfer
The UDT software is a C++ library containing the UDT API implementation
and programming examples.
WWW: http://udt.sourceforge.net/

73
net/udt/pkg-plist Normal file
View File

@ -0,0 +1,73 @@
lib/libudt.so
lib/libudt.so.4
lib/libudt.a
include/udt.h
bin/udt-appclient
bin/udt-appserver
bin/udt-recvfile
bin/udt-sendfile
bin/udt-test
%%PORTDOCS%%%%DOCSDIR%%/index.htm
%%PORTDOCS%%%%DOCSDIR%%/main.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/startup.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/ecode.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-hello.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/bind.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/sockname.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/error.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/structure.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/socket.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/peername.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-intro.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-data.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/listen.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/ccc.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/epoll.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/make.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/treeview.css
%%PORTDOCS%%%%DOCSDIR%%/doc/t-firewall.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/copy.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-msg.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-cc.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/function.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-config.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/send.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/udtdoc.css
%%PORTDOCS%%%%DOCSDIR%%/doc/t-udt3.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/accept.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/reference.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/sendmsg.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/recv.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/cleanup.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/selectex.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-file.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/intro.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/recvfile.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/header.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/footer.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/close.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/opt.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/recvmsg.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/t-error.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/connect.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/sendfile.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/trace.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/select.htm
%%PORTDOCS%%%%DOCSDIR%%/doc/tutorial.htm
%%PORTDOCS%%@dirrm %%DOCSDIR%%/doc
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_end.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_list.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_link.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_leaf.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_up.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_listm.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_line.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_space.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_endm.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_book.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_down.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_open.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_listp.gif
%%PORTDOCS%%%%DOCSDIR%%/hlp/ix_endp.gif
%%PORTDOCS%%@dirrm %%DOCSDIR%%/hlp
%%PORTDOCS%%@dirrm %%DOCSDIR%%/