mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* rtnetlink interface state monitoring problems.
@ 2002-10-21 11:18 David Woodhouse
  2002-10-21 13:02 ` jamal
  2002-10-21 13:46 ` James Morris
  0 siblings, 2 replies; 13+ messages in thread
From: David Woodhouse @ 2002-10-21 11:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

I'm playing with userspace applications which want to monitor the status of 
IrDA and Bluetooth devices. Rather than polling for the interface state 
(this is a handheld device and polling wastes CPU and battery), I want to 
use netlink. 

I have two problems:

 1. I appear to need CAP_NET_ADMIN to bind to the netlink groups which give
	me this  information. I can poll for it just fine, but need 
	elevated privs to be notified. Why is this, and is there a workaround?

 2. Even root doesn't get notification of state changes for Bluetooth
	interfaces, because they're not treated as 'normal' network devices
	like IrDA devices are. I can see the logic behind that -- by why
	is it done differently from IrDA? Is there a way to get notification
	of BT interface state changes?


--
dwmw2



^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: rtnetlink interface state monitoring problems.
@ 2002-10-22 17:16 Jean Tourrilhes
  0 siblings, 0 replies; 13+ messages in thread
From: Jean Tourrilhes @ 2002-10-22 17:16 UTC (permalink / raw)
  To: Linux kernel mailing list, David Woodhouse

David Woodhouse wrote :
>
> IrDA devices are network devices. The core network code sends a RTM_NETLINK 
> message when they go up or down. All is well, and once the permission fix 
> gets into the kernel I'm using, my irda monitor applet no longer needs to 
> poll the state of the interface.

	Actually, I'm not 100% happy with the IrDA situation. I would
not mind someone exporting more events to RtNetlink, very similar to
the functionality/events I already provide in the IrNET control
channel (discovery/expiry/link blocked/...).
	Note that if you are only interested in IrNET, then the IrNET
control channel gives you everything you need, and you don't really
need to use RtNetlink. Personally, I think the future of IrDA is
IrNET, so that's why I don't bother with the rest.
	In any case, send me a link to you applet, I'll add that on my
web page.

> But Bluetooth devices are not network devices, it seems. There exists no 
> current mechanism for notifying anyone of state changes. Should we invent a 
> new method of notification using netlink, or should Bluetooth interfaces in 
> fact be normal network devices just like IrDA devices are?

	Check this thread :
http://sourceforge.net/mailarchive/forum.php?thread_id=1165868&forum_id=1881
	Basically, you need to check the code in hcid.c (in utils) to
know how to collect this events. I've coded this and it works
perfect. Yeah, it's another socket to manage.

> --
> dwmw2

	Have fun...

	Jean

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-10-28 12:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-21 11:18 rtnetlink interface state monitoring problems David Woodhouse
2002-10-21 13:02 ` jamal
2002-10-21 18:57   ` David Woodhouse
2002-10-23  0:59     ` jamal
2002-10-23  1:44       ` Tim Hockin
2002-10-23  3:17         ` jamal
2002-10-23 19:42           ` Maksim (Max) Krasnyanskiy
2002-10-28 12:35             ` jamal
2002-10-23 19:41       ` Maksim (Max) Krasnyanskiy
2002-10-21 13:46 ` James Morris
2002-10-21 13:48   ` James Morris
2002-10-21 17:01     ` David S. Miller
2002-10-22 17:16 Jean Tourrilhes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome