summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>1998-04-16 16:11:21 +0000
committertron <tron@pkgsrc.org>1998-04-16 16:11:21 +0000
commit00ab5b9fb10eac7439f47af9ffe84d297f31f315 (patch)
tree68b0c71a410d25d5d72bbb352790943678a4811c /net
parent39ba5dc307243f25b97bc6af8d693f549c7f3113 (diff)
downloadpkgsrc-00ab5b9fb10eac7439f47af9ffe84d297f31f315.tar.gz
Initial import of FreeBSD's "dip" port.
Diffstat (limited to 'net')
-rw-r--r--net/dip/Makefile19
-rw-r--r--net/dip/files/md51
-rw-r--r--net/dip/patches/patch-a150
-rw-r--r--net/dip/patches/patch-b173
-rw-r--r--net/dip/patches/patch-c41
-rw-r--r--net/dip/pkg/COMMENT1
-rw-r--r--net/dip/pkg/DESCR22
-rw-r--r--net/dip/pkg/PLIST5
8 files changed, 412 insertions, 0 deletions
diff --git a/net/dip/Makefile b/net/dip/Makefile
new file mode 100644
index 00000000000..2ddc77a17ef
--- /dev/null
+++ b/net/dip/Makefile
@@ -0,0 +1,19 @@
+# New ports collection makefile for: bsddip
+# Version required: 1.02
+# Date created: 27 aug 95
+# Whom: joerg
+#
+# $FreeBSD Id: Makefile,v 1.5 1997/04/30 03:18:07 asami Exp
+#
+
+DISTNAME= bsddip-1.02
+CATEGORIES= net
+#
+# the actual master site is almost out of reach for everybody
+#MASTER_SITES= ftp://sun.rz.tu-clausthal.de/pub/bsddip/
+MASTER_SITES+= ${MASTER_SITE_LOCAL}
+EXTRACT_SUFX= .tar.Z
+
+MAINTAINER= joerg@FreeBSD.ORG
+
+.include <bsd.port.mk>
diff --git a/net/dip/files/md5 b/net/dip/files/md5
new file mode 100644
index 00000000000..005b5f40d92
--- /dev/null
+++ b/net/dip/files/md5
@@ -0,0 +1 @@
+MD5 (bsddip-1.02.tar.Z) = 0bd8ad1e01e3cf2ad61b5a6de49c9d51
diff --git a/net/dip/patches/patch-a b/net/dip/patches/patch-a
new file mode 100644
index 00000000000..57d84bf9231
--- /dev/null
+++ b/net/dip/patches/patch-a
@@ -0,0 +1,150 @@
+--- Makefile.orig Sat Jul 1 01:41:05 1995
++++ Makefile Sun Aug 27 23:51:53 1995
+@@ -1,123 +1,38 @@
+-CC = gcc
+-
+-CCFLAG = -O2
+-DBFLAG = -ggdb -Wall
+-LDFLAG = -N -s
+-
++PROG = dip
++PROG1 = diplogin
++LINKS = ${BINDIR}/${PROG} ${BINDIR}/${PROG1}
+ VERSION = 1.01
+
+ BINTGT = dip
+-BINTGT1 = diplogin
+-BINDIR = /sbin/
+-BINGRP = bin
+-BINOWN = bin
+-BINMODE = 555
+-
+-MANSRC = dip.8
+-MANTGT = dip.0
+-MANTGT1 = diplogin.0
+-MANDIR = /usr/share/man/cat8/
+-MANGRP = bin
+-MANOWN = bin
+-MANMODE = 444
++BINDIR = ${PREFIX}/sbin
+
+-SMPDIR = /etc/dip.samples/
++MAN8 = dip.8
++MANDIR = ${PREFIX}/man/man
++MLINKS = dip.8 diplogin.8
++
++SAMPLES = samples/dialout.dip.sample samples/ReadMe.HowTo \
++ samples/sample2.dip samples/diphosts \
++ samples/sample.dip samples/setup.sh.sample \
++ samples/ReadMe samples/sample1.dip \
++ samples/startup.sh.sample
++
++SMPDIR = ${PREFIX}/lib/dip
+ SMPGRP = bin
+ SMPOWN = bin
+-SMPMODE = 755
++SMPMODE = 644
+
+ # OWNSLEEP= -DUSEOWNSLEEP
+
+-OBJS = attach.o command.o config.o daemon.o dip.o login.o modem.o ppp.o\
+- slip.o term.o tty.o
++SRCS = attach.c command.c config.c daemon.c dip.c login.c modem.c ppp.c\
++ slip.c term.c tty.c
+
+ .ifdef (OWNSLEEP)
+-OBJS += sleep.o
+-.endif
+-
+-
+-.SUFFIXES: .0 .1 .2 .3 .4 .5 .6 .7 .8
+-
+-
+-.8.0:
+- @echo "nroff -mandoc $(.IMPSRC) > $(.TARGET)"
+- @nroff -mandoc $(.IMPSRC) > $(.TARGET) || ( rm -f $(.TARGET) ; false )
+-
+-
+-.ifmake (debug)
+-.c.o: dip.h $(.IMPSRC)
+- $(CC) $(OWNSLEEP) $(DBFLAG) -c $(.IMPSRC)
+-.else
+-.c.o: dip.h $(.IMPSRC)
+- $(CC) $(OWNSLEEP) $(CCFLAG) -c $(.IMPSRC)
++SRCS += sleep.c
+ .endif
+
++afterinstall:
++ @if [ ! -d ${SMPDIR} ] ; then mkdir -p ${SMPDIR} ; fi
++ ${INSTALL} -c -o ${SMPOWN} -g ${SMPGRP} -m ${SMPMODE} \
++ ${SAMPLES} ${SMPDIR}
+
+-
+-all: dip
+-
+-
+-install: dip maninstall
+- install -c -s -o$(BINOWN) -g$(BINGRP) -m$(BINMODE) $(BINTGT) $(BINDIR)
+- rm -f $(BINDIR)$(BINTGT1)
+- ln $(BINDIR)$(BINTGT) $(BINDIR)$(BINTGT1)
+-
+-
+-dip: dip.h $(OBJS)
+- $(CC) $(OWNSLEEP) $(CCFLAG) $(LDFLAG) -o $(BINTGT) $(OBJS)
+-
+-
+-debug: dip.h $(OBJS)
+- $(CC) $(OWNSLEEP) $(DBFLAG) -o $(BINTGT) $(OBJS)
+-
+-
+-maninstall: man
+- install -c -o$(MANOWN) -g$(MANGRP) -m$(MANMODE) $(MANTGT) $(MANDIR)
+- rm -f $(MANDIR)$(MANTGT1)
+- ln $(MANDIR)$(MANTGT) $(MANDIR)$(MANTGT1)
+-
+-
+-man: $(MANTGT)
+-
+-
+-samples!
+- @echo Installing sample files in $(SMPDIR)...
+- @if [ -d $(SMPDIR) ] ; then \
+- echo The directory already exists! ; \
+- echo Aborting!!! ; \
+- false ; \
+- fi
+- install -d -o$(BINOWN) -g$(BINGRP) -m$(SMPMODE) $(SMPDIR)
+- install -c -o$(BINOWN) -g$(BINGRP) -m644 ./samples/* $(SMPDIR)
+- install -c -o$(BINOWN) -g$(BINGRP) -m744 ./samples/*.sh.* $(SMPDIR)
+-
+-clean:
+- rm -f $(BINTGT).core $(OBJS)
+-
+-
+-clobber: clean
+- rm -f $(BINTGT) $(MANTGT)
+-
+-
+-uninstall:
+- @if [ -f $(BINDIR)$(BINTGT1) ] ; then \
+- echo Removing $(BINDIR)$(BINTGT1) ; \
+- rm -f $(BINDIR)$(BINTGT1) ; \
+- fi
+- @if [ -f $(BINDIR)$(BINTGT) ] ; then \
+- echo Removing $(BINDIR)$(BINTGT) ; \
+- rm -f $(BINDIR)$(BINTGT) ; \
+- fi
+- @if [ -f $(MANDIR)$(MANTGT1) ] ; then \
+- echo Removing $(MANDIR)$(MANTGT1) ; \
+- rm -f $(MANDIR)$(MANTGT1) ; \
+- fi
+- @if [ -f $(MANDIR)$(MANTGT) ] ; then \
+- echo Removing $(MANDIR)$(MANTGT) ; \
+- rm -f $(MANDIR)$(MANTGT) ; \
+- fi
+- @if [ -d $(SMPDIR) ] ; then \
+- echo '' ; \
+- echo "Please remove $(SMPDIR) (and containing files) yourself!" ; \
+- echo '' ; \
+- fi
++.include <bsd.prog.mk>
diff --git a/net/dip/patches/patch-b b/net/dip/patches/patch-b
new file mode 100644
index 00000000000..e736f6ddf2a
--- /dev/null
+++ b/net/dip/patches/patch-b
@@ -0,0 +1,173 @@
+--- tty.c.orig Sat Jul 1 01:41:05 1995
++++ tty.c Sat Sep 9 08:37:14 1995
+@@ -140,9 +140,10 @@
+ int tty_lock ( char *path, int mode )
+ {
+
++#define MAX_LOCK_ATTEMPTS 3
+ struct passwd *pw;
+-
+- int fd;
++ char number[12], *temp_path;
++ int fd, i, saved_errno;
+
+
+ if ( mode ) /* locking on ? */
+@@ -152,32 +153,71 @@
+ return 0; /* standard input */
+ }
+
+- if ( saved_path != NULL )
++ temp_path = (char*) malloc ( sizeof ( PATH_LOCKD ) +
++ strlen("TMP..") + 10); /* max PID */
++
++ (void) sprintf ( number, "%u", (unsigned)getpid() );
++ (void) strcpy ( temp_path, PATH_LOCKD );
++ (void) strcat ( temp_path, "TMP.." );
++ (void) strcat ( temp_path, number );
++
++ if ( opt_debg )
++ printf ( "DIP: tty: trying to create lock temp file %s\n", temp_path );
++ if ( ( fd = open ( temp_path, O_CREAT|O_TRUNC|O_WRONLY, 0644 ) ) < 0)
+ {
+- free ( saved_path );
+- saved_path = NULL;
++ (void) fprintf ( stderr, "DIP: tty: lock: (%s): %s\n",
++ temp_path, strerror ( errno ) );
++ free(temp_path);
++ return -1;
+ }
+
++ /*
++ * now enter our PID;
++ * Note: the 10 digits + newline are convention and cannot be changed
++ */
++ (void) sprintf ( number, "%10u\n", getpid() );
++ if ( opt_debg )
++ printf ( "DIP: tty: writing \"%10u\" into lock temp file\n", getpid() );
++ if ( write (fd, number, 11) != 11 )
++ {
++ (void) fprintf ( stderr, "DIP: tty: lock write error: %s\n",
++ strerror ( errno ) );
++ free(temp_path);
++ return -1;
++ }
++ (void) close ( fd );
++
++ free ( saved_path ); /* just in case [NB: free(NULL) is legal] */
+ saved_path = (char*) malloc ( sizeof ( PATH_LOCKD ) +
+- strlen ( path ) + 1 );
++ strlen ( path ) + 3 );
+
+ (void) strcpy ( saved_path, PATH_LOCKD );
++ (void) strcat ( saved_path, ".." );
+ (void) strcat ( saved_path, path );
+
+-
+- if ( ( fd = creat ( saved_path, 0644 ) ) < 0)
+- {
+- if ( errno != EEXIST )
++ if ( opt_debg )
++ printf ( "DIP: tty: linking %s to %s\n", temp_path, saved_path );
++ for ( i = 0; i < MAX_LOCK_ATTEMPTS; i++ )
+ {
+- (void) fprintf ( stderr, "DIP: tty: lock: (%s): %s\n",
+- saved_path, strerror ( errno ) );
++ /* now attempt to actually get the lock */
++ if ( link ( temp_path, saved_path ) == 0 )
++ break;
++ sleep(2 * (i + 1));
++ }
++ saved_errno = errno;
++ (void) unlink ( temp_path );
++ free(temp_path);
++
++ if ( i >= MAX_LOCK_ATTEMPTS )
++ {
++ /* did not get it */
++ if ( saved_errno != EEXIST )
++ (void) fprintf ( stderr, "DIP: tty: lock: (%s): %s\n",
++ saved_path, strerror ( saved_errno ) );
++ else if ( opt_debg )
++ printf ( "DIP: tty: lock attempt failed, EEXIST\n" );
++ return -1;
+ }
+-
+- return -1;
+- }
+-
+- (void) close ( fd );
+-
+
+ /*
+ * Make sure UUCP owns the lockfile. Required by some packages.
+@@ -215,7 +255,26 @@
+ return 0;
+ }
+
++/*
++ * Enter daemon's PID into the lock file;
++ * This is icky.
++ */
++void tty_relock ( void )
++{
++ int fd;
++ char number[12];
+
++ if ( saved_path == NULL )
++ return;
++
++ (void) sprintf ( number, "%10u\n", (unsigned)getpid() );
++ if ( opt_debg )
++ printf ( "DIP: tty: rewriting lock file (PID = %u)\n", getpid() );
++ if ( (fd = open ( saved_path, O_WRONLY, 0 )) == -1 )
++ return;
++ (void) write ( fd, number, 11);
++ (void) close ( fd );
++}
+
+ /*
+ * Find a serial speed code in the table.
+@@ -965,7 +1024,6 @@
+ char *sp;
+ char path [ MAXPATHLEN ];
+
+-
+ /*
+ * Try opening the TTY device.
+ */
+@@ -985,8 +1043,10 @@
+ else
+ sp = name;
+
+-
+- if ( ( fd = open ( path, O_RDWR | O_NONBLOCK ) ) < 0 )
++ if ( tty_lock ( sp, 1 ) == -1 )
++ return -1;
++
++ if ( ( fd = open ( path, O_RDWR | O_NONBLOCK | O_EXCL ) ) < 0 )
+ {
+ (void) fprintf ( stderr, "DIP: tty: open(%s, RW): %s\n",
+ path, strerror ( errno ) );
+@@ -1118,10 +1178,4 @@
+ {
+ return 0 ;
+ }
+-
+-
+- /*
+- * OK, all done. Lock this terminal line.
+- */
+- return tty_lock ( sp, 1 );
+ }
+--- daemon.c.orig Sat Jul 1 01:41:05 1995
++++ daemon.c Sat Sep 9 08:20:00 1995
+@@ -168,6 +168,8 @@
+ openlog ( "DIP", LOG_PID, LOG_DAEMON );
+ }
+
++ /* note the race condition here; ick! */
++ tty_relock();
+
+ (void) signal ( SIGALRM, sig_catcher );
+ (void) alarm ( mydip.timeout );
diff --git a/net/dip/patches/patch-c b/net/dip/patches/patch-c
new file mode 100644
index 00000000000..347ed0f67b6
--- /dev/null
+++ b/net/dip/patches/patch-c
@@ -0,0 +1,41 @@
+--- dip.h.orig Fri Jun 30 19:41:05 1995
++++ dip.h Tue Apr 14 18:56:26 1998
+@@ -50,10 +50,23 @@
+ #include <pwd.h>
+ #include <signal.h>
+ #include <sys/socket.h>
++#include <sys/time.h>
+ #include <net/if.h>
++#include <netinet/in.h>
++#ifdef __FreeBSD__
++#if __FreeBSD__ >= 2
++#include <osreldate.h>
++#endif
++#if __FreeBSD_version >= 300000
++#include <net/if_var.h>
++#include <sys/mbuf.h>
++#include <netinet/in_systm.h>
++#include <netinet/ip.h>
++#include <net/slcompress.h>
++#endif
++#endif /*__FreeBSD__*/
+ #include <net/slip.h>
+ #include <net/if_slvar.h>
+-#include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <netdb.h>
+ extern int h_errno;
+@@ -121,7 +133,7 @@
+ /*
+ * Pfad- und Dateinamen-Konstanten
+ */
+-#define PATH_LOCKD "/var/spool/uucp/LCK.."
++#define PATH_LOCKD "/var/spool/lock/LCK"
+ #define PATH_ETC_DIPHOSTS "/etc/diphosts"
+ #define PATH_BIN_IFCONFIG "/sbin/ifconfig"
+ #define PATH_BIN_ROUTE "/sbin/route"
+@@ -231,3 +243,4 @@
+ int tty_flush ( void );
+ int tty_close ( void );
+ int tty_open ( char * );
++void tty_relock ( void );
diff --git a/net/dip/pkg/COMMENT b/net/dip/pkg/COMMENT
new file mode 100644
index 00000000000..592c4a1f0a1
--- /dev/null
+++ b/net/dip/pkg/COMMENT
@@ -0,0 +1 @@
+Dialup IP program
diff --git a/net/dip/pkg/DESCR b/net/dip/pkg/DESCR
new file mode 100644
index 00000000000..cf651cb041e
--- /dev/null
+++ b/net/dip/pkg/DESCR
@@ -0,0 +1,22 @@
+What is DIP?
+
+
+DIP is mainly a tool to establish a SLIP connection. It handles all
+the necessary actions to set up the tty port and the modem, dial out
+and finally build up a SLIP connection between the tty port and the
+kernel. To do so, dip offers an own very simple command language (a
+mostly complete description can be found in the man page).
+
+Dip can handle both incoming and outgoing connections using password
+security for incoming connections.
+
+For more details, have a look at the man page!
+
+Author's comment:
+
+But what I want YOU to do is: Send me a postcard from your city/town.
+My address:
+ Joachim Bartz
+ Burgstaetter Strasse 17
+ 38678 Clausthal-Zellerfeld
+ Germany
diff --git a/net/dip/pkg/PLIST b/net/dip/pkg/PLIST
new file mode 100644
index 00000000000..e5850829730
--- /dev/null
+++ b/net/dip/pkg/PLIST
@@ -0,0 +1,5 @@
+sbin/dip
+sbin/diplogin
+man/man8/dip.8.gz
+man/man8/diplogin.8.gz
+lib/dip