netreport was Re: Interface status detection

1999-12-22 Thread Muli B.Y.
Matan Ziv-Av wrote: > > In Mandrake (I don't know if on RH as well), there > is a /var/run/netreport directory where you can write the pid of your > program, and it will be sent a SIGIO whenever a network event (device > up/down) occurs. Too cool! Now let's see if it actually works as advertised

Re: Interface status detection

1999-12-22 Thread Adam Morrison
> True. It's a bug. KDE fires up licq automatically so I have never > noticed this bug. Now how do we fix it (without checking for a process > named 'licq' or anything like that. How do you make sure a fifo has > someone on the other end?) OPEN(2) Linux Programmer's Manual

Re: Interface status detection

1999-12-21 Thread Matan Ziv-Av
> True. It's a bug. KDE fires up licq automatically so I have never > noticed this bug. Now how do we fix it (without checking for a process > named 'licq' or anything like that. How do you make sure a fifo has > someone on the other end?) Mandrake and Redhat network scripts write a file /var/ru

Re: Interface status detection

1999-12-21 Thread Nimrod Mesika
Gaal Yahas wrote: > > On Mon, Dec 20, 1999 at 11:47:14PM +0200, Nimrod Mesika wrote: > > > > nimrodm:~$ cat /etc/ppp/ip-up.local > What happens when licq isn't running and reading the pipe? > Unless I'm mistaken, your ip-*.local scripts would block, which > is probably not what you want. True. I

Re: Interface status detection

1999-12-21 Thread Nimrod Mesika
"Muli B.Y." wrote: > > Thanks for the suggestions, Nimrod, I have implemented the > online/offline thing this way. Shame on me for not having read the FAQ > (where this stuff is mentioned) for quite some time. > > Nevertheless, it was a good excersize and my original question stands: > Windows h

Re: Interface status detection

1999-12-21 Thread Gaal Yahas
On Mon, Dec 20, 1999 at 11:47:14PM +0200, Nimrod Mesika wrote: > > nimrodm:~$ cat /etc/ppp/ip-up.local > #!/bin/sh > echo 'status online' >/home/nimrodm/.licq/licq_fifo > nimrodm:~$ > > nimrodm:~$ cat /etc/ppp/ip-down.local > #!/bin/sh > echo 'status off

Re: Interface status detection

1999-12-21 Thread Nimrod Zimerman
On Tue, Dec 21, 1999 at 04:17:17PM +0200, Muli B.Y. wrote: > Thanks for the suggestions, Nimrod, I have implemented the > online/offline thing this way. Shame on me for not having read the FAQ > (where this stuff is mentioned) for quite some time. > Nevertheless, it was a good excersize and my

Re: Interface status detection

1999-12-21 Thread Muli B.Y.
At the risk of being slightly off topic, I will: You can find Todd Anderson's Monitoring Dial-Up Network Connections on the Nov. 1999 Windows Developer's Journal. http://www.wdj.com/archive/1011/feature.html (Note- Yes, I read Windows Developer's Journal. You can't compare it to Dr. Dobb's Journa

Re: Interface status detection

1999-12-21 Thread Oleg Goldshmidt
"Muli B.Y." <[EMAIL PROTECTED]> writes: > Windows has RasConnectionNotification(). What does linux have except > constant polling? Sorry for my ignorance, but can you explain to this unixoid how RasConnectionNotification() is implemented? -- Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | [EMAIL PR

Re: Interface status detection

1999-12-21 Thread Muli B.Y.
Thanks for the suggestions, Nimrod, I have implemented the online/offline thing this way. Shame on me for not having read the FAQ (where this stuff is mentioned) for quite some time. Nevertheless, it was a good excersize and my original question stands: Windows has RasConnectionNotification(). W

Re: Interface status detection

1999-12-20 Thread Alex Shnitman
On Mon, Dec 20, 1999 at 11:47:14PM +0200, Nimrod Mesika wrote: > > As to your first suggestion, maybe there's even a better way -- have > > licq install signal handlers for e.g. SIGUSR1 and SIGUSR2, switching > > it online in the former and offline in the latter, and then have the > > ip-up scrip

Re: Interface status detection

1999-12-20 Thread Nimrod Mesika
Alex Shnitman wrote: > As to your first suggestion, maybe there's even a better way -- have > licq install signal handlers for e.g. SIGUSR1 and SIGUSR2, switching > it online in the former and offline in the latter, and then have the > ip-up script killall -USR1 licq and the ip-down script killal

Re: Interface status detection

1999-12-20 Thread Alex Shnitman
On Mon, Dec 20, 1999 at 10:05:16PM +0200, Matan Ziv-Av wrote: > Why don't you touch some file in the ip-up script, and have you program > select on that file? > > I hope you don't use ethernet status as an indication of internet > connection, since ethernet interfaces are usually up, whether you

Re: Interface status detection

1999-12-20 Thread Matan Ziv-Av
Why don't you touch some file in the ip-up script, and have you program select on that file? I hope you don't use ethernet status as an indication of internet connection, since ethernet interfaces are usually up, whether you are connected to the rest of the internet or not. -- Matan Ziv-Av

Re: Interface status detection

1999-12-20 Thread Oleg Goldshmidt
"Muli B.Y." <[EMAIL PROTECTED]> writes: > The minimal time resolution I'm talking about here is less than a > second, and the optimal is instantaneous. What for? > int main() > { > while (1) > { > sleep(1) > do_some_quick_stuff(); > } > retur

Re: Interface status detection

1999-12-20 Thread Muli B.Y.
Oleg Goldshmidt wrote: > > "Muli B.Y." <[EMAIL PROTECTED]> writes: > > > I have written a small utility, ifup, which will tell you if any network > > interface is up or down (connected or disconnected). > > Can you explain what it does? I mean, is it a wrapper around ifconfig(8) > or netstat(8)

Re: Interface status detection

1999-12-20 Thread Oleg Goldshmidt
"Muli B.Y." <[EMAIL PROTECTED]> writes: > I have written a small utility, ifup, which will tell you if any network > interface is up or down (connected or disconnected). Can you explain what it does? I mean, is it a wrapper around ifconfig(8) or netstat(8) or something of the kind? Why is it pr

Interface status detection

1999-12-20 Thread Muli B.Y.
I have written a small utility, ifup, which will tell you if any network interface is up or down (connected or disconnected). Now, what I really need is a way to get a notification when an interface changes its status. Is there any way to do this under linux? (Of course I can sleep() and cont