Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jul 2012 20:48:23 +0000 (UTC)
From:      Mikhail Teterin <mi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r301670 - in head/devel: . jech-dht jech-dht/files
Message-ID:  <201207282048.q6SKmNXs066657@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mi
Date: Sat Jul 28 20:48:23 2012
New Revision: 301670
URL: http://svn.freebsd.org/changeset/ports/301670

Log:
  Add implementation of Kademlia Distributed Hash Table (DHT) used
  in the Bittorrent network (``mainline'' variant).

Added:
  head/devel/jech-dht/
  head/devel/jech-dht/Makefile   (contents, props changed)
  head/devel/jech-dht/distinfo   (contents, props changed)
  head/devel/jech-dht/files/
  head/devel/jech-dht/files/BSDmakefile   (contents, props changed)
  head/devel/jech-dht/files/patch-warns   (contents, props changed)
  head/devel/jech-dht/pkg-descr   (contents, props changed)
  head/devel/jech-dht/pkg-plist   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Sat Jul 28 20:44:43 2012	(r301669)
+++ head/devel/Makefile	Sat Jul 28 20:48:23 2012	(r301670)
@@ -314,6 +314,7 @@
     SUBDIR += devhelp
     SUBDIR += devtodo
     SUBDIR += dfuife-curses
+    SUBDIR += jech-dht
     SUBDIR += dia2code
     SUBDIR += diffuse
     SUBDIR += ding-libs

Added: head/devel/jech-dht/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/jech-dht/Makefile	Sat Jul 28 20:48:23 2012	(r301670)
@@ -0,0 +1,25 @@
+# New ports collection makefile for: jech-dht
+# Date created: July 28, 2012
+# Whom:		Mikhail Teterin <mi@aldan.algebra.com>
+#
+# $FreeBSD$
+#
+
+PORTNAME=	dht
+PORTVERSION=	0.21
+CATEGORIES=	net devel
+MASTER_SITES=	http://www.pps.univ-paris-diderot.fr/~jch/software/files/
+
+MAINTAINER=	mi@aldan.algebra.com
+COMMENT=	Mainline variant of Kademlia Distributed Hash Table (DHT)
+
+LICENSE=	MIT
+
+MAKEFILE=	${FILESDIR}/BSDmakefile
+MAKE_JOBS_SAFE=	yes
+USE_LDCONFIG=	yes
+
+pre-su-install:
+	${MKDIR} ${PREFIX}/include/dht
+
+.include <bsd.port.mk>

Added: head/devel/jech-dht/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/jech-dht/distinfo	Sat Jul 28 20:48:23 2012	(r301670)
@@ -0,0 +1,2 @@
+SHA256 (dht-0.21.tar.gz) = edf8fd9bf6225bbced38a74bb40592d46876fdfb74e9ebddecbdc1e805bdf44f
+SIZE (dht-0.21.tar.gz) = 27578

Added: head/devel/jech-dht/files/BSDmakefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/jech-dht/files/BSDmakefile	Sat Jul 28 20:48:23 2012	(r301670)
@@ -0,0 +1,14 @@
+LIB=	dht
+SHLIB_MAJOR=	0
+SHLIB_MINOR=	21
+
+SRCS=	dht.c
+
+CFLAGS+=-DHAVE_MEMMEM
+WARNS=	3
+
+INCS=	dht.h
+INCLUDEDIR=${PREFIX}/include/dht
+LIBDIR=	${PREFIX}/lib
+
+.include <bsd.lib.mk>

Added: head/devel/jech-dht/files/patch-warns
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/jech-dht/files/patch-warns	Sat Jul 28 20:48:23 2012	(r301670)
@@ -0,0 +1,121 @@
+--- dht.c	2011-07-25 17:59:36.000000000 -0400
++++ dht.c	2012-07-28 16:21:07.000000000 -0400
+@@ -356,5 +356,5 @@
+     switch(sa->sa_family) {
+     case AF_INET: {
+-        struct sockaddr_in *sin = (struct sockaddr_in*)sa;
++        const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
+         const unsigned char *address = (const unsigned char*)&sin->sin_addr;
+         return sin->sin_port == 0 ||
+@@ -364,5 +364,5 @@
+     }
+     case AF_INET6: {
+-        struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
++        const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
+         const unsigned char *address = (const unsigned char*)&sin6->sin6_addr;
+         return sin6->sin6_port == 0 ||
+@@ -687,5 +687,5 @@
+     int i;
+ 
+-    if(salen > sizeof(struct sockaddr_storage))
++    if((unsigned)salen > sizeof(struct sockaddr_storage))
+         abort();
+ 
+@@ -1281,13 +1281,13 @@
+     int i, len;
+     struct storage *st;
+-    unsigned char *ip;
++    const unsigned char *ip;
+ 
+     if(sa->sa_family == AF_INET) {
+-        struct sockaddr_in *sin = (struct sockaddr_in*)sa;
+-        ip = (unsigned char*)&sin->sin_addr;
++        const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
++        ip = (const unsigned char*)&sin->sin_addr;
+         len = 4;
+     } else if(sa->sa_family == AF_INET6) {
+-        struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
+-        ip = (unsigned char*)&sin6->sin6_addr;
++        const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
++        ip = (const unsigned char*)&sin6->sin6_addr;
+         len = 16;
+     } else {
+@@ -1406,15 +1406,15 @@
+ make_token(const struct sockaddr *sa, int old, unsigned char *token_return)
+ {
+-    void *ip;
++    const void *ip;
+     int iplen;
+     unsigned short port;
+ 
+     if(sa->sa_family == AF_INET) {
+-        struct sockaddr_in *sin = (struct sockaddr_in*)sa;
++        const struct sockaddr_in *sin = (const struct sockaddr_in*)sa;
+         ip = &sin->sin_addr;
+         iplen = 4;
+         port = htons(sin->sin_port);
+     } else if(sa->sa_family == AF_INET6) {
+-        struct sockaddr_in6 *sin6 = (struct sockaddr_in6*)sa;
++        const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6*)sa;
+         ip = &sin6->sin6_addr;
+         iplen = 16;
+@@ -1892,5 +1892,5 @@
+         }
+ 
+-        if(((char*)buf)[buflen] != '\0') {
++        if(((const char*)buf)[buflen] != '\0') {
+             debugf("Unterminated message.\n");
+             errno = EINVAL;
+@@ -2743,5 +2743,5 @@
+ 
+ #define CHECK(ptr, len)                                                 \
+-    if(((unsigned char*)ptr) + (len) > (buf) + (buflen)) goto overflow;
++    if(((const unsigned char*)ptr) + (len) > (buf) + (buflen)) goto overflow;
+ 
+     if(tid_return) {
+@@ -2750,5 +2750,5 @@
+             long l;
+             char *q;
+-            l = strtol((char*)p + 3, &q, 10);
++            l = strtol((const char*)p + 3, &q, 10);
+             if(q && *q == ':' && l > 0 && l < *tid_len) {
+                 CHECK(q + 1, l);
+@@ -2782,5 +2782,5 @@
+             long l;
+             char *q;
+-            l = strtol((char*)p + 5, &q, 10);
++            l = strtol((const char*)p + 5, &q, 10);
+             if(q && *q == 'e' && l > 0 && l < 0x10000)
+                 *port_return = l;
+@@ -2804,5 +2804,5 @@
+             long l;
+             char *q;
+-            l = strtol((char*)p + 7, &q, 10);
++            l = strtol((const char*)p + 7, &q, 10);
+             if(q && *q == ':' && l > 0 && l < *token_len) {
+                 CHECK(q + 1, l);
+@@ -2820,5 +2820,5 @@
+             long l;
+             char *q;
+-            l = strtol((char*)p + 7, &q, 10);
++            l = strtol((const char*)p + 7, &q, 10);
+             if(q && *q == ':' && l > 0 && l < *nodes_len) {
+                 CHECK(q + 1, l);
+@@ -2836,5 +2836,5 @@
+             long l;
+             char *q;
+-            l = strtol((char*)p + 8, &q, 10);
++            l = strtol((const char*)p + 8, &q, 10);
+             if(q && *q == ':' && l > 0 && l < *nodes6_len) {
+                 CHECK(q + 1, l);
+@@ -2855,8 +2855,8 @@
+                 long l;
+                 char *q;
+-                l = strtol((char*)buf + i, &q, 10);
++                l = strtol((const char*)buf + i, &q, 10);
+                 if(q && *q == ':' && l > 0) {
+                     CHECK(q + 1, l);
+-                    i = q + 1 + l - (char*)buf;
++                    i = q + 1 + l - (const char*)buf;
+                     if(l == 6) {
+                         if(j + l > *values_len)

Added: head/devel/jech-dht/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/jech-dht/pkg-descr	Sat Jul 28 20:48:23 2012	(r301670)
@@ -0,0 +1,6 @@
+The files dht.c and dht.h implement the variant of the Kademlia
+Distributed Hash Table (DHT) used in the Bittorrent network
+(``mainline'' variant).
+
+WWW: http://www.pps.univ-paris-diderot.fr/~jch/software/bittorrent/
+WWW: https://github.com/jech/dht

Added: head/devel/jech-dht/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/jech-dht/pkg-plist	Sat Jul 28 20:48:23 2012	(r301670)
@@ -0,0 +1,5 @@
+lib/libdht.so.0
+lib/libdht.so
+lib/libdht.a
+include/dht/dht.h
+@dirrm include/dht



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207282048.q6SKmNXs066657>