PolarSSL
|
00001 00025 #ifndef POLARSSL_NET_H 00026 #define POLARSSL_NET_H 00027 00028 #define POLARSSL_ERR_NET_UNKNOWN_HOST -0x0F00 00029 #define POLARSSL_ERR_NET_SOCKET_FAILED -0x0F10 00030 #define POLARSSL_ERR_NET_CONNECT_FAILED -0x0F20 00031 #define POLARSSL_ERR_NET_BIND_FAILED -0x0F30 00032 #define POLARSSL_ERR_NET_LISTEN_FAILED -0x0F40 00033 #define POLARSSL_ERR_NET_ACCEPT_FAILED -0x0F50 00034 #define POLARSSL_ERR_NET_RECV_FAILED -0x0F60 00035 #define POLARSSL_ERR_NET_SEND_FAILED -0x0F70 00036 #define POLARSSL_ERR_NET_CONN_RESET -0x0F80 00037 #define POLARSSL_ERR_NET_TRY_AGAIN -0x0F90 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif 00042 00055 int net_connect( int *fd, const char *host, int port ); 00056 00070 int net_bind( int *fd, const char *bind_ip, int port ); 00071 00083 int net_accept( int bind_fd, int *client_fd, void *client_ip ); 00084 00092 int net_set_block( int fd ); 00093 00101 int net_set_nonblock( int fd ); 00102 00111 void net_usleep( unsigned long usec ); 00112 00125 int net_recv( void *ctx, unsigned char *buf, int len ); 00126 00139 int net_send( void *ctx, unsigned char *buf, int len ); 00140 00146 void net_close( int fd ); 00147 00148 #ifdef __cplusplus 00149 } 00150 #endif 00151 00152 #endif /* net.h */