Ignore:
Timestamp:
Sep 25, 2006, 6:37:45 PM (15 years ago)
Author:
joshe
Message:

Merge nat-traversal branch to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.h

    r791 r920  
    2727 * DNS resolution
    2828 **********************************************************************/
    29 int tr_netResolve( char *, struct in_addr * );
     29int tr_netResolve( const char *, struct in_addr * );
    3030
    31 #define TR_RESOLVE_WAIT  0
    32 #define TR_RESOLVE_ERROR 1
    33 #define TR_RESOLVE_OK    2
    3431typedef struct tr_resolve_s tr_resolve_t;
    3532void           tr_netResolveThreadInit();
    3633void           tr_netResolveThreadClose();
    37 tr_resolve_t * tr_netResolveInit( char * );
    38 int            tr_netResolvePulse( tr_resolve_t *, struct in_addr * );
     34tr_resolve_t * tr_netResolveInit( const char * );
     35tr_tristate_t  tr_netResolvePulse( tr_resolve_t *, struct in_addr * );
    3936void           tr_netResolveClose( tr_resolve_t * );
    4037
     
    4340 * TCP sockets
    4441 **********************************************************************/
    45 int  tr_netOpen    ( struct in_addr addr, in_port_t port );
    46 int  tr_netBind    ( int );
     42#define tr_netOpenTCP( addr, port ) tr_netOpen( (addr), (port), SOCK_STREAM )
     43#define tr_netOpenUDP( addr, port ) tr_netOpen( (addr), (port), SOCK_DGRAM )
     44int  tr_netOpen    ( struct in_addr addr, in_port_t port, int type );
     45int  tr_netMcastOpen( int port, struct in_addr addr );
     46#define tr_netBindTCP( port ) tr_netBind( (port), SOCK_STREAM )
     47#define tr_netBindUDP( port ) tr_netBind( (port), SOCK_DGRAM )
     48int  tr_netBind    ( int port, int type );
    4749int  tr_netAccept  ( int s, struct in_addr *, in_port_t * );
    4850void tr_netClose   ( int s );
     
    5153#define TR_NET_CLOSE 0x40000000
    5254int  tr_netSend    ( int s, uint8_t * buf, int size );
    53 int  tr_netRecv    ( int s, uint8_t * buf, int size );
     55#define tr_netRecv( s, buf, size ) tr_netRecvFrom( (s), (buf), (size), NULL )
     56int  tr_netRecvFrom( int s, uint8_t * buf, int size, struct sockaddr_in * );
    5457
    5558void tr_netNtop( const struct in_addr * addr, char * buf, int len );
Note: See TracChangeset for help on using the changeset viewer.