Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Mar 1998 15:15:30 -0000 (GMT)
From:      Duncan Barclay <dmlb@ragnet.demon.co.uk>
To:        Brian Somers <brian@awfulhak.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Detecting state of PPP
Message-ID:  <XFMail.980307151530.dmlb@computer.my.domain>
In-Reply-To: <199803071222.MAA10028@awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 07-Mar-98 Brian Somers wrote:
>> 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).

I'll help here if you want.

Could the status be done a bit like a
"daytime" service; just connect and it pumps out a string on demand and then
closes its end. Or, are you expecting to support a persistant connection
and the consumer just does blocking reads?

Also, can this be made none password protected for simple info? Ahh buts as it
read only this must be true.

Duncan

---
________________________________________________________________________
Duncan Barclay          | God smiles upon the little children,
dmlb@ragnet.demon.co.uk | the alcoholics, and the permanently stoned.
________________________________________________________________________

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.980307151530.dmlb>