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

Re: [dccp] Re: dccp_service in sockaddr_dccp{}



I agree with Arnaldo et al. here. The Service Code should be considered similar to a port. It is best to specify it at bind() time, rather than separately. The structure names may want some updating; sockaddr_in_dccp and sockaddr_in6_dccp, rather than sockaddr_dccp, for example. The servicecode member should finish off the structure, so that sockaddr_in is a prefix of sockaddr_in_dccp. And the code should be smart enough to supply a 0 service code if the sa_len corresponds to sockaddr_in instead of sockaddr_in_dccp.

Eddie


YOSHIFUJI Hideaki / åèèæ wrote:
Hi, Arnaldo and folks,

In article <20050909011256.GC19109 at mandriva.com> (at Thu, 8 Sep 2005 22:12:56 -0300), Arnaldo Carvalho de Melo <acme at conectiva.com.br> says:


So we have to provide a way for applications to supply the service code,
it can be in sockaddr_dccp or in a setsockopt, so far we think its better
to have it in sockaddr_dccp.


I do think sockopt is much better from the point of view of socket API.

 1. sockaddr_xxx{} and AF_xxx make pair.
    e.g. sockaddr_in{} is used for AF_INET
         sockaddr_in6{} is used for AF_INET6
    Type of sockaddr shall be determined by the sa_family member
    in sockaddr{} (POSIX).

 2. It is used only in DCCP-Request / DCCP-Response.
    It does NOT identify the connection, it is NOT required.

I see strong reason we should avoid using new sockaddr{}
in this case.  Or do I miss something?