From owner-freebsd-hackers Sat Mar 7 03:36:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA25277 for freebsd-hackers-outgoing; Sat, 7 Mar 1998 03:36:29 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from newserv.urc.ac.ru (newserv.urc.ac.ru [193.233.85.48]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA25255 for ; Sat, 7 Mar 1998 03:35:59 -0800 (PST) (envelope-from joy@urc.ac.ru) Received: from urc.ac.ru (y.urc.ac.ru [193.233.85.37]) by newserv.urc.ac.ru (8.8.8/8.8.8) with ESMTP id QAA11526; Sat, 7 Mar 1998 16:34:45 +0500 (ES) (envelope-from joy@urc.ac.ru) Message-ID: <350130D5.AE9B61F4@urc.ac.ru> Date: Sat, 07 Mar 1998 16:34:45 +0500 From: Konstantin Chuguev Organization: South Ural Center of FREEnet X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 3.0-CURRENT i386) MIME-Version: 1.0 To: Zach Heilig CC: freebsd-hackers@FreeBSD.ORG Subject: Re: Detecting state of PPP References: <199803060014.TAA13234@gte.net> <199803070058.RAA24995@usr09.primenet.com> <19980306225654.17589@gaffaneys.com> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Zach Heilig wrote: > > On Sat, Mar 07, 1998 at 12:58:46AM +0000, Terry Lambert wrote: > ... code removed ... > ? Of course, not all of the includes are needed; I ripped this out of an > ? experimental piece of DHCP code. > > After cleaning it up so it will compile, I tried your code. I always get: > tun0: up > > no matter what the actual state is. > Are you running ppp in -auto mode? If so, the tun* interface is always up, no matter, is modem carrier detected or not. IP packets normally go to the tun*, and after that, if the serial line is down, ppp dials etc. So, I don't see a way to detect the PPP connection state better than using pppctl by some script. If you're not using -auto mode, but still need to detect the state of PPP (-ddial, incoming PPP), you can flag the state by creating a file in /etc/ppp/ppp.linkup and /etc/ppp/ppp.linkdown scripts (they don't run in -auto mode). -- Konstantin V. Chuguev. System administrator of Ural Regional Center of FREEnet, Joy@urc.ac.ru Chelyabinsk, Russia. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message