Re: Connector - how to start?

Libor Vanek
2006-04-20T15:32:32Z

Hi,

On 4/20/06, Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> On Thu, Apr 20, 2006 at 05:12:33PM +0200, Libor Vanek (libor.vanek@gmail.com) wrote:
>
> > - When sending message from kernel, cn_netlink_send returns an error
> > in case when there is no reciever - BUT user space "send" doesn't
> > return an error when there is no reciever in kernel :-(
>
> Userspace sends it into kernel socket. Groups were created for
> userspace's sockets, so there is always a listener in kernelspace.

OK, I wanted to use this to check, if my module is loaded.

> > - How (if) can I do ACK (acknoledge received and processed message)?
>
> I put seq and ack fields into connector header, and described a simple
> protocol for it's usage, but it does require some work by driver author,
> it is impossible to generate automatic ack messages in netlink
> (well, it is possible to generate nlmsgerr message sending but generally
> it is not what people want with protocols designed over connector).

Problem is that there is no (easy) way how to confirm that message was
recieved and proccessed correctly... OK, I'll have to do it
asynchronous...

> Not a good style of allocating data from atomic pool without checks for
> return value.

Just an simple example...

> Btw, you do not need to allocate it dynamically,
> char msg[sizeof(struct cn_msg) + 32] will work too.

Thanks, I didn't know that one.

> In this example you will receive messages for groups 1, 2 (bind time
> gropus 0x3 is equal to (1<<(1-1)) | (1<<(2-1))) and group 3 (you
> have subscribed to that gropu explicitly).

Thx.

Libor Vanek