On Fri, Apr 14, 2006 at 08:07:17PM -0700, Matt Helsley (matthltc@us.ibm.com) wrote: > On Fri, 2006-04-14 at 19:26 -0700, Randy.Dunlap wrote: > > On Sat, 15 Apr 2006 03:09:05 +0200 Libor Vanek wrote: > > > > > Hi, > > > I'd like to start writing some small module using connector to send > > > messages to/from user-space. Unfortunately I'm absolutely not familiar > > > with netlink/connector API usage and I couldn't find any usefull > > > documentation (yes, I read Documentation/connector/ and tried Google). > > > > > > So here's things which are not clear to me: > > > - the Documentation/connector containts only kernel-space example - > > > don't anybody have also "user-space client example"? > > > - how do I ACK message sent to/from user-space? > > > - in case of multiple clients listening how do I send message just to > > > (random) one (simple load balancing) or to all of them? (broadcasting) > > > - is there some "easy" way how to send longer messages then > > > CONNECTOR_MAX_MSG_SIZE? > > > > There was a connector userspace example posted to lkml on > > 2005-SEP-28: > > > > Subject: [RFC] Process Events Connector (test program) > > From: Matthew Helsley > > > > > > It seems like one of the Red Hat guys had some netlink documentation > > and sample programs at people.redhat.com, but I can't find that > > just now. > > > > --- > > ~Randy > > Subject:[ANNOUNCE] Test Program for Filesystem Events Reporter > From: > Yi Yang > > might demonstrate what you're looking for as well. > > I don't believe there is an existing way to send messages longer than > CONNECTOR_MAX_MSG_SIZE. Perhaps you could send multiple messages with > the same sequence number but a different "fragment number" in the > message. > > However, if you're sending messages much larger than > CONNECTOR_MAX_MSG_SIZE perhaps the medium of communication is not > appropriate. Have you considered relay files? 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. If you want to use rtnetlink extensions, iproute2 is the best source. Why do you want to send big messages over netlink? Netlink is fast but not faster than char device for example, or read from mapped area, although it is much more convenient to use. Well, I can increase CONNECTOR_MAX_MSG_SIZE to maximum allowed 64k, if there is really strong justification. > Cheers, > -Matt Helsley -- Evgeniy Polyakov