RetroArch
net_sockets.h
Go to the documentation of this file.
1 
23 #ifndef MBEDTLS_NET_SOCKETS_H
24 #define MBEDTLS_NET_SOCKETS_H
25 
26 #if !defined(MBEDTLS_CONFIG_FILE)
27 #include "config.h"
28 #else
29 #include MBEDTLS_CONFIG_FILE
30 #endif
31 
32 #include "ssl.h"
33 
34 #include <stddef.h>
35 #include <stdint.h>
36 
37 #define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042
38 #define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044
39 #define MBEDTLS_ERR_NET_BIND_FAILED -0x0046
40 #define MBEDTLS_ERR_NET_LISTEN_FAILED -0x0048
41 #define MBEDTLS_ERR_NET_ACCEPT_FAILED -0x004A
42 #define MBEDTLS_ERR_NET_RECV_FAILED -0x004C
43 #define MBEDTLS_ERR_NET_SEND_FAILED -0x004E
44 #define MBEDTLS_ERR_NET_CONN_RESET -0x0050
45 #define MBEDTLS_ERR_NET_UNKNOWN_HOST -0x0052
46 #define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL -0x0043
47 #define MBEDTLS_ERR_NET_INVALID_CONTEXT -0x0045
49 #define MBEDTLS_NET_LISTEN_BACKLOG 10
51 #define MBEDTLS_NET_PROTO_TCP 0
52 #define MBEDTLS_NET_PROTO_UDP 1
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
65 typedef struct
66 {
67  int fd;
68 }
70 
78 
94 int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char *port, int proto );
95 
113 int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto );
114 
131  mbedtls_net_context *client_ctx,
132  void *client_ip, size_t buf_size, size_t *ip_len );
133 
142 
151 
160 void mbedtls_net_usleep( unsigned long usec );
161 
174 int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len );
175 
188 int mbedtls_net_send( void *ctx, const unsigned char *buf, size_t len );
189 
211 int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len,
212  uint32_t timeout );
213 
220 
221 #ifdef __cplusplus
222 }
223 #endif
224 
225 #endif /* net_sockets.h */
int mbedtls_net_recv_timeout(void *ctx, unsigned char *buf, size_t len, uint32_t timeout)
Read at most 'len' characters, blocking for at most 'timeout' seconds. If no error occurs,...
Definition: net_sockets.c:511
GLbitfield GLuint64 timeout
Definition: glext.h:7831
int mbedtls_net_set_nonblock(mbedtls_net_context *ctx)
Set the socket non-blocking.
Definition: net_sockets.c:437
int mbedtls_net_bind(mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto)
Create a receiving socket on bind_ip:port in the chosen protocol. If bind_ip == NULL,...
Definition: net_sockets.c:192
Configuration options (set of defines)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
GLenum GLsizei len
Definition: glext.h:7389
includes all by default used to find thumbnails Please choose a single playlist first Add Entry Add Folder Select Files< multiple > Please fill out all required fields RetroArch updated successfully Please restart the application for the changes to take effect Contributors Move Down Load Remove Add Pass No shader passes Reset All Passes Download thumbnail Start on Download All Thumbnails This Playlist Configured in port
Definition: msg_hash_us.h:7699
void mbedtls_net_usleep(unsigned long usec)
Portable usleep helper.
Definition: net_sockets.c:455
int fd
Definition: net_sockets.h:67
AVFormatContext * ctx
Definition: record_ffmpeg.c:247
SSL/TLS functions.
void mbedtls_net_init(mbedtls_net_context *ctx)
Initialize a context Just makes the context ready to be used or freed safely.
Definition: net_sockets.c:136
int mbedtls_net_connect(mbedtls_net_context *ctx, const char *host, const char *port, int proto)
Initiate a connection with host:port in the given protocol.
Definition: net_sockets.c:144
const char * proto
Definition: civetweb.c:11575
int mbedtls_net_send(void *ctx, const unsigned char *buf, size_t len)
Write at most 'len' characters. If no error occurs, the actual amount read is returned.
Definition: net_sockets.c:569
int mbedtls_net_set_block(mbedtls_net_context *ctx)
Set the socket blocking.
Definition: net_sockets.c:422
void mbedtls_net_free(mbedtls_net_context *ctx)
Gracefully shutdown the connection and free associated data.
Definition: net_sockets.c:605
int mbedtls_net_accept(mbedtls_net_context *bind_ctx, mbedtls_net_context *client_ctx, void *client_ip, size_t buf_size, size_t *ip_len)
Accept a connection from a remote client.
Definition: net_sockets.c:304
Definition: net_sockets.h:65
int mbedtls_net_recv(void *ctx, unsigned char *buf, size_t len)
Read at most 'len' characters. If no error occurs, the actual amount read is returned.
Definition: net_sockets.c:475
unsigned int uint32_t
Definition: stdint.h:126