Re: Connector - how to start?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 16, 2006 at 01:26:10PM +0200, Libor Vanek ([email protected]) wrote:
> Hi,
> 
> > I've attached simple userspace program used with w1, which sends
> > and receives connector messages. It can be also used as example of
> > netlink usage from userspace point of view.
> 
> Maybe I'm really stupid and/or blind but I can't find in this example
> (from my point of view) quite important features:
> 
> - there is no way how can user-space part say what "cb_id.idx" and
> "cb_id.val" it should accept (as far as I understand these are used
> for settings "message type" - what SW is using these)

"idx" field is a group number userspace binds to, "val" is a private
identificator which is used as you like.

> - I can't find neither in cn_test.c nor w1_netlink.c (which is the
> only part I found connector used in) any way of detecting if message
> was delivered to/from user-space

If cn_netlink_send() returns zero this means message was queued into
userspace socket. In case of error negative value is returned.

> - the very same is for detecting if there is some user-space
> "reciever" (there is some mention about this in
> Documentantation/connector/connector.txt but it's not working to
> myself - I got 2.6.17-pre1-mm2)

connector uses netlink_has_listeners(), but it can produce false
positives, in this case netlink_broadcast() will say the final word.
If message has been added into socket's queue netlink_broadcast(), which
is used in connector, returns zero, and it's return value is propagated
back to original caller of cn_netlink_send().

Message from userspace is always delivered, and in this case appropriate
callback is called.

> Maybe connector doesn't support these things... ?
> 
> Libor Vanek

-- 
	Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux