Ignore:
Timestamp:
Nov 30, 2008, 12:47:18 AM (13 years ago)
Author:
charles
Message:

(libT) patch from jhujhiti to add ipv6 support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.h

    r7151 r7195  
    6161#endif
    6262
    63 struct in_addr;
    64 struct sockaddr_in;
    6563struct tr_session;
    6664
    67 /***********************************************************************
    68  * DNS resolution
    69  **********************************************************************/
    70 int  tr_netResolve( const  char *,
    71                     struct in_addr * );
     65#define TR_AF_INET  0
     66#define TR_AF_INET6 1
     67
     68typedef struct tr_address {
     69    unsigned short type : 1;
     70    union {
     71        /* The order here is important for tr_in{,6}addr_any initialization,
     72         * since we can't use C99 designated initializers */
     73        struct in6_addr addr6;
     74        struct in_addr  addr4;
     75    } addr;
     76} tr_address;
     77
     78extern const tr_address tr_inaddr_any;
     79extern const tr_address tr_in6addr_any;
     80
     81const char *tr_ntop( const tr_address * src,
     82                     char * dst,
     83                     int size );
     84const char *tr_ntop_non_ts( const tr_address * src );
     85tr_address *tr_pton( const char * src,
     86                     tr_address * dst );
     87int tr_compareAddresses( const tr_address * a,
     88                         const tr_address * b);
    7289
    7390
     
    7592 * Sockets
    7693 **********************************************************************/
    77 int  tr_netOpenTCP( struct tr_handle     * session,
    78                     const struct in_addr * addr,
    79                     tr_port_t              port );
     94int  tr_netOpenTCP( struct tr_handle * session,
     95                    const tr_address * addr,
     96                    tr_port_t          port );
    8097
    81 int  tr_netBindTCP( int port );
     98int  tr_netBindTCP( const tr_address * addr,
     99                    int                port );
    82100
    83 int  tr_netAccept( struct tr_handle  * session,
    84                    int                 bound,
    85                    struct in_addr    * setme_addr,
    86                    tr_port_t         * setme_port );
     101int  tr_netAccept( struct tr_handle * session,
     102                   int                bound,
     103                   tr_address       * setme_addr,
     104                   tr_port_t        * setme_port );
    87105
    88106int  tr_netSetTOS( int s,
     
    91109void tr_netClose( int s );
    92110
    93 void tr_netNtop( const struct in_addr * addr,
    94                  char *                 buf,
    95                  int                    len );
    96 
    97111void tr_netInit( void );
    98112
Note: See TracChangeset for help on using the changeset viewer.