From owner-freebsd-hackers Sat Mar 7 10:10:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA01341 for freebsd-hackers-outgoing; Sat, 7 Mar 1998 10:10:39 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from post.mail.demon.net (post-10.mail.demon.net [193.195.0.154]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA01328 for ; Sat, 7 Mar 1998 10:10:31 -0800 (PST) (envelope-from dmlb@ragnet.demon.co.uk) Received: from ragnet.demon.co.uk ([158.152.46.40]) by post.mail.demon.net id aa1016196; 7 Mar 98 18:00 GMT Received: from dmlb by ragnet.demon.co.uk with local (Exim 1.73 #1) id 0yBLJz-0000Lo-00; Sat, 7 Mar 1998 15:15:31 +0000 Message-ID: X-Mailer: XFMail 1.2 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199803071222.MAA10028@awfulhak.org> Date: Sat, 07 Mar 1998 15:15:30 -0000 (GMT) From: Duncan Barclay To: Brian Somers Subject: Re: Detecting state of PPP Cc: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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