Changeset 7397 for trunk/libtransmission/net.h
- Timestamp:
- Dec 15, 2008, 12:17:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/net.h
r7232 r7397 56 56 struct tr_session; 57 57 58 #define TR_AF_INET 0 59 #define TR_AF_INET6 1 60 61 typedef struct tr_address { 62 unsigned short type : 1; 63 union { 64 /* The order here is important for tr_in{,6}addr_any initialization, 65 * since we can't use C99 designated initializers */ 66 struct in6_addr addr6; 67 struct in_addr addr4; 68 } addr; 69 } tr_address; 70 71 extern const tr_address tr_inaddr_any; 72 extern const tr_address tr_in6addr_any; 73 74 const char *tr_ntop( const tr_address * src, 75 char * dst, 76 int size ); 77 const char *tr_ntop_non_ts( const tr_address * src ); 78 tr_address *tr_pton( const char * src, 79 tr_address * dst ); 80 int tr_compareAddresses( const tr_address * a, 81 const tr_address * b); 58 #define TR_AF_INET 0 59 #define TR_AF_INET6 1 60 61 typedef struct tr_address { 62 uint8_t type; 63 union { 64 /* The order here is important for tr_in{,6}addr_any initialization, 65 * since we can't use C99 designated initializers */ 66 struct in6_addr addr6; 67 struct in_addr addr4; 68 } addr; 69 } tr_address; 70 71 extern const tr_address tr_inaddr_any; 72 extern const tr_address tr_in6addr_any; 73 74 const char *tr_ntop( const tr_address * src, 75 char * dst, 76 int size ); 77 const char *tr_ntop_non_ts( const tr_address * src ); 78 tr_address *tr_pton( const char * src, 79 tr_address * dst ); 80 int tr_compareAddresses( const tr_address * a, 81 const tr_address * b); 82 void tr_normalizeV4Mapped( tr_address * const addr ); 83 84 /*********************************************************************** 85 * Socket list housekeeping 86 **********************************************************************/ 87 typedef struct tr_socketList tr_socketList; 88 tr_socketList *tr_socketListAppend( tr_socketList * const head, 89 const tr_address * const addr ); 90 tr_socketList *tr_socketListNew( const tr_address * const addr ); 91 void tr_socketListFree( tr_socketList * const head ); 92 void tr_socketListRemove( tr_socketList * const head, 93 tr_socketList * const el); 94 void tr_socketListTruncate( tr_socketList * const head, 95 tr_socketList * const start ); 96 int tr_socketListGetSocket( const tr_socketList * const el ); 97 const tr_address *tr_socketListGetAddress( const tr_socketList * const el ); 98 void tr_socketListForEach( tr_socketList * const head, 99 void ( * cb ) ( int * const, 100 tr_address * const, 101 void * const ), 102 void * const userData); 82 103 83 104 /*********************************************************************** … … 89 110 90 111 int tr_netBindTCP( const tr_address * addr, 91 tr_port port ); 112 tr_port port, 113 tr_bool suppressMsgs ); 92 114 93 115 int tr_netAccept( struct tr_handle * session,
Note: See TracChangeset
for help on using the changeset viewer.