summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonny Davies <woodchip@gentoo.org>2002-04-02 18:30:58 +0000
committerDonny Davies <woodchip@gentoo.org>2002-04-02 18:30:58 +0000
commit939bb89174a7c3cf5184a3557218e27a50f91566 (patch)
tree7aa526aa890ea24b47e061e430b64795ce957532 /net-dialup/diald
parent1.8.11 (diff)
downloadgentoo-2-939bb89174a7c3cf5184a3557218e27a50f91566.tar.gz
gentoo-2-939bb89174a7c3cf5184a3557218e27a50f91566.tar.bz2
gentoo-2-939bb89174a7c3cf5184a3557218e27a50f91566.zip
new package
Diffstat (limited to 'net-dialup/diald')
-rw-r--r--net-dialup/diald/diald-1.0.ebuild58
-rw-r--r--net-dialup/diald/files/diald-1.0-c-files.patch11
-rw-r--r--net-dialup/diald/files/diald-1.0-gentoo.patch60
-rw-r--r--net-dialup/diald/files/diald-init30
-rw-r--r--net-dialup/diald/files/diald.conf38
-rw-r--r--net-dialup/diald/files/diald.filter138
-rw-r--r--net-dialup/diald/files/digest-diald-1.01
7 files changed, 336 insertions, 0 deletions
diff --git a/net-dialup/diald/diald-1.0.ebuild b/net-dialup/diald/diald-1.0.ebuild
new file mode 100644
index 000000000000..4dac25e26a77
--- /dev/null
+++ b/net-dialup/diald/diald-1.0.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Maintainer: Donny Davies <woodchip@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/diald/diald-1.0.ebuild,v 1.1 2002/04/02 18:30:58 woodchip Exp $
+
+# You need SLIP in your kernel to run diald.
+
+DESCRIPTION="Daemon that provides on demand IP links via SLIP or PPP"
+HOMEPAGE="http://diald.sourceforge.net"
+SRC_URI="http://prdownloads.sourceforge.net/${PN}/${P}.tar.gz"
+S=${WORKDIR}/${P}
+
+DEPEND="virtual/glibc sys-libs/pam sys-apps/tcp-wrappers"
+RDEPEND="${DEPEND} net-dialup/ppp"
+
+src_unpack() {
+ unpack ${A} ; cd ${S}
+ patch -p0 < ${FILESDIR}/${P}-c-files.patch || die
+ patch -p0 < ${FILESDIR}/${P}-gentoo.patch || die
+}
+
+src_compile() {
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/share/man \
+ --host=${CHOST} || die "bad ./configure"
+
+ emake || die "compile problem"
+}
+
+src_install() {
+ dodir /etc/pam.d
+ make \
+ DESTDIR=${D} \
+ sysconfdir=/etc \
+ bindir=/usr/bin \
+ sbindir=/usr/sbin \
+ mandir=/usr/share/man \
+ libdir=/usr/lib/diald \
+ BINGRP=root \
+ ROOTUID=root \
+ ROOTGRP=root \
+ install || die
+
+ dodir /var/cache/diald
+ mknod -m 0660 ${D}/var/cache/diald/diald.ctl p
+
+ dodoc BUGS CHANGES LICENSE NOTES README* \
+ THANKS TODO TODO.budget doc/diald-faq.txt
+ docinto setup ; cp -a setup/* ${D}/usr/share/doc/${PF}/setup
+ docinto contrib ; cp -a contrib/* ${D}/usr/share/doc/${PF}/contrib
+ prepalldocs
+
+ insinto /etc/diald ; doins ${FILESDIR}/{diald.conf,diald.filter}
+ exeinto /etc/init.d ; newexe ${FILESDIR}/diald-init diald
+}
diff --git a/net-dialup/diald/files/diald-1.0-c-files.patch b/net-dialup/diald/files/diald-1.0-c-files.patch
new file mode 100644
index 000000000000..6a7b276e24d2
--- /dev/null
+++ b/net-dialup/diald/files/diald-1.0-c-files.patch
@@ -0,0 +1,11 @@
+--- firewall.c Fri Feb 25 18:03:53 2000
++++ firewall.c-florin Wed Mar 28 14:37:57 2001
+@@ -65,7 +65,7 @@
+ #if 0
+ mon_syslog(LOG_DEBUG,"slot def: %d %d %x %x %x",
+ slot->start, slot->end, slot->wday, slot->mday, slot->month);
+-#endif 0
++#endif
+ if ((slot->start <= ctime)
+ && (ctime <= slot->end)
+ && (slot->wday & (1<<ltime->tm_wday))
diff --git a/net-dialup/diald/files/diald-1.0-gentoo.patch b/net-dialup/diald/files/diald-1.0-gentoo.patch
new file mode 100644
index 000000000000..c4d78b788dfe
--- /dev/null
+++ b/net-dialup/diald/files/diald-1.0-gentoo.patch
@@ -0,0 +1,60 @@
+--- diald.h.mdk Wed Oct 3 16:46:54 2001
++++ diald.h Wed Oct 3 16:47:13 2001
+@@ -11,6 +11,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
++# include <time.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+--- Makefile.in.mdk Sat Jun 16 13:16:04 2001
++++ Makefile.in Wed Oct 3 18:36:43 2001
+@@ -21,9 +21,13 @@
+ mandir = @mandir@
+
+
++ROOTUID = root
++ROOTGRP = root
++BINGRP = bin
++
+ CC = @CC@
+ CFLAGS = @CFLAGS@ @DEFS@ -I$(srcdir) \
+- -DDIALD_CONFIG_FILE=\"@sysconfdir@/diald.conf\" \
++ -DDIALD_CONFIG_FILE=\"@sysconfdir@/diald/diald.conf\" \
+ -DDIALD_DEFS_FILE=\"@libdir@/diald/diald.defs\" \
+ -DRUN_PREFIX=\"@localstatedir@/run\"
+ INSTALL = @INSTALL@
+@@ -51,21 +55,21 @@
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) -m 0755 bin/dctrl $(DESTDIR)$(bindir)/dctrl
+ $(INSTALL) -d $(DESTDIR)$(sbindir)
+- $(INSTALL) -s -o root -g bin diald $(DESTDIR)$(sbindir)/diald
++ $(INSTALL) -s -o $(ROOTUID) -g $(BINGRP) diald $(DESTDIR)$(sbindir)/diald
+ $(INSTALL) -d $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 \
+ $(DESTDIR)$(mandir)/man8
+- $(INSTALL) -o root -g bin -m 0644 doc/diald.man $(DESTDIR)$(mandir)/man8/diald.8
+- $(INSTALL) -o root -g bin -m 0644 doc/dctrl.man $(DESTDIR)$(mandir)/man1/dctrl.1
+- $(INSTALL) -o root -g bin -m 0644 doc/diald-examples.man $(DESTDIR)$(mandir)/man5/diald-examples.5
+- $(INSTALL) -o root -g bin -m 0644 doc/diald-control.man $(DESTDIR)$(mandir)/man5/diald-control.5
+- $(INSTALL) -o root -g bin -m 0644 doc/diald-monitor.man $(DESTDIR)$(mandir)/man5/diald-monitor.5
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 doc/diald.man $(DESTDIR)$(mandir)/man8/diald.8
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 doc/dctrl.man $(DESTDIR)$(mandir)/man1/dctrl.1
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 doc/diald-examples.man $(DESTDIR)$(mandir)/man5/diald-examples.5
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 doc/diald-control.man $(DESTDIR)$(mandir)/man5/diald-control.5
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 doc/diald-monitor.man $(DESTDIR)$(mandir)/man5/diald-monitor.5
+ -mkdir -p $(DESTDIR)$(libdir)
+- $(INSTALL) -o root -g bin lib/*.gif $(DESTDIR)$(libdir)
+- $(INSTALL) -o root -g bin -m 0644 config/diald.defs $(DESTDIR)$(libdir)/diald.defs
+- $(INSTALL) -o root -g bin -m 0644 config/standard.filter $(DESTDIR)$(libdir)/standard.filter
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) lib/*.gif $(DESTDIR)$(libdir)
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 config/diald.defs $(DESTDIR)$(libdir)/diald.defs
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) -m 0644 config/standard.filter $(DESTDIR)$(libdir)/standard.filter
+ $(INSTALL) -d -m 0755 $(DESTDIR)/etc/pam.d
+- $(INSTALL) -o root -g root -m 0644 config/diald.pam $(DESTDIR)/$(sysconfdir)/pam.d/diald
+- $(INSTALL) -o root -g bin bin/connect $(DESTDIR)$(libdir)/connect
++ $(INSTALL) -o $(ROOTUID) -g $(ROOTGRP) -m 0644 config/diald.pam $(DESTDIR)/$(sysconfdir)/pam.d/diald
++ $(INSTALL) -o $(ROOTUID) -g $(BINGRP) bin/connect $(DESTDIR)$(libdir)/connect
+
+ clean:
+ rm -f *.o diald
diff --git a/net-dialup/diald/files/diald-init b/net-dialup/diald/files/diald-init
new file mode 100644
index 000000000000..d1f1930e3bf1
--- /dev/null
+++ b/net-dialup/diald/files/diald-init
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/diald/files/diald-init,v 1.1 2002/04/02 18:30:58 woodchip Exp $
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -e /etc/diald/diald.conf ] ; then
+ eerror "You need an /etc/diald/diald.conf file first"
+ eerror "There is a sample in /usr/share/doc/diald"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting diald"
+ start-stop-daemon --start --quiet --exec /usr/sbin/diald \
+ -- -f /etc/diald/diald.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping diald"
+ start-stop-daemon --stop --quiet --pidfile /var/run/diald.pid
+ eend $?
+}
diff --git a/net-dialup/diald/files/diald.conf b/net-dialup/diald/files/diald.conf
new file mode 100644
index 000000000000..9bbda2aa59a4
--- /dev/null
+++ b/net-dialup/diald/files/diald.conf
@@ -0,0 +1,38 @@
+# sample diald.conf
+
+# if Internet Access Type is modem
+# ---------begin-section----------
+mode ppp
+connect "/usr/sbin/chat -v -f /etc/network-scripts/chat-ppp0"
+device /dev/modem
+speed 115200
+modem
+lock
+crtscts
+# ---------end-section------------
+#
+
+# if Internet Access Type is ISDN
+# ---------begin-section----------
+# mode dev
+# connect "/bin/sh /etc/network-scripts/net_cnx_up"
+# disconnect "/bin/sh /etc/network-scripts/net_cnx_down"
+# device ippp0
+# ---------end-section------------
+
+local 10.0.0.2
+remote 10.0.0.3
+dynamic
+defaultroute
+connect-timeout 90
+redial-timeout 10
+retry-count 3
+include /etc/diald/diald.filter
+fifo /var/cache/diald/diald.ctl
+#
+# you can start any script when interface up or down
+# sample with bastille
+# ---------begin-section----------
+#ip-up /sbin/bastille-firewall-reset
+#ip-down /sbin/bastille-firewall-reset
+# ---------end-section------------
diff --git a/net-dialup/diald/files/diald.filter b/net-dialup/diald/files/diald.filter
new file mode 100644
index 000000000000..461e4f7d5be2
--- /dev/null
+++ b/net-dialup/diald/files/diald.filter
@@ -0,0 +1,138 @@
+# sample diald.filter
+#
+# connect policy during office hours on weekdays
+restrict 8:00:00 17:59:59 1-5 * *
+
+# connect policy outside office hours on weekdays
+#restrict * 7:59:59 1-5 * *
+#or-restrict 18:00:00 * 1-5 * *
+
+# connect policy during the weekend
+#restrict * * 0,6 * *
+
+# always connected
+up
+
+# always down
+# down
+
+
+#------------------------------------------------------------------------------
+# Rules for TCP packets.
+#------------------------------------------------------------------------------
+
+# If we force the line up (for example to trigger fetchmail)
+# but no packets are sent, specify how long to hold the line
+# up:
+# here :everything else gets 30 minutes.
+
+first-packet-timeout 30
+
+# The first rule is designed to give the link 30 seconds up time
+# when we are initiating a TCP connection. The idea here is to deal
+# with possibility that the network on the opposite end of the
+# connection is unreachable. In this case you don't really want to
+# give the link 10 minutes up time. With the rule below we only give
+# the link 30 seconds initially. If the network is reachable then
+# we will normally get a response that actually contains some data
+# within 30 seconds. If this causes problems because you have a
+# slow response time at some site you want to regularly access, you
+# can either increase the timeout or remove this rule.
+
+accept tcp 30 tcp.syn
+
+# If you are running named, then it will send data across the link
+# periodically to synchronize against other domain name servers.
+# Since this can happen at any time, it is undesirable to keep the
+# link up for it. Therefore, we ignore any tcp traffic from or to a
+# domain name server.
+
+ignore tcp tcp.dest=tcp.domain
+ignore tcp tcp.source=tcp.domain
+
+# Normally the packet that starts a connection is longer that 40
+# bytes, since it normally contains TCP options to specify the MSS.
+# However, some TCP implementations don't include these options.
+# Therefore, we must be careful not to ignore SYN packets that are
+# only 40 bytes long.
+
+accept tcp 30 ip.tot_len=40,tcp.syn
+
+# Otherwise, we want to ignore any TCP packet that is only 40 bytes
+# long, since it is not carrying any data. However, we don't want to
+# ignore 40 byte packets that mark the closing of a connection,
+# since we use those to cut short the timeout on connections that
+# have died. Therefore we must test the tcp.live flag here. If it
+# is not set we might want to see this packet later on in the rules.
+
+ignore tcp ip.tot_len=40,tcp.live
+
+# Make sure http transfers hold the link up, even after they end.
+# This prevents web browsers from bouncing the connection too much.
+#
+# HTTP transfers get 3 minutes
+accept tcp 180 tcp.dest=tcp.www
+accept tcp 180 tcp.source=tcp.www
+
+
+# Once the link is no longer live, we try to shut down the
+# connection quickly. Note that if the link is already down, the
+# closing of the a connection (which will generate traffic) will not
+# bring it back up.
+
+# here :everything else gets 30 minutes.
+keepup tcp 30 !tcp.live
+ignore tcp !tcp.live
+
+# Finally, if we don't match the TCP packet somewhere above, then we
+# give the link 10 minutes up time. Most TCP packets match this
+# rule. Note that as soon as the TCP connection is closed, the keepup
+# rule above overwrites the timeout.
+
+accept tcp 600 any
+
+#------------------------------------------------------------------------------
+# Rules for UDP packets
+#------------------------------------------------------------------------------
+
+# Don't bring the link up for rwho:
+
+ignore udp udp.dest=udp.who
+ignore udp udp.source=udp.who
+
+# Don't bring the link up for routing packets:
+
+ignore udp udp.dest=udp.router
+ignore udp udp.source=udp.router
+
+# Don't bring the link up for NTP or timed:
+
+ignore udp udp.dest=udp.ntp
+ignore udp udp.source=udp.ntp
+ignore udp udp.dest=udp.timed
+ignore udp udp.source=udp.timed
+
+# Don't bring up on domain name requests between two running copies of named:
+
+ignore udp udp.dest=udp.domain,udp.source=udp.domain
+
+# Bring up the network for domain requests:
+
+accept udp 30 udp.dest=udp.domain
+accept udp 30 udp.source=udp.domain
+
+# Bring up the network for netbios requests, except between netbios servers:
+
+ignore udp udp.source=udp.netbios-ns,udp.dest=udp.netbios-ns
+accept udp 30 udp.dest=udp.netbios-ns
+accept udp 30 udp.source=udp.netbios-ns
+
+# Any other UDP packets:
+
+# here :everything else gets 30 minutes.
+accept udp 30 any
+
+# Catch any packets that we didn't catch above:
+
+# here :everything else gets 30 minutes.
+accept any 30 any
diff --git a/net-dialup/diald/files/digest-diald-1.0 b/net-dialup/diald/files/digest-diald-1.0
new file mode 100644
index 000000000000..f37ec4f53c3f
--- /dev/null
+++ b/net-dialup/diald/files/digest-diald-1.0
@@ -0,0 +1 @@
+MD5 84a5aa3b8d1f12dd9e77f2b43b3d159a diald-1.0.tar.gz 199698