From owner-freebsd-hackers Sat Mar 7 05:02:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA03158 for freebsd-hackers-outgoing; Sat, 7 Mar 1998 05:02:05 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA03023 for ; Sat, 7 Mar 1998 05:01:57 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.org (8.8.7/8.8.7) with ESMTP id MAA10028; Sat, 7 Mar 1998 12:22:26 GMT (envelope-from brian@gate.lan.awfulhak.org) Message-Id: <199803071222.MAA10028@awfulhak.org> X-Mailer: exmh version 2.0.1 12/23/97 To: Peter van Heusden cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Detecting state of PPP In-reply-to: Your message of "Sat, 05 Mar 1998 07:16:09 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 07 Mar 1998 12:22:26 +0000 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Hi > > How does one go about writing a program to check if a PPP link is up or > down? I'm running PPP in -auto mode, and I'd like to be able to tell > whether the PPP link is actually up (i.e. the modem connection is in > place) at any particular time. Unfortunately, the flags on tun0 stay the > same (0x8051 on my system) whether the modem is connected or not. What > should I be looking at? Wow, what a range of answers. The ifconfig | fgrep UP answer is wrong as ppp -auto will keep the interface UP so that it can detect traffic that'll bring the line up. The correct answer is the one about the PPP prompt (it's mentioned in the pppctl man page). The problem of course is that ppp will only accept one diagnostic connection, so if someone else is already talking to ppp, you get no answer :-| I plan to facilitate ``status'' connections soon. This ``status'' socket will be like a read-only diagnostic socket that pumps out information about the state of ppp periodically. It will allow a configurable number of connections. I'll probably do a little tcl program to show how it works too (but my tcl's not too good). > Thanks, > Peter > -- > Peter van Heusden | Computers Networks Reds Greens Justice Peace Beer Africa > pvh@leftside.wcape.school.za | Support the SAMWU 50 litres campaign! -- Brian , , Don't _EVER_ lose your sense of humour.... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message