[GE dev] IPv6 commlib

crei crei at sun.com
Tue Mar 31 10:08:23 BST 2009


    [ The following text is in the "utf-8" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some characters may be displayed incorrectly. ]

On 03/30/09 17:58, igardais wrote:
> Well, in cl_tcp_framework.c,  cl_com_tcp_private_t could get the following modifications :
> - addition of an 'int sock6fd' to handle the IPv6-only socket
> - change client_addr to either a 'sockaddr_storage' or an 'addrinfo'
> 
> If using addrinfo induces getaddrinfo() calls.
> Logic should be added into cl_com_tcp_open_connection() for socket() calls.
> 
> Also in cl_communication.c :
> - cl_com_gethostbyaddr() uses in_addr. Should be changed to use addrinfo.
> - cl_com_is_ip_address_string() is IPv4 centric (so does cl_com_get_ip_string())
> 
> 
> Globally speaking, IPv6 can be handle by switchs inside the functions to tell whether sockaddr_storage should be cast to sockaddr_in or sockadd_in6.
> For functions taking an in_addr as a parameter should be either duplicate to user in6_addr or modified to use addrinfo.

I'm not sure about the details, but we can use the cl_framework_t type as additional function parameter
switch ...

typedef enum cl_framework_def {
     CL_CT_UNDEFINED = 0,
     CL_CT_TCP,        /* tcp/ipv4 framework */
     CL_CT_SSL,        /* secure socket layer */
     CL_CT_TCP_V6      /* tcp/ipv6 framework */
} cl_framework_t;

and a new data type for the in_addr parameter (like done with cl_com_hostent_t):

typedef struct cl_addr_def {
    struct in_addr *addr_v4,
    sockadd_in6    *addr_v6
} cl_addr_t;

e.g.:

static int cl_com_gethostbyaddr(struct in_addr *addr, cl_com_hostent_t **hostent,
                                 int* system_error_retval);

would then be something like:

static int cl_com_gethostbyaddr(cl_addr_def* addr, cl_com_hostent_t **hostent,
                                 int* system_error_retval, cl_framework_t framework);


Regards,

Christian


> 
> I hope I'm clear enough to be understood :)
> 
> Ionel
> 
> 
> --- En date de : Lun 30.3.09, rayson <rayrayson at gmail.com> a écrit :
> 
>> De: rayson <rayrayson at gmail.com>
>> Objet: Re: [GE dev] IPv6 commlib
>> ?: dev at gridengine.sunsource.net
>> Cc: "igardais" <ionel.gardais at tech-advantage.com>
>> Date: Lundi 30 Mars 2009, 16h49
>> On 3/22/09, igardais
>> <ionel.gardais at tech-advantage.com> wrote:
>>> As Christian says, adding #ifdef statements is not an
>> option.
>>> But IPv6 needs special/additionnal/new calls
>> (dedicated to IPv6 or not). Which way should we considere in
>> adding IPv6 support to commlib ?
>>> Create an IPv6 only commlib beside the original
>> commlib ?
>>> Modify structures to handle IPv4 and IPv6 datas ?
>>> Duplicate structures and add logic to current methods
>> ?
>>
>> Can you provide a real example??
>>
>> We should be able to typedef & #define function names
>> to make the code
>> as #ifdef as possible.
>>
>> Rayson
> 
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=39&dsMessageId=149416
> 
> To unsubscribe from this discussion, e-mail: [dev-unsubscribe at gridengine.sunsource.net].

-- 
Sun Microsystems GmbH             Christian Reissmann
Dr.-Leo-Ritter-Str. 7             Software Engineer
D-93049 Regensburg                Phone: +49 (0)941 3075 112
Germany                           Fax:   +49 (0)941 3075 222
http://www.sun.de                 mailto: Christian.Reissmann at sun.com
                                   http://www.sun.com/gridengine
Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=39&dsMessageId=150356

To unsubscribe from this discussion, e-mail: [dev-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list