[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opensolaris-networking-discuss
Subject:    Re: [networking-discuss] UDP Streams Module
From:       Aaron Williams <aaron_williams () net ! com>
Date:       2006-12-08 20:34:22
Message-ID: 4579CC4E.4070509 () net ! com
[Download RAW message or body]


Erik Nordmark wrote:
> 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.
>
We have some requirements for redundancy in which we bring networking 
interfaces up and down. I am not sure what the behavior would be if we 
are bound to the IP address of the interface that goes down, so to be on 
the safe side I would just like to unbind.  This should not be a problem 
if my reading of the streams messages from user space is correct.  Note 
that since we use streams in user space it might be easier to just 
continue to use streams rather than sockets.  I have already written the 
appropriate code for bind/unbind for streams in user space which appears 
to work just fine.

As far as messages that are not understood by our module I plan to just 
pass them through in order to handle setsockopt type messages and/or 
fcntl messages since we often are changing between blocking and 
non-blocking.
>> 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
networking-discuss@opensolaris.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic