git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

This commit is contained in:
ipfire
2006-02-15 21:15:54 +00:00
parent 6d63f4c4b3
commit cd1a292722
1206 changed files with 185026 additions and 0 deletions

8
src/ppp/CVS/Entries Normal file
View File

@@ -0,0 +1,8 @@
/demonloginscript/1.1.1.1/Tue Nov 27 08:07:59 2001//TIPCOP_v1_4_0
/dialer/1.3.2.2/Wed Jan 26 12:23:26 2005//TIPCOP_v1_4_0
/ioptions/1.1.1.1/Tue Nov 27 08:07:59 2001//TIPCOP_v1_4_0
/ip-down/1.3.2.9/Wed Jan 26 12:23:26 2005//TIPCOP_v1_4_0
/ip-up/1.3.2.3/Wed Jan 26 12:23:26 2005//TIPCOP_v1_4_0
/options/1.1.1.1/Tue Nov 27 08:08:01 2001//TIPCOP_v1_4_0
/standardloginscript/1.1.1.1/Tue Nov 27 08:08:01 2001//TIPCOP_v1_4_0
D

1
src/ppp/CVS/Repository Normal file
View File

@@ -0,0 +1 @@
ipcop/src/ppp

1
src/ppp/CVS/Root Normal file
View File

@@ -0,0 +1 @@
:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ipcop

1
src/ppp/CVS/Tag Normal file
View File

@@ -0,0 +1 @@
TIPCOP_v1_4_0

5
src/ppp/demonloginscript Normal file
View File

@@ -0,0 +1,5 @@
ogin:--ogin: USERNAME
assword: PASSWORD
otocol: '\r'
HELLO '\r'

89
src/ppp/dialer Normal file
View File

@@ -0,0 +1,89 @@
#!/usr/bin/perl
#
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# (c) The SmoothWall Team
#
# $Id: dialer,v 1.3.2.2 2005/01/26 12:23:26 riddles Exp $
#
use strict;
require 'CONFIG_ROOT/general-functions.pl';
my %pppsettings;
my %modemsettings;
&General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
&General::readhash("${General::swroot}/modem/settings", \%modemsettings);
if ($modemsettings{'INIT'} eq '') {
$modemsettings{'INIT'} = 'AT'; }
if ($modemsettings{'HANGUP'} eq '') {
$modemsettings{'HANGUP'} = 'AT'; }
if ($modemsettings{'SPEAKER_ON'} eq '') {
$modemsettings{'SPEAKER_ON'} = 'AT'; }
if ($modemsettings{'SPEAKER_OFF'} eq '') {
$modemsettings{'SPEAKER_OFF'} = 'AT'; }
if ($modemsettings{'TONE_DIAL'} eq '') {
$modemsettings{'TONE_DIAL'} = 'ATD'; }
if ($modemsettings{'PULSE_DIAL'} eq '') {
$modemsettings{'PULSE_DIAL'} = 'ATD'; }
my $telephone = $pppsettings{'TELEPHONE'};
my $username = $pppsettings{'USERNAME'};
my $password = $pppsettings{'PASSWORD'};
my ($loginscript, $speaker, $dial, $btfudge);
if ($pppsettings{'AUTH'} eq 'standard-login-script') {
$loginscript = 'standardloginscript'; }
elsif ($pppsettings{'AUTH'} eq 'demon-login-script') {
$loginscript = 'demonloginscript'; }
else {
$loginscript = $pppsettings{'LOGINSCRIPT'}; }
if ($pppsettings{'SPEAKER'} eq 'on') {
$speaker = $modemsettings{'SPEAKER_ON'}; }
else {
$speaker = $modemsettings{'SPEAKER_OFF'}; }
if ($pppsettings{'DIALMODE'} eq 'T') {
$dial = $modemsettings{'TONE_DIAL'} }
else {
$dial = $modemsettings{'PULSE_DIAL'} }
if ($pppsettings{'SENDCR'} eq 'off') {
$btfudge = '\\c'; }
else {
$btfudge = ''; }
unlink('/var/log/connect.log');
my $com = "/usr/sbin/chat -v -r /var/log/connect.log \
TIMEOUT 3 \
REPORT CONNECT \
ABORT '\\nBUSY\\r' \
ABORT '\\nNO ANSWER\\r' \
ABORT '\\nRINGING\\r\\n\\r\\nRINGING\\r' \
ABORT '\\nNO CARRIER\\r' \
'' '$modemsettings{'INIT'}' \
OK '$modemsettings{'HANGUP'}' \
OK '$speaker' \
TIMEOUT '$modemsettings{'TIMEOUT'}' \
OK '${dial}${telephone}' \
CONNECT '${btfudge}' ";
if ($loginscript)
{
if (open(FILE, "/etc/ppp/${loginscript}"))
{
while (<FILE>) {
$com = "$com $_ "; }
close FILE;
}
$com =~ s/USERNAME/$username/;
$com =~ s/PASSWORD/$password/;
}
$com =~ s/\n//g;
exec $com;

0
src/ppp/ioptions Normal file
View File

33
src/ppp/ip-down Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/perl
#
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# (c) The SmoothWall Team
#
# $Id: ip-down,v 1.3.2.9 2005/01/26 12:23:26 riddles Exp $
#
use strict;
require 'CONFIG_ROOT/general-functions.pl';
&General::log("PPP has gone down on $ARGV[0]");
umask 022;
unlink "${General::swroot}/red/active";
system "/etc/rc.d/rc.updatered";
# Beep when ppp goes up or down. Silence if 'nobeeps' file exists.
if ( ! -e "${General::swroot}/ppp/nobeeps") {
system('/usr/bin/beep','-l 75', '-f 880', '-n', '-l 75', '-f 440');
}
if ( -e "${General::swroot}/red/keepconnected") {
if ( system ('/bin/ps ax | /bin/grep -q "[r]c.connectioncheck reconnect"') ) {
system ('/etc/rc.d/rc.connectioncheck reconnect &');
} else {
&General::log ('rc.connectioncheck reconnect already running');
}
}

58
src/ppp/ip-up Normal file
View File

@@ -0,0 +1,58 @@
#!/usr/bin/perl
#
# SmoothWall CGIs
#
# This code is distributed under the terms of the GPL
#
# (c) The SmoothWall Team
#
# $Id: ip-up,v 1.3.2.3 2005/01/26 12:23:26 riddles Exp $
#
use strict;
require 'CONFIG_ROOT/general-functions.pl';
&General::log("PPP has gone up on $ARGV[0]");
umask 022;
my %pppsettings;
# read vars back from file.
&General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
if ( ( $pppsettings{'TYPE'} eq 'isdn') &&
( $pppsettings{'COMPORT'} eq 'isdn2') &&
( $pppsettings{'USEIBOD'} eq 'off') ) {
system('/usr/sbin/isdnctrl', 'dial', 'ippp1');
}
my $dns = $pppsettings{'DNS'};
my $primarydns = $pppsettings{'DNS1'};
my $secondarydns = $pppsettings{'DNS2'};
if ($dns eq 'Automatic') {
if (!($pppsettings{'TYPE'} =~ /^isdn/))
{
if (open(FILE, ">${General::swroot}/red/dns1")) { print FILE $ENV{'DNS1'}; close FILE; }
if (open(FILE, ">${General::swroot}/red/dns2")) { print FILE $ENV{'DNS2'}; close FILE; }
}
else
{
if (open(FILE, ">${General::swroot}/red/dns1")) { print FILE $ENV{'MS_DNS1'}; close FILE; }
if (open(FILE, ">${General::swroot}/red/dns2")) { print FILE $ENV{'MS_DNS2'}; close FILE; }
}
} else {
if (open(FILE, ">${General::swroot}/red/dns1")) { print FILE $pppsettings{'DNS1'}; close FILE; }
if (open(FILE, ">${General::swroot}/red/dns2")) { print FILE $pppsettings{'DNS2'}; close FILE; }
}
if (open(FILE, ">${General::swroot}/red/iface")) { print FILE $ARGV[0]; close (FILE); }
if (open(FILE, ">${General::swroot}/red/local-ipaddress")) { print FILE $ARGV[3]; close (FILE); }
if (open(FILE, ">${General::swroot}/red/remote-ipaddress")) { print FILE $ARGV[4]; close (FILE); }
system('/bin/touch', "${General::swroot}/red/active");
system('/etc/rc.d/rc.updatered');
# Beep when ppp goes up or down. Silence if 'nobeeps' file exists.
if ( ! -e "${General::swroot}/ppp/nobeeps") {
system "/bin/echo -en '\a' >/dev/console";
}

2
src/ppp/options Normal file
View File

@@ -0,0 +1,2 @@
linkname ipcop
noauth

View File

@@ -0,0 +1,3 @@
ogin:--ogin: USERNAME
assword: PASSWORD