2003-09-23 01:09:32 -07:00
|
|
|
#ifndef _ECORE_CON_PRIVATE_H
|
|
|
|
#define _ECORE_CON_PRIVATE_H
|
|
|
|
|
2008-10-30 08:26:11 -07:00
|
|
|
#include "ecore_private.h"
|
2006-11-05 08:49:55 -08:00
|
|
|
#include "Ecore_Con.h"
|
2005-09-05 03:17:08 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#define ECORE_MAGIC_CON_SERVER 0x77665544
|
|
|
|
#define ECORE_MAGIC_CON_CLIENT 0x77556677
|
2007-09-26 09:01:04 -07:00
|
|
|
#define ECORE_MAGIC_CON_URL 0x77074255
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2008-01-08 13:06:43 -08:00
|
|
|
#define ECORE_CON_TYPE 0x0f
|
2012-06-04 02:16:19 -07:00
|
|
|
#define ECORE_CON_SSL 0xf0
|
|
|
|
#define ECORE_CON_SUPER_SSL 0xf00
|
2008-01-08 13:06:43 -08:00
|
|
|
|
2012-12-05 16:11:14 -08:00
|
|
|
#if HAVE_GNUTLS
|
2008-10-30 08:26:11 -07:00
|
|
|
# include <gnutls/gnutls.h>
|
2012-12-05 16:11:14 -08:00
|
|
|
#elif HAVE_OPENSSL
|
2008-10-30 08:26:11 -07:00
|
|
|
# include <openssl/ssl.h>
|
2004-03-31 08:47:45 -08:00
|
|
|
#endif
|
2005-06-24 06:38:27 -07:00
|
|
|
#ifdef HAVE_CURL
|
|
|
|
#include <curl/curl.h>
|
|
|
|
#endif
|
2004-03-31 08:47:45 -08:00
|
|
|
|
2004-04-03 07:03:33 -08:00
|
|
|
#define READBUFSIZ 65536
|
|
|
|
|
2010-07-26 23:30:27 -07:00
|
|
|
extern int _ecore_con_log_dom;
|
2010-01-06 16:30:05 -08:00
|
|
|
|
|
|
|
#ifdef ECORE_CON_DEFAULT_LOG_COLOR
|
|
|
|
#undef ECORE_LOG_DEFAULT_LOG_COLOR
|
|
|
|
#endif
|
|
|
|
#define ECORE_CON_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
|
|
|
|
|
2009-12-21 09:32:19 -08:00
|
|
|
#ifdef ERR
|
|
|
|
# undef ERR
|
|
|
|
#endif
|
|
|
|
#define ERR(...) EINA_LOG_DOM_ERR(_ecore_con_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef DBG
|
|
|
|
# undef DBG
|
|
|
|
#endif
|
|
|
|
#define DBG(...) EINA_LOG_DOM_DBG(_ecore_con_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef INF
|
|
|
|
# undef INF
|
|
|
|
#endif
|
|
|
|
#define INF(...) EINA_LOG_DOM_INFO(_ecore_con_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef WRN
|
|
|
|
# undef WRN
|
|
|
|
#endif
|
|
|
|
#define WRN(...) EINA_LOG_DOM_WARN(_ecore_con_log_dom, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef CRIT
|
|
|
|
# undef CRIT
|
|
|
|
#endif
|
|
|
|
#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_con_log_dom, __VA_ARGS__)
|
|
|
|
|
2010-07-22 04:32:55 -07:00
|
|
|
typedef struct _Ecore_Con_Lookup Ecore_Con_Lookup;
|
|
|
|
typedef struct _Ecore_Con_Info Ecore_Con_Info;
|
2012-02-14 21:53:50 -08:00
|
|
|
typedef struct Ecore_Con_Socks Ecore_Con_Socks_v4;
|
2011-12-05 19:32:16 -08:00
|
|
|
typedef struct Ecore_Con_Socks_v5 Ecore_Con_Socks_v5;
|
2010-07-22 04:32:55 -07:00
|
|
|
typedef void (*Ecore_Con_Info_Cb)(void *data, Ecore_Con_Info *infos);
|
|
|
|
|
2008-10-01 08:27:52 -07:00
|
|
|
typedef enum _Ecore_Con_State
|
2010-07-26 23:30:27 -07:00
|
|
|
{
|
|
|
|
ECORE_CON_CONNECTED,
|
|
|
|
ECORE_CON_DISCONNECTED,
|
|
|
|
ECORE_CON_INPROGRESS
|
|
|
|
} Ecore_Con_State;
|
2008-10-01 08:27:52 -07:00
|
|
|
|
2008-10-30 08:26:11 -07:00
|
|
|
typedef enum _Ecore_Con_Ssl_Error
|
2010-07-26 23:30:27 -07:00
|
|
|
{
|
|
|
|
ECORE_CON_SSL_ERROR_NONE = 0,
|
|
|
|
ECORE_CON_SSL_ERROR_NOT_SUPPORTED,
|
|
|
|
ECORE_CON_SSL_ERROR_INIT_FAILED,
|
|
|
|
ECORE_CON_SSL_ERROR_SERVER_INIT_FAILED,
|
|
|
|
ECORE_CON_SSL_ERROR_SSL2_NOT_SUPPORTED
|
|
|
|
} Ecore_Con_Ssl_Error;
|
2008-10-30 08:26:11 -07:00
|
|
|
|
2010-09-23 21:15:42 -07:00
|
|
|
typedef enum _Ecore_Con_Ssl_Handshake
|
|
|
|
{
|
|
|
|
ECORE_CON_SSL_STATE_DONE = 0,
|
|
|
|
ECORE_CON_SSL_STATE_HANDSHAKING,
|
|
|
|
ECORE_CON_SSL_STATE_INIT
|
|
|
|
} Ecore_Con_Ssl_State;
|
|
|
|
|
2012-02-14 21:53:50 -08:00
|
|
|
typedef enum Ecore_Con_Proxy_State
|
|
|
|
{ /* named PROXY instead of SOCKS in case some handsome and enterprising
|
|
|
|
* developer decides to add HTTP CONNECT support
|
|
|
|
*/
|
|
|
|
ECORE_CON_PROXY_STATE_DONE = 0,
|
|
|
|
ECORE_CON_PROXY_STATE_RESOLVED,
|
|
|
|
ECORE_CON_PROXY_STATE_INIT,
|
|
|
|
ECORE_CON_PROXY_STATE_READ,
|
|
|
|
ECORE_CON_PROXY_STATE_AUTH,
|
|
|
|
ECORE_CON_PROXY_STATE_REQUEST,
|
|
|
|
ECORE_CON_PROXY_STATE_CONFIRM,
|
|
|
|
} Ecore_Con_Proxy_State;
|
2011-12-05 19:32:16 -08:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
struct _Ecore_Con_Client
|
|
|
|
{
|
|
|
|
ECORE_MAGIC;
|
2010-07-26 23:30:27 -07:00
|
|
|
int fd;
|
2010-09-18 12:26:05 -07:00
|
|
|
Ecore_Con_Server *host_server;
|
2010-07-26 23:30:27 -07:00
|
|
|
void *data;
|
2003-09-23 01:09:32 -07:00
|
|
|
Ecore_Fd_Handler *fd_handler;
|
2011-07-16 06:07:39 -07:00
|
|
|
unsigned int buf_offset;
|
|
|
|
Eina_Binbuf *buf;
|
2010-11-16 13:32:50 -08:00
|
|
|
const char *ip;
|
2011-11-10 18:44:16 -08:00
|
|
|
Eina_List *event_count;
|
2010-07-26 23:30:27 -07:00
|
|
|
struct sockaddr *client_addr;
|
|
|
|
int client_addr_len;
|
2010-09-21 21:48:09 -07:00
|
|
|
double start_time;
|
|
|
|
Ecore_Timer *until_deletion;
|
|
|
|
double disconnect_time;
|
2012-12-05 16:11:14 -08:00
|
|
|
#if HAVE_GNUTLS
|
2010-09-23 23:54:49 -07:00
|
|
|
gnutls_datum_t session_ticket;
|
|
|
|
gnutls_session_t session;
|
2012-12-05 16:11:14 -08:00
|
|
|
#elif HAVE_OPENSSL
|
2010-07-26 23:30:27 -07:00
|
|
|
SSL *ssl;
|
|
|
|
int ssl_err;
|
2008-10-30 08:26:11 -07:00
|
|
|
#endif
|
2010-09-23 21:15:42 -07:00
|
|
|
Ecore_Con_Ssl_State ssl_state;
|
2011-06-15 11:58:34 -07:00
|
|
|
Eina_Bool handshaking : 1;
|
2011-12-21 02:02:30 -08:00
|
|
|
Eina_Bool upgrade : 1; /* STARTTLS queued */
|
|
|
|
Eina_Bool delete_me : 1; /* del event has been queued */
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Con_Server
|
|
|
|
{
|
|
|
|
ECORE_MAGIC;
|
2010-07-26 23:30:27 -07:00
|
|
|
int fd;
|
|
|
|
Ecore_Con_Type type;
|
|
|
|
char *name;
|
|
|
|
int port;
|
|
|
|
char *path;
|
|
|
|
void *data;
|
2003-09-23 01:09:32 -07:00
|
|
|
Ecore_Fd_Handler *fd_handler;
|
2010-07-26 23:30:27 -07:00
|
|
|
Eina_List *clients;
|
2010-09-20 12:31:11 -07:00
|
|
|
unsigned int client_count;
|
2011-07-16 06:07:39 -07:00
|
|
|
Eina_Binbuf *buf;
|
|
|
|
unsigned int write_buf_offset;
|
2011-01-21 02:01:04 -08:00
|
|
|
Eina_List *infos;
|
2011-11-10 18:44:16 -08:00
|
|
|
Eina_List *event_count;
|
2010-07-26 23:30:27 -07:00
|
|
|
int client_limit;
|
|
|
|
pid_t ppid;
|
2011-12-05 19:32:16 -08:00
|
|
|
/* socks */
|
|
|
|
Ecore_Con_Socks *ecs;
|
2012-02-14 21:53:50 -08:00
|
|
|
Ecore_Con_Proxy_State ecs_state;
|
2011-12-05 19:32:16 -08:00
|
|
|
int ecs_addrlen;
|
|
|
|
unsigned char ecs_addr[16];
|
|
|
|
unsigned int ecs_buf_offset;
|
|
|
|
Eina_Binbuf *ecs_buf;
|
|
|
|
Eina_Binbuf *ecs_recvbuf;
|
|
|
|
const char *proxyip;
|
|
|
|
int proxyport;
|
|
|
|
/* endsocks */
|
2011-12-07 17:14:55 -08:00
|
|
|
const char *verify_name;
|
2012-12-05 16:11:14 -08:00
|
|
|
#if HAVE_GNUTLS
|
2010-09-23 23:54:49 -07:00
|
|
|
gnutls_session_t session;
|
2008-10-30 08:26:11 -07:00
|
|
|
gnutls_anon_client_credentials_t anoncred_c;
|
|
|
|
gnutls_anon_server_credentials_t anoncred_s;
|
2010-09-21 17:10:10 -07:00
|
|
|
gnutls_psk_client_credentials_t pskcred_c;
|
|
|
|
gnutls_psk_server_credentials_t pskcred_s;
|
2010-07-26 23:30:27 -07:00
|
|
|
gnutls_certificate_credentials_t cert;
|
2010-09-27 20:16:08 -07:00
|
|
|
char *cert_file;
|
2010-09-19 12:25:47 -07:00
|
|
|
gnutls_dh_params_t dh_params;
|
2012-12-05 16:11:14 -08:00
|
|
|
#elif HAVE_OPENSSL
|
2010-07-26 23:30:27 -07:00
|
|
|
SSL_CTX *ssl_ctx;
|
|
|
|
SSL *ssl;
|
|
|
|
int ssl_err;
|
2004-03-31 08:47:45 -08:00
|
|
|
#endif
|
2010-09-21 21:48:09 -07:00
|
|
|
double start_time;
|
2011-06-17 04:16:50 -07:00
|
|
|
Ecore_Timer *until_deletion;
|
|
|
|
double disconnect_time;
|
2010-09-21 21:48:09 -07:00
|
|
|
double client_disconnect_time;
|
2010-11-16 13:32:50 -08:00
|
|
|
const char *ip;
|
2012-04-11 20:51:36 -07:00
|
|
|
Eina_Bool created : 1; /* @c EINA_TRUE if server is our listening server */
|
|
|
|
Eina_Bool connecting : 1; /* @c EINA_FALSE if just initialized or connected */
|
|
|
|
Eina_Bool handshaking : 1; /* @c EINA_TRUE if server is ssl handshaking */
|
2011-12-21 02:02:30 -08:00
|
|
|
Eina_Bool upgrade : 1; /* STARTTLS queued */
|
2012-06-04 02:03:04 -07:00
|
|
|
Eina_Bool disable_proxy : 1; /* proxy should never be used with this connection */
|
2011-06-15 11:58:34 -07:00
|
|
|
Eina_Bool ssl_prepared : 1;
|
2012-04-11 20:51:36 -07:00
|
|
|
Eina_Bool use_cert : 1; /* @c EINA_TRUE if using certificate auth */
|
2010-09-27 20:16:08 -07:00
|
|
|
Ecore_Con_Ssl_State ssl_state; /* current state of ssl handshake on the server */
|
2012-04-11 20:51:36 -07:00
|
|
|
Eina_Bool verify : 1; /* @c EINA_TRUE if certificates will be verified */
|
|
|
|
Eina_Bool verify_basic : 1; /* @c EINA_TRUE if certificates will be verified only against the hostname */
|
2010-09-17 23:30:13 -07:00
|
|
|
Eina_Bool reject_excess_clients : 1;
|
2011-12-21 02:02:30 -08:00
|
|
|
Eina_Bool delete_me : 1; /* del event has been queued */
|
2011-05-14 10:52:30 -07:00
|
|
|
#ifdef _WIN32
|
|
|
|
Eina_Bool want_write : 1;
|
|
|
|
Eina_Bool read_stop : 1;
|
|
|
|
Eina_Bool read_stopped : 1;
|
|
|
|
HANDLE pipe;
|
|
|
|
HANDLE thread_read;
|
|
|
|
HANDLE event_read;
|
|
|
|
HANDLE event_peek;
|
|
|
|
DWORD nbr_bytes;
|
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
2005-06-24 06:38:27 -07:00
|
|
|
#ifdef HAVE_CURL
|
|
|
|
struct _Ecore_Con_Url
|
|
|
|
{
|
2007-09-26 09:01:04 -07:00
|
|
|
ECORE_MAGIC;
|
2010-07-26 23:30:27 -07:00
|
|
|
CURL *curl_easy;
|
2005-06-24 06:38:27 -07:00
|
|
|
struct curl_slist *headers;
|
2010-07-26 23:30:27 -07:00
|
|
|
Eina_List *additional_headers;
|
|
|
|
Eina_List *response_headers;
|
2011-07-22 20:17:57 -07:00
|
|
|
const char *url;
|
2011-12-22 00:06:51 -08:00
|
|
|
long proxy_type;
|
2012-03-07 09:06:33 -08:00
|
|
|
int status;
|
2007-09-26 09:01:04 -07:00
|
|
|
|
2011-12-20 22:18:25 -08:00
|
|
|
Ecore_Timer *timer;
|
|
|
|
|
2010-10-18 09:39:12 -07:00
|
|
|
Ecore_Con_Url_Time time_condition;
|
|
|
|
double timestamp;
|
2010-07-26 23:30:27 -07:00
|
|
|
void *data;
|
2011-12-29 00:55:11 -08:00
|
|
|
|
|
|
|
void *post_data;
|
2007-09-26 09:01:04 -07:00
|
|
|
|
2010-07-26 23:30:27 -07:00
|
|
|
int received;
|
2012-02-19 23:37:53 -08:00
|
|
|
int write_fd;
|
2012-02-19 15:16:50 -08:00
|
|
|
|
|
|
|
unsigned int event_count;
|
|
|
|
Eina_Bool dead : 1;
|
2012-02-22 02:10:22 -08:00
|
|
|
Eina_Bool multi : 1;
|
2005-06-24 06:38:27 -07:00
|
|
|
};
|
|
|
|
#endif
|
2005-08-16 02:25:02 -07:00
|
|
|
|
2008-10-09 05:30:19 -07:00
|
|
|
struct _Ecore_Con_Info
|
|
|
|
{
|
2010-07-26 23:30:27 -07:00
|
|
|
unsigned int size;
|
2008-10-09 05:30:19 -07:00
|
|
|
struct addrinfo info;
|
2010-07-26 23:30:27 -07:00
|
|
|
char ip[NI_MAXHOST];
|
|
|
|
char service[NI_MAXSERV];
|
2008-10-09 05:30:19 -07:00
|
|
|
};
|
|
|
|
|
2010-07-22 04:32:55 -07:00
|
|
|
struct _Ecore_Con_Lookup
|
|
|
|
{
|
|
|
|
Ecore_Con_Dns_Cb done_cb;
|
|
|
|
const void *data;
|
|
|
|
};
|
|
|
|
|
2012-02-14 21:53:50 -08:00
|
|
|
struct Ecore_Con_Socks /* v4 */
|
2011-12-05 19:32:16 -08:00
|
|
|
{
|
|
|
|
unsigned char version;
|
|
|
|
|
|
|
|
const char *ip;
|
|
|
|
int port;
|
|
|
|
const char *username;
|
2012-02-14 21:53:50 -08:00
|
|
|
unsigned int ulen;
|
2011-12-05 19:32:16 -08:00
|
|
|
Eina_Bool lookup : 1;
|
|
|
|
Eina_Bool bind : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Ecore_Con_Socks_v5
|
|
|
|
{
|
|
|
|
unsigned char version;
|
|
|
|
|
|
|
|
const char *ip;
|
|
|
|
int port;
|
|
|
|
const char *username;
|
2012-02-14 21:53:50 -08:00
|
|
|
unsigned int ulen;
|
2011-12-05 19:32:16 -08:00
|
|
|
Eina_Bool lookup : 1;
|
|
|
|
Eina_Bool bind : 1;
|
2012-02-14 21:53:50 -08:00
|
|
|
/* v5 only */
|
|
|
|
unsigned char method;
|
|
|
|
const char *password;
|
|
|
|
unsigned int plen;
|
2011-12-05 19:32:16 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Ecore_Con_Socks *_ecore_con_proxy_once;
|
|
|
|
extern Ecore_Con_Socks *_ecore_con_proxy_global;
|
|
|
|
void ecore_con_socks_init(void);
|
|
|
|
void ecore_con_socks_shutdown(void);
|
|
|
|
Eina_Bool ecore_con_socks_svr_init(Ecore_Con_Server *svr);
|
|
|
|
void ecore_con_socks_read(Ecore_Con_Server *svr, unsigned char *buf, int num);
|
|
|
|
void ecore_con_socks_dns_cb(const char *canonname, const char *ip, struct sockaddr *addr, int addrlen, Ecore_Con_Server *svr);
|
2011-01-21 02:01:04 -08:00
|
|
|
/* from ecore_con.c */
|
|
|
|
void ecore_con_server_infos_del(Ecore_Con_Server *svr, void *info);
|
2011-12-05 19:32:16 -08:00
|
|
|
void ecore_con_event_proxy_bind(Ecore_Con_Server *svr);
|
2011-05-14 10:52:30 -07:00
|
|
|
void ecore_con_event_server_data(Ecore_Con_Server *svr, unsigned char *buf, int num, Eina_Bool duplicate);
|
|
|
|
void ecore_con_event_server_del(Ecore_Con_Server *svr);
|
2011-12-09 21:09:47 -08:00
|
|
|
#define ecore_con_event_server_error(svr, error) _ecore_con_event_server_error((svr), (char*)(error), EINA_TRUE)
|
|
|
|
void _ecore_con_event_server_error(Ecore_Con_Server *svr, char *error, Eina_Bool duplicate);
|
2011-05-14 10:52:30 -07:00
|
|
|
void ecore_con_event_client_add(Ecore_Con_Client *cl);
|
|
|
|
void ecore_con_event_client_data(Ecore_Con_Client *cl, unsigned char *buf, int num, Eina_Bool duplicate);
|
|
|
|
void ecore_con_event_client_del(Ecore_Con_Client *cl);
|
2011-02-10 00:49:23 -08:00
|
|
|
void ecore_con_event_client_error(Ecore_Con_Client *cl, const char *error);
|
2011-12-05 19:32:16 -08:00
|
|
|
void _ecore_con_server_kill(Ecore_Con_Server *svr);
|
2012-01-19 00:02:41 -08:00
|
|
|
void _ecore_con_client_kill(Ecore_Con_Client *cl);
|
2011-05-14 10:52:30 -07:00
|
|
|
/* from ecore_local_win32.c */
|
|
|
|
#ifdef _WIN32
|
|
|
|
Eina_Bool ecore_con_local_listen(Ecore_Con_Server *svr);
|
|
|
|
Eina_Bool ecore_con_local_connect(Ecore_Con_Server *svr,
|
|
|
|
Eina_Bool (*cb_done)(void *data,
|
2011-07-04 17:06:27 -07:00
|
|
|
Ecore_Fd_Handler *fd_handler));
|
2011-05-14 10:52:30 -07:00
|
|
|
Eina_Bool ecore_con_local_win32_server_flush(Ecore_Con_Server *svr);
|
|
|
|
Eina_Bool ecore_con_local_win32_client_flush(Ecore_Con_Client *cl);
|
|
|
|
void ecore_con_local_win32_server_del(Ecore_Con_Server *svr);
|
|
|
|
void ecore_con_local_win32_client_del(Ecore_Con_Client *cl);
|
|
|
|
#else
|
2010-01-04 11:35:21 -08:00
|
|
|
/* from ecore_local.c */
|
|
|
|
int ecore_con_local_init(void);
|
|
|
|
int ecore_con_local_shutdown(void);
|
2010-07-26 23:30:27 -07:00
|
|
|
int ecore_con_local_connect(Ecore_Con_Server *svr,
|
|
|
|
Eina_Bool (*cb_done)(
|
|
|
|
void *data,
|
|
|
|
Ecore_Fd_Handler *fd_handler),
|
2011-07-04 17:06:27 -07:00
|
|
|
void *data);
|
2010-07-26 23:30:27 -07:00
|
|
|
int ecore_con_local_listen(Ecore_Con_Server *svr,
|
|
|
|
Eina_Bool (*cb_listen)(
|
|
|
|
void *data,
|
|
|
|
Ecore_Fd_Handler *fd_handler),
|
|
|
|
void *data);
|
2011-05-14 10:52:30 -07:00
|
|
|
#endif
|
|
|
|
|
2008-10-09 05:30:19 -07:00
|
|
|
/* from ecore_con_info.c */
|
2010-07-26 23:30:27 -07:00
|
|
|
int ecore_con_info_init(void);
|
|
|
|
int ecore_con_info_shutdown(void);
|
|
|
|
int ecore_con_info_tcp_connect(Ecore_Con_Server *svr,
|
|
|
|
Ecore_Con_Info_Cb done_cb,
|
|
|
|
void *data);
|
|
|
|
int ecore_con_info_tcp_listen(Ecore_Con_Server *svr,
|
|
|
|
Ecore_Con_Info_Cb done_cb,
|
|
|
|
void *data);
|
|
|
|
int ecore_con_info_udp_connect(Ecore_Con_Server *svr,
|
|
|
|
Ecore_Con_Info_Cb done_cb,
|
|
|
|
void *data);
|
|
|
|
int ecore_con_info_udp_listen(Ecore_Con_Server *svr,
|
|
|
|
Ecore_Con_Info_Cb done_cb,
|
|
|
|
void *data);
|
|
|
|
int ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
|
|
|
|
Ecore_Con_Info_Cb done_cb,
|
|
|
|
void *data);
|
2011-01-21 02:01:04 -08:00
|
|
|
void ecore_con_info_data_clear(void *info);
|
|
|
|
|
2011-07-04 17:06:27 -07:00
|
|
|
void ecore_con_event_server_add(Ecore_Con_Server *svr);
|
|
|
|
|
|
|
|
|
2008-10-30 08:26:11 -07:00
|
|
|
/* from ecore_con_ssl.c */
|
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_init(void);
|
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_shutdown(void);
|
2010-09-18 12:26:05 -07:00
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_server_prepare(Ecore_Con_Server *svr, int ssl_type);
|
2008-12-15 09:59:19 -08:00
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_server_init(Ecore_Con_Server *svr);
|
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_server_shutdown(Ecore_Con_Server *svr);
|
2010-07-26 23:30:27 -07:00
|
|
|
int ecore_con_ssl_server_read(Ecore_Con_Server *svr,
|
|
|
|
unsigned char *buf,
|
|
|
|
int size);
|
|
|
|
int ecore_con_ssl_server_write(Ecore_Con_Server *svr,
|
2011-07-16 06:07:39 -07:00
|
|
|
const unsigned char *buf,
|
2010-07-26 23:30:27 -07:00
|
|
|
int size);
|
2008-12-15 09:59:19 -08:00
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_client_init(Ecore_Con_Client *svr);
|
|
|
|
Ecore_Con_Ssl_Error ecore_con_ssl_client_shutdown(Ecore_Con_Client *svr);
|
2010-07-26 23:30:27 -07:00
|
|
|
int ecore_con_ssl_client_read(Ecore_Con_Client *svr,
|
|
|
|
unsigned char *buf,
|
|
|
|
int size);
|
|
|
|
int ecore_con_ssl_client_write(Ecore_Con_Client *svr,
|
2011-07-16 06:07:39 -07:00
|
|
|
const unsigned char *buf,
|
2010-07-26 23:30:27 -07:00
|
|
|
int size);
|
|
|
|
|
|
|
|
int ecore_con_info_get(Ecore_Con_Server *svr,
|
|
|
|
Ecore_Con_Info_Cb done_cb,
|
|
|
|
void *data,
|
|
|
|
struct addrinfo *hints);
|
2010-07-22 04:32:55 -07:00
|
|
|
|
|
|
|
|
2011-11-06 04:26:00 -08:00
|
|
|
#define GENERIC_ALLOC_FREE_HEADER(TYPE, Type) \
|
|
|
|
TYPE *Type##_alloc(void); \
|
|
|
|
void Type##_free(TYPE *e);
|
|
|
|
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Client_Add, ecore_con_event_client_add);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Client_Del, ecore_con_event_client_del);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Client_Write, ecore_con_event_client_write);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Client_Data, ecore_con_event_client_data);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Error, ecore_con_event_server_error);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Client_Error, ecore_con_event_client_error);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Add, ecore_con_event_server_add);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Del, ecore_con_event_server_del);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Write, ecore_con_event_server_write);
|
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Server_Data, ecore_con_event_server_data);
|
2011-12-05 19:32:16 -08:00
|
|
|
GENERIC_ALLOC_FREE_HEADER(Ecore_Con_Event_Proxy_Bind, ecore_con_event_proxy_bind);
|
2011-11-06 04:26:00 -08:00
|
|
|
|
|
|
|
void ecore_con_mempool_init(void);
|
|
|
|
void ecore_con_mempool_shutdown(void);
|
|
|
|
|
|
|
|
#undef GENERIC_ALLOC_FREE_HEADER
|
2008-10-09 05:30:19 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#endif
|