aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* make ppp-watch kill leftover dialer more reliablyMichael K. Johnson1999-09-231-1/+21
|
* update man page to document config fileBill Nottingham1999-09-231-2/+24
|
* don't dup stdin.Bill Nottingham1999-09-201-1/+0
|
* tried to add backgrounding at boot timeMichael K. Johnson1999-09-131-1/+21
|
* do not run multiple copiesMichael K. Johnson1999-09-131-0/+27
| | | | setsid/setpgid seems to help...
* report failureMichael K. Johnson1999-09-101-10/+11
|
* do not overload physicalDeviceMichael K. Johnson1999-09-071-11/+17
| | | | sleep only when appropriate
* link staticallyMichael K. Johnson1999-09-071-1/+1
|
* seems to work for basic operationMichael K. Johnson1999-09-071-35/+61
|
* first attempt at integrating ppp-watchMichael K. Johnson1999-09-071-10/+22
|
* first pass at ppp-watchMichael K. Johnson1999-09-064-1/+908
|
* add interactive prompt to make Cristian & Preston happyBill Nottingham1999-09-022-1/+49
|
* I don't remember smoking crack, but I must have been...r4-30Bill Nottingham1999-08-191-12/+6
|
* ignore anything before a ^HBill Nottingham1999-08-102-4/+6
| | | | | ignore twiddles on lines by themselves allow BOL/EOL matching
* added help/usage messagesErik Troan1999-08-101-5/+11
|
* what's that debugging code doing there?Bill Nottingham1999-08-061-2/+0
|
* *** empty log message ***Bill Nottingham1999-07-261-1/+2
|
* - increase buffer from 2K to 8KBill Nottingham1999-07-251-38/+57
| | | | | - add regexp checking - add a usleep() call so we don't read 4000 twiddles from fsck
* install initlog.confBill Nottingham1999-07-251-1/+2
|
* add config file parsing, strip data before a \rBill Nottingham1999-07-251-12/+94
|
* initial checkinBill Nottingham1999-07-251-0/+19
|
* when 'rexec'ing, run initlog as child, not parent.Bill Nottingham1999-07-241-4/+30
| | | | Ignore SIGPIPE when writing to initlog FD.
* oops, logging was broken 'cos we were passing bogus command lineBill Nottingham1999-07-241-2/+3
|
* added --oot optionDonnie Barnes1999-07-221-0/+8
|
* minor nitDonnie Barnes1999-07-221-1/+1
|
* fixed bug oot introduced into my codeDonnie Barnes1999-07-221-6/+9
|
* added missing include <sigh>Erik Troan1999-07-221-0/+2
|
* popt'd usleep (djb made me)Erik Troan1999-07-223-24/+50
|
* fix some compiler warnings (nkbj@image.dk)Bill Nottingham1999-07-084-7/+8
|
* *** empty log message ***Bill Nottingham1999-06-211-0/+2
|
* fix bug in parsing command argumentsBill Nottingham1999-06-211-7/+9
|
* make doexec not segfault if called with no args....Bill Nottingham1999-06-211-0/+1
|
* log by default to LOCAL7Bill Nottingham1999-04-131-1/+1
|
* *** empty log message ***r4-02Bill Nottingham1999-04-091-1/+0
|
* fixeds for the case where /dev/log exists at bootBill Nottingham1999-04-095-18/+33
|
* don't output error messages if reading commandsBill Nottingham1999-03-183-8/+12
|
* gack. don't exit on command format errors from subprocessBill Nottingham1999-03-184-11/+12
|
* if we are 'in initlog' rewrite output so it goes to initlogBill Nottingham1999-03-161-2/+11
|
* *** empty log message ***Bill Nottingham1999-03-161-1/+1
|
* if /dev/log exists on ROFS, that *doesn't* mean syslog is runningBill Nottingham1999-03-161-2/+4
|
* if [ 0 ] don't work in shell. *thwap*Bill Nottingham1999-03-141-1/+0
|
* ack. Must remove debugging code.Bill Nottingham1999-03-101-6/+0
|
* bill is a moron. also, fix ifup-aliases for bash2r3-84Bill Nottingham1999-02-051-3/+3
|
* fix syscall to something lots more portableBill Nottingham1999-02-042-3/+4
|
* add loglevel.c, document LOGLEVEL settingBill Nottingham1999-02-041-0/+26
|
* fixesBill Nottingham1999-02-043-44/+27
|
* bugfixes...Bill Nottingham1999-02-042-1/+1
|
* *** empty log message ***Bill Nottingham1999-02-031-10/+4
|
* *** empty log message ***Bill Nottingham1999-02-031-1/+1
|
* add initlog stuff. do "halt -p", "umount -f" in shutdown. use %defattr inBill Nottingham1999-02-037-9/+792
| | | | specfile... um, I think that's it.
;([^"]+)"/, $1) } cat_("$::prefix/$_") if !$login && -r "$::prefix/$_"; } my $passwd = passwd_by_login($login); if (!$netc->{vpi} && !$netc->{vci} && member($o_adsl_modem, qw(eci speedtouch))) { ($netc->{vpi}, $netc->{vci}) = (map { if_(/^.*-vpi\s+(\d+)\s+-vci\s+(\d+)/, map { sprintf("%x", $_) } $1, $2) } cat_("$::prefix/etc/ppp/peers/ppp0")); } $pppoe_conf{DNS1} ||= ''; $pppoe_conf{DNS2} ||= ''; add2hash($netc, { dnsServer2 => $pppoe_conf{DNS1}, dnsServer3 => $pppoe_conf{DNS2}, DOMAINNAME2 => '' }); add2hash($adsl, { login => $login, passwd => $passwd, passwd2 => '' }); } sub adsl_detect() { my $adsl = {}; require detect_devices; ($adsl->{bewan}) = detect_devices::getBewan(); ($adsl->{speedtouch}) = detect_devices::getSpeedtouch(); ($adsl->{sagem}) = detect_devices::getSagem(); ($adsl->{eci}) = detect_devices::getECI(); return $adsl; } sub sagem_set_parameters { my ($netc) = @_; my %l = map { $_ => sprintf("%08s", $netc->{$_}) } qw(vci vpi Encapsulation); foreach my $cfg_file (qw(/etc/analog/adiusbadsl.conf /etc/eagle-usb/eagle-usb.conf)) { substInFile { s/VCI=.*\n/VCI=$l{vci}\n/; s/VPI=.*\n/VPI=$l{vpi}\n/; s/Encapsulation=.*\n/Encapsulation=$l{Encapsulation}\n/; s/STATIC_IP=.*\n//; s!</eaglectrl>!STATIC_IP=$netc->{static_ip}\n</eaglectrl>! if $netc->{static_ip}; } "$::prefix$cfg_file"; } } sub adsl_conf_backend { my ($in, $modules_conf, $adsl, $netc, $intf, $adsl_device, $adsl_type, $o_netcnx) = @_; # FIXME: should not be needed: defined $o_netcnx and $netc->{adsltype} = $o_netcnx->{type}; $netc->{adsltype} ||= "adsl_$adsl_type"; $adsl_type eq 'pptp' and $adsl_device = 'pptp_modem'; $adsl_type eq 'capi' and $adsl_device = 'capi_modem'; my $bewan_module; $bewan_module = $o_netcnx->{bus} eq 'PCI' ? 'unicorn_pci_atm' : 'unicorn_usb_atm' if $adsl_device eq "bewan"; # all supported modems came with their own pppoa module, so no need for "plugin pppoatm.so" my %modems = ( bewan => { start => qq( modprobe pppoatm # ActivationMode=1 modprobe $bewan_module # wait for the modem to be set up: sleep 10 ), stop => qq(modprobe -r $bewan_module), plugin => { pppoa => "pppoatm.so $netc->{vpi}." . hex($netc->{vci}) }, ppp_options => qq( lock ipparam ppp0 default-asyncmap hide-password noaccomp nobsdcomp nodeflate novj novjccomp lcp-echo-interval 20 lcp-echo-failure 3 mtu 1200 mru 1200 sync ), }, speedtouch => { modules => [ qw(speedtch) ], #- will not call pppd since we've just written ONBOOT=no, only runs modem_run start => '/usr/bin/speedtouch-start --boot', overide_script => 1, server => { pppoa => qq("/usr/sbin/pppoa3 -c") }, plugin => { pppoa => "pppoatm.so " . join('.', hex($netc->{vpi}), hex($netc->{vci})), }, ppp_options => qq( sync noaccomp), aliases => [ ['char-major-108', 'ppp_generic'], ['tty-ldisc-3', 'ppp_async'], ['tty-ldisc-13', 'n_hdlc'], ['tty-ldisc-14', 'ppp_synctty'], ['ppp-compress-21', 'bsd_comp'], ['ppp-compress-24', 'ppp_deflate'], ['ppp-compress-26', 'ppp_deflate'] ], }, sagem => { modules => [ qw(eagle-usb) ], start => '/usr/sbin/eaglectrl -d', stop => "/usr/bin/killall pppoa", get_intf => "/usr/sbin/eaglectrl -i", server => { pppoa => q("/usr/sbin/fctStartAdsl -t 1 -i"), }, ppp_options => qq( mru 1492 mtu 1492 nobsdcomp nodeflate noaccomp -am novjccomp), aliases => [ ['char-major-108', 'ppp_generic'], ['tty-ldisc-3', 'ppp_async'], ['tty-ldisc-13', 'n_hdlc'], ['tty-ldisc-14', 'ppp_synctty'] ], }, eci => { start => '/usr/bin/startmodem', server => { pppoe => qq("/usr/bin/pppoeci -v 1 -vpi $netc->{vpi} -vci $netc->{vci}"), }, ppp_options => qq( noipdefault sync noaccomp linkname eciadsl noauth lcp-echo-interval 0) }, pptp_modem => { server => { pptp => qq("/usr/sbin/pptp 10.0.0.138 --nolaunchpppd"), }, }, capi_modem => { ppp_options => qq( connect /bin/true ipcp-accept-remote ipcp-accept-local sync noauth lcp-echo-interval 5 lcp-echo-failure 3 lcp-max-configure 50 lcp-max-terminate 2 noccp noipx mru 1492 mtu 1492), plugin => { capi => qq(capiplugin.so avmadsl) }, }, ); if ($adsl_type =~ /^pp|^capi$/) { mkdir_p("$::prefix/etc/ppp"); $in->do_pkgs->install('ppp') if !$>; my %packages = ( pppoa => [ qw(ppp-pppoatm) ], pppoe => [ qw(ppp-pppoe rp-pppoe) ], pptp => [ qw(pptp-linux) ], capi => [ qw(isdn4k-utils) ], #- capi4linux service ); $in->do_pkgs->install(@{$packages{$adsl_type}}) if !$>; output("$::prefix/etc/ppp/options", $adsl_device eq "bewan" ? qq(lock ipparam ppp0 noipdefault noauth default-asyncmap defaultroute hide-password noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp lcp-echo-interval 20 lcp-echo-failure 3 mtu 1200 mru 1200 sync persist user $adsl->{login} name $adsl->{login} usepeerdns ) : qq(lock noipdefault persist noauth usepeerdns defaultroute) ); my $pty_option = $modems{$adsl_device}{server}{$adsl_type} && "pty $modems{$adsl_device}{server}{$adsl_type}"; my $plugin = $modems{$adsl_device}{plugin}{$adsl_type} && "plugin $modems{$adsl_device}{plugin}{$adsl_type}"; my $noipdefault = $adsl_type eq 'pptp' ? '' : 'noipdefault'; output("$::prefix/etc/ppp/peers/ppp0", qq(noauth $noipdefault $modems{$adsl_device}{ppp_options} kdebug 1 nopcomp noccp novj holdoff 4 maxfail 25 persist usepeerdns defaultroute $pty_option $plugin user "$adsl->{login}" )); write_secret_backend($adsl->{login}, $adsl->{passwd}); if ($netc->{NET_DEVICE} =~ /^eth/) { my $net_device = $netc->{NET_DEVICE}; $intf->{$net_device} = { DEVICE => $net_device, BOOTPROTO => 'none', NETMASK => '255.255.255.0', NETWORK => '10.0.0.0', BROADCAST => '10.0.0.255', ONBOOT => 'yes', }; } if ($adsl_type eq 'pppoe') { if (-f "$::prefix/etc/ppp/pppoe.conf") { my $net_device = $modems{$adsl_device}{get_intf} ? "`$modems{$adsl_device}{get_intf}`" : $netc->{NET_DEVICE}; substInFile { s/ETH=.*\n/ETH=$net_device\n/; s/USER=.*\n/USER=$adsl->{login}\n/; s/DNS1=.*\n/DNS1=$netc->{dnsServer2}\n/; s/DNS2=.*\n/DNS2=$netc->{dnsServer3}\n/; } "$::prefix/etc/ppp/pppoe.conf"; } else { log::l("can not find pppoe.conf, make sure the rp-pppoe package is installed"); } } # pppoe => { # # we do not call directly pppd, rp-pppoe take care of "plugin rp-pppoe.so" peers option and the like # connect => "LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /usr/sbin/adsl-start", # disconnect => qq(/usr/sbin/adsl-stop # /usr/bin/killall pppoe pppd\n), # }, } #- FIXME: #- ppp0 and ippp0 are hardcoded my $kind = $adsl_type eq 'pppoe' ? 'xDSL' : 'ADSL'; my $metric = network::tools::get_default_metric("adsl"); #- FIXME, do not override if already set output_with_perm("$::prefix/etc/sysconfig/network-scripts/ifcfg-ppp0", 0705, qq(DEVICE=ppp0 ONBOOT=no TYPE=$kind METRIC=$metric )) unless member($adsl_type, qw(manual dhcp)); #- remove file used with sagem for dhcp/static connections unlink("$::prefix/etc/sysconfig/network-scripts/ifcfg-sagem"); #- set vpi, vci and encapsulation parameters for sagem if ($adsl_device eq 'sagem') { $netc->{static_ip} = $intf->{sagem}{IPADDR} if $adsl_type eq 'manual'; sagem_set_parameters($netc); } #- set aliases if (exists $modems{$adsl_device}{aliases}) { $modules_conf->set_alias($_->[0], $_->[1]) foreach @{$modems{$adsl_device}{aliases}}; $::isStandalone and $modules_conf->write; } #- remove the "speedtch off" alias that was written by Mandrakelinux 10.0 $adsl_device eq 'speedtouch' and $modules_conf->remove_alias('speedtch'); if ($adsl_type eq "capi") { require network::isdn; network::isdn::setup_capi_conf($adsl->{capi}); services::stop("isdn4linux"); services::do_not_start_service_on_boot("isdn4linux"); services::start_service_on_boot("capi4linux"); services::start("capi4linux"); #- install and run drdsl for dsl connections, once capi driver is loaded $in->do_pkgs->ensure_is_installed_if_available("drdsl", "/usr/sbin/drdsl"); run_program::rooted($::prefix, "/usr/sbin/drdsl"); } #- load modules and run modem-specific start programs #- useful during install, or in case the packages have been installed after the device has been plugged my @modules = (@{$modems{$adsl_device}{modules}}, map { $_->[1] } @{$modems{$adsl_device}{aliases}}); @modules or @modules = qw(ppp_synctty ppp_async ppp_generic n_hdlc); #- required for pppoe/pptp connections @modules && eval { modules::load(@modules) } or log::l("failed to load " . join(',', @modules), " modules: $@"); $modems{$adsl_device}{start} and run_program::rooted($::prefix, $modems{$adsl_device}{start}); } 1;