libunp is the library used in W. Richard Steven's book "UNIX Network
Programming Volume 1, 2nd Edition". It contains the library and headers used in the examples as well as all programs from the text that compile on FreeBSD systems. PR: ports/14057 Submitted by: James FitzGibbon <james@targetnet.com>
This commit is contained in:
parent
c29496611c
commit
a759fd52db
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=22128
22 changed files with 344 additions and 0 deletions
38
net/libunp/Makefile
Normal file
38
net/libunp/Makefile
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Ports collection makefile for: libunp
|
||||
# Version required: 1.0
|
||||
# Date created: Sept 28, 1999
|
||||
# Whom: james@targetnet.com
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
DISTNAME= unpv12e
|
||||
PKGNAME= libunp-1.0
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ftp://ftp.kohala.com/pub/rstevens/ \
|
||||
http://www.cs.columbia.edu/networks98/stevens/
|
||||
|
||||
MAINTAINER= james@targetnet.com
|
||||
|
||||
GNU_CONFIGURE= yes
|
||||
USE_GMAKE= yes
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
pre-patch:
|
||||
@ ${CP} ${WRKSRC}/lib/wrapsock.c ${WRKSRC}/lib/wrapsock_r.c
|
||||
|
||||
post-configure:
|
||||
@ ${MKDIR} ${WRKSRC}/unp
|
||||
@ ${LN} -s ${WRKSRC}/config.h ${WRKSRC}/unp/config.h
|
||||
@ ${LN} -s ${WRKSRC}/lib/addrinfo.h ${WRKSRC}/unp/addrinfo.h
|
||||
|
||||
do-install:
|
||||
${INSTALL_DATA} ${WRKSRC}/libunp.a ${PREFIX}/lib
|
||||
${INSTALL_DATA} ${WRKSRC}/libunp_r.a ${PREFIX}/lib
|
||||
${MKDIR} ${PREFIX}/include/unp
|
||||
${INSTALL_DATA} ${WRKSRC}/lib/unp.h ${PREFIX}/include
|
||||
${INSTALL_DATA} ${WRKSRC}/lib/addrinfo.h ${PREFIX}/include/unp
|
||||
${INSTALL_DATA} ${WRKSRC}/config.h ${PREFIX}/include/unp
|
||||
|
||||
.include <bsd.port.post.mk>
|
1
net/libunp/distinfo
Normal file
1
net/libunp/distinfo
Normal file
|
@ -0,0 +1 @@
|
|||
MD5 (unpv12e.tar.gz) = 701818c1be87de9680a3f3867bc47c8c
|
18
net/libunp/files/patch-aa
Normal file
18
net/libunp/files/patch-aa
Normal file
|
@ -0,0 +1,18 @@
|
|||
--- Makefile.in.orig Fri Apr 11 18:42:26 1997
|
||||
+++ Makefile.in Thu Sep 30 09:51:16 1999
|
||||
@@ -1,8 +1,13 @@
|
||||
include ./Make.defines
|
||||
|
||||
+SUBDIRS = lib libfree libgai libroute
|
||||
+
|
||||
all:
|
||||
- @echo "Nothing to make in this directory"
|
||||
- @echo "Please read the README file"
|
||||
+ PWD=`pwd`; \
|
||||
+ for dir in $(SUBDIRS) ; \
|
||||
+ do \
|
||||
+ cd $$PWD/$$dir && $(MAKE) && cd .. ;\
|
||||
+ done
|
||||
|
||||
clean:
|
||||
rm -f $(CLEANFILES)
|
10
net/libunp/files/patch-ab
Normal file
10
net/libunp/files/patch-ab
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- intro/Makefile.orig Tue Sep 28 11:39:20 1999
|
||||
+++ intro/Makefile Tue Sep 28 11:39:35 1999
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
PROGS = daytimetcpcli daytimetcpcli1 daytimetcpcli2 daytimetcpcli3 \
|
||||
daytimetcpsrv daytimetcpsrv1 daytimetcpsrv2 daytimetcpsrv3 \
|
||||
- daytimetcpcliv6 daytimetcpsrvv6 \
|
||||
byteorder
|
||||
|
||||
all: ${PROGS}
|
10
net/libunp/files/patch-ac
Normal file
10
net/libunp/files/patch-ac
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- icmpd/Makefile.orig Tue Sep 28 11:40:21 1999
|
||||
+++ icmpd/Makefile Tue Sep 28 11:40:24 1999
|
||||
@@ -1,6 +1,6 @@
|
||||
include ../Make.defines
|
||||
|
||||
-OBJS = icmpd.o readable_listen.o readable_conn.o readable_v4.o readable_v6.o
|
||||
+OBJS = icmpd.o readable_listen.o readable_conn.o readable_v4.o
|
||||
|
||||
PROGS = icmpd udpcli01
|
||||
|
12
net/libunp/files/patch-ad
Normal file
12
net/libunp/files/patch-ad
Normal file
|
@ -0,0 +1,12 @@
|
|||
--- ping/Makefile.orig Tue Sep 28 11:40:42 1999
|
||||
+++ ping/Makefile Tue Sep 28 11:40:53 1999
|
||||
@@ -1,7 +1,7 @@
|
||||
include ../Make.defines
|
||||
|
||||
-OBJS = main.o proc_v4.o proc_v6.o readloop.o \
|
||||
- send_v4.o send_v6.o sig_alrm.o tv_sub.o
|
||||
+OBJS = main.o proc_v4.o readloop.o \
|
||||
+ send_v4.o sig_alrm.o tv_sub.o
|
||||
PROGS = ping
|
||||
|
||||
all: ${PROGS}
|
10
net/libunp/files/patch-ae
Normal file
10
net/libunp/files/patch-ae
Normal file
|
@ -0,0 +1,10 @@
|
|||
--- traceroute/Makefile.orig Tue Sep 28 11:41:09 1999
|
||||
+++ traceroute/Makefile Tue Sep 28 11:41:17 1999
|
||||
@@ -1,6 +1,6 @@
|
||||
include ../Make.defines
|
||||
|
||||
-OBJS = main.o icmpcode_v4.o icmpcode_v6.o recv_v4.o recv_v6.o \
|
||||
+OBJS = main.o icmpcode_v4.o recv_v4.o \
|
||||
sig_alrm.o traceloop.o tv_sub.o
|
||||
PROGS = traceroute
|
||||
|
48
net/libunp/files/patch-af
Normal file
48
net/libunp/files/patch-af
Normal file
|
@ -0,0 +1,48 @@
|
|||
--- configure.orig Thu Jul 10 11:19:39 1997
|
||||
+++ configure Thu Sep 30 12:29:28 1999
|
||||
@@ -1101,10 +1101,12 @@
|
||||
echo "$ac_t""yes" 1>&6
|
||||
LIBUNP="$HOME/libunp.a"
|
||||
LIBUNP_NAME=$HOME/libunp.a
|
||||
+ LIBUNP_THREADSAFE_NAME=$HOME/libunp_r.a
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
LIBUNP="../libunp.a"
|
||||
LIBUNP_NAME=../libunp.a
|
||||
+ LIBUNP_THREADSAFE_NAME=../libunp_r.a
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for $HOME/libunpxti.a""... $ac_c" 1>&6
|
||||
@@ -4288,7 +4290,6 @@
|
||||
LIB_OBJS="$LIB_OBJS udp_connect.o"
|
||||
LIB_OBJS="$LIB_OBJS udp_server.o"
|
||||
LIB_OBJS="$LIB_OBJS wraplib.o"
|
||||
-LIB_OBJS="$LIB_OBJS wrapsock.o"
|
||||
LIB_OBJS="$LIB_OBJS wrapstdio.o"
|
||||
if test "$ac_cv_header_pthread_h" = yes ; then
|
||||
LIB_OBJS="$LIB_OBJS wrappthread.o"
|
||||
@@ -4297,6 +4298,8 @@
|
||||
LIB_OBJS="$LIB_OBJS write_fd.o"
|
||||
LIB_OBJS="$LIB_OBJS writen.o"
|
||||
LIB_OBJS="$LIB_OBJS writable_timeo.o"
|
||||
+LIB_THREADSAFE_OBJS="$LIB_OBJS wrapsock_r.o"
|
||||
+LIB_OBJS="$LIB_OBJS wrapsock.o"
|
||||
|
||||
LIBFREE_OBJS=
|
||||
|
||||
@@ -4514,6 +4517,7 @@
|
||||
s%@RANLIB@%$RANLIB%g
|
||||
s%@CPP@%$CPP%g
|
||||
s%@LIB_OBJS@%$LIB_OBJS%g
|
||||
+s%@LIB_THREADSAFE_OBJS@%$LIB_THREADSAFE_OBJS%g
|
||||
s%@LIBFREE_OBJS@%$LIBFREE_OBJS%g
|
||||
s%@LIBGAI_OBJS@%$LIBGAI_OBJS%g
|
||||
s%@LIBROUTE_OBJS@%$LIBROUTE_OBJS%g
|
||||
@@ -4522,6 +4526,7 @@
|
||||
s%@LIBUNP@%$LIBUNP%g
|
||||
s%@LIBUNPXTI@%$LIBUNPXTI%g
|
||||
s%@LIBUNP_NAME@%$LIBUNP_NAME%g
|
||||
+s%@LIBUNP_THREADSAFE_NAME@%$LIBUNP_THREADSAFE_NAME%g
|
||||
s%@LIBUNPXTI_NAME@%$LIBUNPXTI_NAME%g
|
||||
|
||||
CEOF
|
20
net/libunp/files/patch-ag
Normal file
20
net/libunp/files/patch-ag
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- lib/Makefile.orig Fri Apr 11 17:38:27 1997
|
||||
+++ lib/Makefile Thu Sep 30 11:34:21 1999
|
||||
@@ -1,8 +1,16 @@
|
||||
include ../Make.defines
|
||||
|
||||
-all: ${LIB_OBJS}
|
||||
+CFLAGS += -I.. -I.
|
||||
+
|
||||
+all: libunp.a libunp_r.a
|
||||
+
|
||||
+libunp.a: ${LIB_OBJS}
|
||||
ar rv ${LIBUNP_NAME} $?
|
||||
${RANLIB} ${LIBUNP_NAME}
|
||||
+
|
||||
+libunp_r.a: ${LIB_THREADSAFE_OBJS}
|
||||
+ ar rv ${LIBUNP_THREADSAFE_NAME} $?
|
||||
+ ${RANLIB} ${LIBUNP_THREADSAFE_NAME}
|
||||
|
||||
clean:
|
||||
rm -f ${PROGS} ${CLEANFILES}
|
18
net/libunp/files/patch-ah
Normal file
18
net/libunp/files/patch-ah
Normal file
|
@ -0,0 +1,18 @@
|
|||
--- Make.defines.in.orig Thu Jun 12 16:20:21 1997
|
||||
+++ Make.defines.in Thu Sep 30 10:13:57 1999
|
||||
@@ -17,6 +17,7 @@
|
||||
# Following is the main library, built from all the object files
|
||||
# in the lib/ and libfree/ directories.
|
||||
LIBUNP_NAME = @LIBUNP_NAME@
|
||||
+LIBUNP_THREADSAFE_NAME = @LIBUNP_THREADSAFE_NAME@
|
||||
|
||||
# Following is the XTI library, built from all the object files
|
||||
# in the libxti/ directory.
|
||||
@@ -24,6 +25,7 @@
|
||||
|
||||
# Following are all the object files to create in the lib/ directory.
|
||||
LIB_OBJS = @LIB_OBJS@
|
||||
+LIB_THREADSAFE_OBJS = @LIB_THREADSAFE_OBJS@
|
||||
|
||||
# Following are all the object files to create in the libfree/ directory.
|
||||
LIBFREE_OBJS = @LIBFREE_OBJS@
|
15
net/libunp/files/patch-ai
Normal file
15
net/libunp/files/patch-ai
Normal file
|
@ -0,0 +1,15 @@
|
|||
--- libfree/Makefile.orig Fri Oct 3 12:52:41 1997
|
||||
+++ libfree/Makefile Thu Sep 30 11:34:21 1999
|
||||
@@ -1,8 +1,12 @@
|
||||
include ../Make.defines
|
||||
|
||||
+CFLAGS += -I..
|
||||
+
|
||||
all: ${LIBFREE_OBJS}
|
||||
ar rv ${LIBUNP_NAME} $?
|
||||
${RANLIB} ${LIBUNP_NAME}
|
||||
+ ar rv ${LIBUNP_THREADSAFE_NAME} $?
|
||||
+ ${RANLIB} ${LIBUNP_THREADSAFE_NAME}
|
||||
|
||||
clean:
|
||||
rm -f ${PROGS} ${CLEANFILES}
|
16
net/libunp/files/patch-aj
Normal file
16
net/libunp/files/patch-aj
Normal file
|
@ -0,0 +1,16 @@
|
|||
--- libgai/Makefile.orig Mon Jun 2 18:03:30 1997
|
||||
+++ libgai/Makefile Thu Sep 30 11:34:11 1999
|
||||
@@ -6,9 +6,13 @@
|
||||
# appear in the book (too much clutter, given the amount of conditional
|
||||
# testing for all the code in this directory).
|
||||
|
||||
+CFLAGS += -I..
|
||||
+
|
||||
all: ${LIBGAI_OBJS}
|
||||
ar rv ${LIBUNP_NAME} $?
|
||||
${RANLIB} ${LIBUNP_NAME}
|
||||
+ ar rv ${LIBUNP_THREADSAFE_NAME} $?
|
||||
+ ${RANLIB} ${LIBUNP_THREADSAFE_NAME}
|
||||
|
||||
PROGS = testga test1
|
||||
|
15
net/libunp/files/patch-ak
Normal file
15
net/libunp/files/patch-ak
Normal file
|
@ -0,0 +1,15 @@
|
|||
--- libroute/Makefile.orig Thu Jun 12 16:16:47 1997
|
||||
+++ libroute/Makefile Thu Sep 30 11:34:21 1999
|
||||
@@ -1,8 +1,12 @@
|
||||
include ../Make.defines
|
||||
|
||||
+CFLAGS += -I..
|
||||
+
|
||||
all: ${LIBROUTE_OBJS}
|
||||
ar rv ${LIBUNP_NAME} $?
|
||||
${RANLIB} ${LIBUNP_NAME}
|
||||
+ ar rv ${LIBUNP_THREADSAFE_NAME} $?
|
||||
+ ${RANLIB} ${LIBUNP_THREADSAFE_NAME}
|
||||
|
||||
clean:
|
||||
rm -f ${PROGS} ${CLEANFILES}
|
20
net/libunp/files/patch-al
Normal file
20
net/libunp/files/patch-al
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- lib/unp.h.orig Sun Sep 14 15:49:59 1997
|
||||
+++ lib/unp.h Thu Sep 30 11:12:55 1999
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef __unp_h
|
||||
#define __unp_h
|
||||
|
||||
-#include "../config.h" /* configuration options for current OS */
|
||||
+#include <unp/config.h> /* configuration options for current OS */
|
||||
/* "../config.h" is generated by configure */
|
||||
|
||||
/* If anything changes in the following list of #includes, must change
|
||||
@@ -197,7 +197,7 @@
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
#ifndef HAVE_ADDRINFO_STRUCT
|
||||
-# include "../lib/addrinfo.h"
|
||||
+# include <unp/addrinfo.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_IF_NAMEINDEX_STRUCT
|
20
net/libunp/files/patch-am
Normal file
20
net/libunp/files/patch-am
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- lib/wrappthread.c.orig Thu Sep 30 11:06:22 1999
|
||||
+++ lib/wrappthread.c Thu Sep 30 11:06:34 1999
|
||||
@@ -40,17 +40,6 @@
|
||||
}
|
||||
|
||||
void
|
||||
-Pthread_kill(pthread_t tid, int signo)
|
||||
-{
|
||||
- int n;
|
||||
-
|
||||
- if ( (n = pthread_kill(tid, signo)) == 0)
|
||||
- return;
|
||||
- errno = n;
|
||||
- err_sys("pthread_kill error");
|
||||
-}
|
||||
-
|
||||
-void
|
||||
Pthread_mutexattr_init(pthread_mutexattr_t *attr)
|
||||
{
|
||||
int n;
|
11
net/libunp/files/patch-an
Normal file
11
net/libunp/files/patch-an
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- lib/unpifi.h.orig Thu Sep 30 11:13:10 1999
|
||||
+++ lib/unpifi.h Thu Sep 30 11:13:43 1999
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef __unp_ifi_h
|
||||
#define __unp_ifi_h
|
||||
|
||||
-#include "unp.h"
|
||||
+#include <unp.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#define IFI_NAME 16 /* same as IFNAMSIZ in <net/if.h> */
|
11
net/libunp/files/patch-ao
Normal file
11
net/libunp/files/patch-ao
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- lib/unprtt.h.orig Thu Sep 30 11:13:16 1999
|
||||
+++ lib/unprtt.h Thu Sep 30 11:13:37 1999
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __unp_rtt_h
|
||||
#define __unp_rtt_h
|
||||
|
||||
-#include "unp.h"
|
||||
+#include <unp.h>
|
||||
|
||||
struct rtt_info {
|
||||
float rtt_rtt; /* most recent measured RTT, seconds */
|
11
net/libunp/files/patch-ap
Normal file
11
net/libunp/files/patch-ap
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- lib/unpthread.h.orig Thu Sep 30 11:13:20 1999
|
||||
+++ lib/unpthread.h Thu Sep 30 11:13:41 1999
|
||||
@@ -4,7 +4,7 @@
|
||||
#ifndef __unp_pthread_h
|
||||
#define __unp_pthread_h
|
||||
|
||||
-#include "unp.h"
|
||||
+#include <unp.h>
|
||||
|
||||
void Pthread_create(pthread_t *, const pthread_attr_t *,
|
||||
void * (*)(void *), void *);
|
22
net/libunp/files/patch-aq
Normal file
22
net/libunp/files/patch-aq
Normal file
|
@ -0,0 +1,22 @@
|
|||
--- lib/wrapsock_r.c.orig Thu Sep 30 12:04:02 1999
|
||||
+++ lib/wrapsock_r.c Thu Sep 30 12:04:10 1999
|
||||
@@ -97,19 +97,6 @@
|
||||
}
|
||||
/* end Listen */
|
||||
|
||||
-#ifdef HAVE_POLL
|
||||
-int
|
||||
-Poll(struct pollfd *fdarray, unsigned long nfds, int timeout)
|
||||
-{
|
||||
- int n;
|
||||
-
|
||||
- if ( (n = poll(fdarray, nfds, timeout)) < 0)
|
||||
- err_sys("poll error");
|
||||
-
|
||||
- return(n);
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
ssize_t
|
||||
Recv(int fd, void *ptr, size_t nbytes, int flags)
|
||||
{
|
1
net/libunp/pkg-comment
Normal file
1
net/libunp/pkg-comment
Normal file
|
@ -0,0 +1 @@
|
|||
The networking library used in UNIX Network Programming Volume 1 2e
|
12
net/libunp/pkg-descr
Normal file
12
net/libunp/pkg-descr
Normal file
|
@ -0,0 +1,12 @@
|
|||
libunp is the library used in W. Richard Steven's book "UNIX Network
|
||||
Programming Volume 1, 2nd Edition". It contains the library and headers
|
||||
used in the examples as well as all programs from the text that compile on
|
||||
FreeBSD systems.
|
||||
|
||||
For more information on the book, see
|
||||
|
||||
http://www.phptr.com/ptrbooks/ptr_013490012X.html
|
||||
|
||||
For more info on W. Richard Stevens, see
|
||||
|
||||
http://www.kohala.com/~rstevens/
|
5
net/libunp/pkg-plist
Normal file
5
net/libunp/pkg-plist
Normal file
|
@ -0,0 +1,5 @@
|
|||
include/unp.h
|
||||
include/unp/config.h
|
||||
include/unp/addrinfo.h
|
||||
lib/libunp.a
|
||||
lib/libunp_r.a
|
Loading…
Reference in a new issue