Lines Matching refs:fd

45     ctx->fd = -1;  in mbedtls_net_init()
64 ctx->fd = 0; in mbedtls_net_connect()
73 int fd = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_recv() local
75 if (fd < 0) in mbedtls_net_recv()
84 ret = WIFI_ReceiveData( (uint8_t)fd, in mbedtls_net_recv()
107 int fd = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_recv_timeout() local
109 if( fd < 0 ) in mbedtls_net_recv_timeout()
118 ret = WIFI_ReceiveData( (uint8_t)fd, in mbedtls_net_recv_timeout()
143 int fd = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_send() local
145 if( fd < 0 ) in mbedtls_net_send()
161 ret = WIFI_SendData( (uint8_t)fd, in mbedtls_net_send()
178 if (ctx->fd == -1) in mbedtls_net_free()
181 ret = WIFI_CloseClientConnection( (uint32_t)ctx->fd ); in mbedtls_net_free()
185 ctx->fd = -1; in mbedtls_net_free()
198 ctx->fd = -1; in mbedtls_net_init()
218 ctx->fd = (int) socket( cur->ai_family, in mbedtls_net_connect()
220 if( ctx->fd < 0 ) in mbedtls_net_connect()
228 ret = connect( ctx->fd, cur->ai_addr, cur->ai_addrlen ); in mbedtls_net_connect()
240 close( ctx->fd ); in mbedtls_net_connect()
257 if( ( fcntl( ctx->fd, F_GETFL, 0) & O_NONBLOCK ) != O_NONBLOCK ) in net_would_block()
280 flags = fcntl( ctx->fd, F_GETFL, 0 ); in mbedtls_net_set_block()
283 return fcntl( ctx->fd, F_SETFL, flags ); in mbedtls_net_set_block()
290 flags = fcntl( ctx->fd, F_GETFL, 0 ); in mbedtls_net_set_nonblock()
293 return fcntl( ctx->fd, F_SETFL, flags ); in mbedtls_net_set_nonblock()
299 int fd = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_recv() local
301 if( fd < 0 ) in mbedtls_net_recv()
304 ret = (int) read( fd, buf, len ); in mbedtls_net_recv()
329 int fd = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_recv_timeout() local
331 if( fd < 0 ) in mbedtls_net_recv_timeout()
335 FD_SET( fd, &read_fds ); in mbedtls_net_recv_timeout()
340 ret = select( fd + 1, &read_fds, NULL, NULL, timeout == 0 ? NULL : &tv ); in mbedtls_net_recv_timeout()
358 int fd = ((mbedtls_net_context *) ctx)->fd; in mbedtls_net_send() local
360 if( fd < 0 ) in mbedtls_net_send()
363 ret = (int) write( fd, buf, len ); in mbedtls_net_send()
384 if( ctx->fd == -1 ) in mbedtls_net_free()
387 shutdown( ctx->fd, 2 ); in mbedtls_net_free()
388 close( ctx->fd ); in mbedtls_net_free()
390 ctx->fd = -1; in mbedtls_net_free()