Transport Specific - RPC     (udp,tcp)

        Shawn Mullen --- shawn@austin.ibm.com


         ipv6  RFC 1883
         API to support ipv6 RFC-2133




struct sockaddr_in {                        
        uchar_t        sin_len;      
        sa_family_t    sin_family;      <-- AF_INET
        in_port_t      sin_port;     
        struct in_addr sin_addr;        sizeof(int) 
        uchar_t        sin_zero[8];
}


struct sockaddr_in6 {
        u_char          sin6_len;
        u_char          sin6_family;      <-- AF_INET6
        u_int16_t       sin6_port;
        u_int32_t       sin6_flowinfo;
        struct          in6_addr   sin6_addr; sizeof(int)*4

                         
};

















page1














        Client RPC
      clnt ops

        clntudp_create()        <---
        clntudp_call()
        clntudp_abort()
        clntudp_geterr()
        clntudp_freeres()
        clntudp_destroy()
        clntudp_control()       <---

call to clntudp_create()
call to clnttcp_create() 

returns client handle {
        ...
        cl_private      ---> cu_data;      ( malloc'ed, freed, controled
                                             in RPC routines )
        }
struct cu_data {
        int                cu_sock;
        struct sockaddr_in6 cu_ra6;      instead of struct sockaddr_in cu_ra4
        ...
        }








client handle create

          
CLINET *
clntudp_create (sockaddr_xxx  remote_address,...,     int socket)



if ( ((struct sockaddr_in *)raddr)->sin_family == AF_INET6 ) {
        copy(remote_address into  cl_private)

else it's ipv4 so map to ipv6
sin6_addr       ::FFFF:<IPv4-address>




If socket == ANYSOCK -- no problem create an AF_INET6 sock

If passed in a socket, user getsockname(socket) to determine if
it AF_INET or AF_INET6



clntudp_control( ,,CLGET_SERVER_ADDR)

        if you've mapped, un-mapp and return sockaddr_in (ipv4)






 

 
 
 
 

 









page 3


Server transport changes


Transport Specific Server
        svctcp_recv,
        svctcp_stat,
        svctcp_getargs,
        svctcp_reply,
        svctcp_freeargs,
        svctcp_destroy

typedef struct SVCXPRT {
        int             xp_sock;
        u_short         xp_port;         /* associated port number */
        ...
>>>     struct sockaddr_in xp_raddr;     /* remote address */  
        struct opaque_auth xp_verf;      /* raw response verifier */
        caddr_t         xp_p1;           /* private: for use by svc ops */
        caddr_t         xp_p2;           /* private: for use by svc ops */
        caddr_t         xp_p3;           /* private: for use by svc lib */
} SVCXPRT;


svcxxx_yyyyy()   svcxxx_yyyyy2()

extern SVCXPRT *svcudp_create();   <<< ipv4
extern SVCXPRT *svcudp_create2();  <<< ipvx   pass in address_family
                                              pass in len (just in case)



misc

lib calls to determine and map addresses and names 
see:

draft-ietf-ipngwg-bsd-api-00.txt 
Advanced Sockets API for IPv6 RFC2292





contractors whom do this type of work:

http://journyx.com/consulting.html