Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Mar 1998 12:22:26 +0000
From:      Brian Somers <brian@Awfulhak.org>
To:        Peter van Heusden <pvh@leftside.wcape.school.za>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Detecting state of PPP 
Message-ID:  <199803071222.MAA10028@awfulhak.org>
In-Reply-To: Your message of "Sat, 05 Mar 1998 07:16:09 %2B0200." <Pine.BSF.3.95.980305071307.15655F-100000@leftside.wcape.school.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
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



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