Aaron Williams wrote:

Thank you. That sounds a lot easier than trying to do the bind in kernel space. I just was not sure I could do this or not. If I do this I assume that I should also be able to unbind from user space? Do I need to unplumb my module before unbinding, or can I still use socket requests on the socket after connecting our module?

Why do you need to unbind? closing the socket will take care of this automatically.

Depending on how you write your module you might be able to do operations from user space after you've pushed your module (e.g., setsockopt, sendto). But on need to ensure that the messages get through the read put and write put routines in your module. For instance, in order for setsockopt() to work you have to allow a T_OPTMGMT_REQ message through your wput, and a T_OPTMGMT_ACK through your rput.

I also have written some sample userspace streams code which I guess I could also use. Something like:

s = open("/dev/udp", O_RDWR);
strm_bind(s, &myaddr);
ioctl(s, I_PUSH, "mymodule");

where strm_bind does the appropriate putmsg with a T_BIND_REQ and getmsg gets the response. Though in this case, socket access looks even easier.

That is functionally equivalent to using a socket.

   Erik
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to