add full ssl certificate support to ecore_con: call ecore_con_ssl_cert_add("/path/to/cert.pem") and then create the server object with the ECORE_CON_LOAD_CERT flag

also may have accidentally ruined the formatting on a couple files and started an hour-long discussion over efl formatting scripts to conceal the fact that I used uncrustify to reformat everything


SVN revision: 50529
This commit is contained in:
Mike Blumenkrantz 2010-07-27 06:30:27 +00:00
parent 1ddcb2340a
commit f0053045e4
8 changed files with 2993 additions and 2111 deletions

View File

@ -73,187 +73,230 @@
extern "C" {
#endif
typedef struct _Ecore_Con_Server Ecore_Con_Server; /**< A connection handle */
typedef struct _Ecore_Con_Client Ecore_Con_Client; /**< A connection handle */
typedef struct _Ecore_Con_Url Ecore_Con_Url;
typedef struct _Ecore_Con_Server Ecore_Con_Server; /**< A connection handle */
typedef struct _Ecore_Con_Client Ecore_Con_Client; /**< A connection handle */
typedef struct _Ecore_Con_Url Ecore_Con_Url;
/**
* A callback type for use with @ref ecore_con_lookup.
*/
typedef void (*Ecore_Con_Dns_Cb)(const char *canonname,
const char *ip,
struct sockaddr *addr,
int addrlen,
void *data);
typedef void (*Ecore_Con_Dns_Cb)(const char *canonname,
const char *ip,
struct sockaddr *addr,
int addrlen,
void *data);
/**
* Types for an ecore_con client/server object. A correct way to set this type is
* with an ECORE_CON_$TYPE, optionally OR'ed with an ECORE_CON_$USE if encryption is desired.
* @example ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS
* with an ECORE_CON_$TYPE, optionally OR'ed with an ECORE_CON_$USE if encryption is desired,
* and LOAD_CERT if the previously loaded certificate should be used.
* @example ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_LOAD_CERT
*/
typedef enum _Ecore_Con_Type
{
ECORE_CON_LOCAL_USER = 0,
ECORE_CON_LOCAL_SYSTEM = 1,
ECORE_CON_LOCAL_ABSTRACT = 2,
ECORE_CON_REMOTE_TCP = 3,
ECORE_CON_REMOTE_MCAST = 4,
ECORE_CON_REMOTE_UDP = 5,
ECORE_CON_REMOTE_BROADCAST = 6,
ECORE_CON_REMOTE_NODELAY = 7,
typedef enum _Ecore_Con_Type
{
ECORE_CON_LOCAL_USER = 0, /** Socket in ~/.ecore */
ECORE_CON_LOCAL_SYSTEM = 1, /** Socket in /tmp */
ECORE_CON_LOCAL_ABSTRACT = 2, /** Abstract socket */
ECORE_CON_REMOTE_TCP = 3, /** Remote server using TCP */
ECORE_CON_REMOTE_MCAST = 4, /** Remote multicast server */
ECORE_CON_REMOTE_UDP = 5, /** Remote server using UDP */
ECORE_CON_REMOTE_BROADCAST = 6, /** Remote broadcast using UDP */
ECORE_CON_REMOTE_NODELAY = 7,
ECORE_CON_USE_SSL2 = (1 << 4),
ECORE_CON_USE_SSL3 = (1 << 5),
ECORE_CON_USE_TLS = (1 << 6)
} Ecore_Con_Type;
ECORE_CON_USE_SSL2 = (1 << 4), /** Use SSL2: UNSUPPORTED. **/
ECORE_CON_USE_SSL3 = (1 << 5), /** Use SSL3 */
ECORE_CON_USE_TLS = (1 << 6), /** Use TLS */
ECORE_CON_LOAD_CERT = (1 << 7) /** Attempt to use the previously loaded certificate */
} Ecore_Con_Type;
#define ECORE_CON_USE_SSL ECORE_CON_USE_SSL2
#define ECORE_CON_REMOTE_SYSTEM ECORE_CON_REMOTE_TCP
typedef enum _Ecore_Con_Url_Time
{
ECORE_CON_URL_TIME_NONE = 0,
ECORE_CON_URL_TIME_IFMODSINCE,
ECORE_CON_URL_TIME_IFUNMODSINCE,
ECORE_CON_URL_TIME_LASTMOD
} Ecore_Con_Url_Time;
typedef enum _Ecore_Con_Url_Time
{
ECORE_CON_URL_TIME_NONE = 0,
ECORE_CON_URL_TIME_IFMODSINCE,
ECORE_CON_URL_TIME_IFUNMODSINCE,
ECORE_CON_URL_TIME_LASTMOD
} Ecore_Con_Url_Time;
typedef struct _Ecore_Con_Event_Client_Add Ecore_Con_Event_Client_Add;
typedef struct _Ecore_Con_Event_Client_Del Ecore_Con_Event_Client_Del;
typedef struct _Ecore_Con_Event_Server_Add Ecore_Con_Event_Server_Add;
typedef struct _Ecore_Con_Event_Server_Del Ecore_Con_Event_Server_Del;
typedef struct _Ecore_Con_Event_Client_Data Ecore_Con_Event_Client_Data;
typedef struct _Ecore_Con_Event_Server_Data Ecore_Con_Event_Server_Data;
typedef struct _Ecore_Con_Event_Url_Data Ecore_Con_Event_Url_Data;
typedef struct _Ecore_Con_Event_Url_Complete Ecore_Con_Event_Url_Complete;
typedef struct _Ecore_Con_Event_Url_Progress Ecore_Con_Event_Url_Progress;
typedef struct _Ecore_Con_Event_Client_Add Ecore_Con_Event_Client_Add;
typedef struct _Ecore_Con_Event_Client_Del Ecore_Con_Event_Client_Del;
typedef struct _Ecore_Con_Event_Server_Add Ecore_Con_Event_Server_Add;
typedef struct _Ecore_Con_Event_Server_Del Ecore_Con_Event_Server_Del;
typedef struct _Ecore_Con_Event_Client_Data Ecore_Con_Event_Client_Data;
typedef struct _Ecore_Con_Event_Server_Data Ecore_Con_Event_Server_Data;
typedef struct _Ecore_Con_Event_Url_Data Ecore_Con_Event_Url_Data;
typedef struct _Ecore_Con_Event_Url_Complete Ecore_Con_Event_Url_Complete;
typedef struct _Ecore_Con_Event_Url_Progress Ecore_Con_Event_Url_Progress;
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Client_Add
{
Ecore_Con_Client *client;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Client_Add
{
Ecore_Con_Client *client;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Client_Del
{
Ecore_Con_Client *client;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Client_Del
{
Ecore_Con_Client *client;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Server_Add
{
Ecore_Con_Server *server;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Server_Add
{
Ecore_Con_Server *server;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Server_Del
{
Ecore_Con_Server *server;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Server_Del
{
Ecore_Con_Server *server;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Client_Data
{
Ecore_Con_Client *client;
void *data;
int size;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Client_Data
{
Ecore_Con_Client *client;
void *data;
int size;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Server_Data
{
Ecore_Con_Server *server;
void *data;
int size;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Server_Data
{
Ecore_Con_Server *server;
void *data;
int size;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Url_Data
{
Ecore_Con_Url *url_con;
int size;
unsigned char data[1];
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Url_Data
{
Ecore_Con_Url *url_con;
int size;
unsigned char data[1];
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Url_Complete
{
Ecore_Con_Url *url_con;
int status;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Url_Complete
{
Ecore_Con_Url *url_con;
int status;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Url_Progress
{
Ecore_Con_Url *url_con;
struct {
double total;
double now;
} down;
struct {
double total;
double now;
} up;
};
/// Used as the @p data param for the corresponding event
struct _Ecore_Con_Event_Url_Progress
{
Ecore_Con_Url *url_con;
struct
{
double total;
double now;
} down;
struct
{
double total;
double now;
} up;
};
EAPI extern int ECORE_CON_EVENT_CLIENT_ADD; /** A client has connected to the server */
EAPI extern int ECORE_CON_EVENT_CLIENT_DEL; /** A client has disconnected from the server */
EAPI extern int ECORE_CON_EVENT_SERVER_ADD; /** A server was created */
EAPI extern int ECORE_CON_EVENT_SERVER_DEL; /** A server connection was lost */
EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; /** A client connected to the server has sent data */
EAPI extern int ECORE_CON_EVENT_SERVER_DATA; /** A server connection object has data */
EAPI extern int ECORE_CON_EVENT_URL_DATA; /** A URL object has data */
EAPI extern int ECORE_CON_EVENT_URL_COMPLETE; /** A URL object has completed its transfer */
EAPI extern int ECORE_CON_EVENT_URL_PROGRESS; /** A URL object has made progress in its transfer */
EAPI extern int ECORE_CON_EVENT_CLIENT_ADD; /** A client has connected to the server */
EAPI extern int ECORE_CON_EVENT_CLIENT_DEL; /** A client has disconnected from the server */
EAPI extern int ECORE_CON_EVENT_SERVER_ADD; /** A server was created */
EAPI extern int ECORE_CON_EVENT_SERVER_DEL; /** A server connection was lost */
EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; /** A client connected to the server has sent data */
EAPI extern int ECORE_CON_EVENT_SERVER_DATA; /** A server connection object has data */
EAPI extern int ECORE_CON_EVENT_URL_DATA; /** A URL object has data */
EAPI extern int ECORE_CON_EVENT_URL_COMPLETE; /** A URL object has completed its transfer to and from the server and can be reused */
EAPI extern int ECORE_CON_EVENT_URL_PROGRESS; /** A URL object has made progress in its transfer */
EAPI int ecore_con_init(void);
EAPI int ecore_con_shutdown(void);
EAPI int ecore_con_init(void);
EAPI int ecore_con_shutdown(void);
EAPI Eina_Bool ecore_con_ssl_cert_add(const char *cert);
EAPI Ecore_Con_Server *ecore_con_server_add(Ecore_Con_Type type, const char *name, int port, const void *data);
EAPI Ecore_Con_Server *ecore_con_server_add(Ecore_Con_Type type,
const char *name, int port,
const void *data);
EAPI Ecore_Con_Server *ecore_con_server_connect(Ecore_Con_Type type, const char *name, int port, const void *data);
EAPI void *ecore_con_server_del(Ecore_Con_Server *svr);
EAPI void *ecore_con_server_data_get(Ecore_Con_Server *svr);
EAPI int ecore_con_server_connected_get(Ecore_Con_Server *svr);
EAPI Eina_List *ecore_con_server_clients_get(Ecore_Con_Server *svr);
EAPI int ecore_con_server_send(Ecore_Con_Server *svr, const void *data, int size);
EAPI void ecore_con_server_client_limit_set(Ecore_Con_Server *svr, int client_limit, char reject_excess_clients);
EAPI char *ecore_con_server_ip_get(Ecore_Con_Server *svr);
EAPI void ecore_con_server_flush(Ecore_Con_Server *svr);
EAPI Ecore_Con_Server *ecore_con_server_connect(Ecore_Con_Type type,
const char *name, int port,
const void *data);
EAPI void * ecore_con_server_del(Ecore_Con_Server *svr);
EAPI void * ecore_con_server_data_get(Ecore_Con_Server *svr);
EAPI int ecore_con_server_connected_get(Ecore_Con_Server *svr);
EAPI Eina_List * ecore_con_server_clients_get(Ecore_Con_Server *svr);
EAPI int ecore_con_server_send(Ecore_Con_Server *svr,
const void *data,
int size);
EAPI void ecore_con_server_client_limit_set(Ecore_Con_Server *svr,
int client_limit,
char
reject_excess_clients);
EAPI char * ecore_con_server_ip_get(Ecore_Con_Server *svr);
EAPI void ecore_con_server_flush(Ecore_Con_Server *svr);
EAPI int ecore_con_client_send(Ecore_Con_Client *cl, const void *data, int size);
EAPI Ecore_Con_Server *ecore_con_client_server_get(Ecore_Con_Client *cl);
EAPI void *ecore_con_client_del(Ecore_Con_Client *cl);
EAPI void ecore_con_client_data_set(Ecore_Con_Client *cl, const void *data);
EAPI void *ecore_con_client_data_get(Ecore_Con_Client *cl);
EAPI char *ecore_con_client_ip_get(Ecore_Con_Client *cl);
EAPI void ecore_con_client_flush(Ecore_Con_Client *cl);
EAPI int ecore_con_client_send(Ecore_Con_Client *cl,
const void *data,
int size);
EAPI Ecore_Con_Server *ecore_con_client_server_get(Ecore_Con_Client *cl);
EAPI void * ecore_con_client_del(Ecore_Con_Client *cl);
EAPI void ecore_con_client_data_set(Ecore_Con_Client *cl,
const void *data);
EAPI void * ecore_con_client_data_get(Ecore_Con_Client *cl);
EAPI char * ecore_con_client_ip_get(Ecore_Con_Client *cl);
EAPI void ecore_con_client_flush(Ecore_Con_Client *cl);
EAPI int ecore_con_ssl_available_get(void);
EAPI int ecore_con_ssl_available_get(void);
EAPI int ecore_con_url_init(void);
EAPI int ecore_con_url_shutdown(void);
EAPI Ecore_Con_Url *ecore_con_url_new(const char *url);
EAPI Ecore_Con_Url *ecore_con_url_custom_new(const char *url, const char *custom_request);
EAPI void ecore_con_url_destroy(Ecore_Con_Url *url_con);
EAPI void ecore_con_url_data_set(Ecore_Con_Url *url_con, void *data);
EAPI void *ecore_con_url_data_get(Ecore_Con_Url *url_con);
EAPI void ecore_con_url_additional_header_add(Ecore_Con_Url *url_con, const char *key, const char *value);
EAPI void ecore_con_url_additional_headers_clear(Ecore_Con_Url *url_con);
EAPI const Eina_List *ecore_con_url_response_headers_get(Ecore_Con_Url *url_con);
EAPI int ecore_con_url_url_set(Ecore_Con_Url *url_con, const char *url);
EAPI void ecore_con_url_fd_set(Ecore_Con_Url *url_con, int fd);
EAPI int ecore_con_url_received_bytes_get(Ecore_Con_Url *url_con);
EAPI int ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, const char *username, const char *password, Eina_Bool safe);
EAPI int ecore_con_url_send(Ecore_Con_Url *url_con, const void *data, size_t length, const char *content_type);
EAPI void ecore_con_url_time(Ecore_Con_Url *url_con, Ecore_Con_Url_Time condition, time_t tm);
EAPI int ecore_con_url_init(void);
EAPI int ecore_con_url_shutdown(void);
EAPI Ecore_Con_Url * ecore_con_url_new(const char *url);
EAPI Ecore_Con_Url * ecore_con_url_custom_new(const char *url,
const char *custom_request);
EAPI void ecore_con_url_destroy(Ecore_Con_Url *url_con);
EAPI void ecore_con_url_data_set(Ecore_Con_Url *url_con,
void *data);
EAPI void * ecore_con_url_data_get(Ecore_Con_Url *url_con);
EAPI void ecore_con_url_additional_header_add(
Ecore_Con_Url *url_con,
const char *key,
const char *value);
EAPI void ecore_con_url_additional_headers_clear(
Ecore_Con_Url *url_con);
EAPI const Eina_List * ecore_con_url_response_headers_get(
Ecore_Con_Url *url_con);
EAPI int ecore_con_url_url_set(Ecore_Con_Url *url_con,
const char *url);
EAPI void ecore_con_url_fd_set(Ecore_Con_Url *url_con, int fd);
EAPI int ecore_con_url_received_bytes_get(Ecore_Con_Url *url_con);
EAPI int ecore_con_url_httpauth_set(Ecore_Con_Url *url_con,
const char *username,
const char *password,
Eina_Bool safe);
EAPI int ecore_con_url_send(Ecore_Con_Url *url_con,
const void *data, size_t length,
const char *content_type);
EAPI void ecore_con_url_time(Ecore_Con_Url *url_con,
Ecore_Con_Url_Time condition,
time_t tm);
EAPI Eina_Bool ecore_con_lookup(const char *name, Ecore_Con_Dns_Cb done_cb, const void *data);
EAPI Eina_Bool ecore_con_lookup(const char *name,
Ecore_Con_Dns_Cb done_cb,
const void *data);
EAPI int ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, const char *filename, const char *user, const char *pass, const char *upload_dir);
EAPI void ecore_con_url_verbose_set(Ecore_Con_Url *url_con, int verbose);
EAPI void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, int use_epsv);
EAPI int ecore_con_url_http_post_send(Ecore_Con_Url *url_con, void *curl_httppost);
EAPI int ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
const char *filename,
const char *user,
const char *pass,
const char *upload_dir);
EAPI void ecore_con_url_verbose_set(Ecore_Con_Url *url_con,
int verbose);
EAPI void ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con,
int use_epsv);
EAPI int ecore_con_url_http_post_send(Ecore_Con_Url *url_con,
void *
curl_httppost);
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

View File

@ -51,24 +51,30 @@ static int active = 0;
static Ecore_Timer *tm = NULL;
static fd_set info_readers, info_writers;
static void _ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg, int status, int timeouts, char *node, char *service);
static void _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg, int status, int timeouts, struct hostent *hostent);
static Eina_Bool _ecore_con_info_cares_fd_cb(void *data, Ecore_Fd_Handler *fd_handler);
static void _ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg, int status,
int timeouts, char *node,
char *service);
static void _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg, int status,
int timeouts,
struct hostent *hostent);
static Eina_Bool _ecore_con_info_cares_fd_cb(void *data,
Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_con_info_cares_timeout_cb(void *data);
static void _ecore_con_info_cares_clean(void);
static void _ecore_con_info_cares_clean(void);
int
ecore_con_info_init(void)
{
if (info_init == 0)
{
if (ares_library_init(ARES_LIB_INIT_ALL) != 0)
return 0;
if (ares_init(&info_channel) != ARES_SUCCESS)
{
ares_library_cleanup();
return 0;
}
if (ares_library_init(ARES_LIB_INIT_ALL) != 0)
return 0;
if (ares_init(&info_channel) != ARES_SUCCESS)
{
ares_library_cleanup();
return 0;
}
}
info_init++;
@ -81,21 +87,22 @@ ecore_con_info_shutdown(void)
info_init--;
if (info_init == 0)
{
/* Cancel all ongoing request */
ares_cancel(info_channel);
ares_destroy(info_channel);
/* Cancel all ongoing request */
ares_cancel(info_channel);
ares_destroy(info_channel);
/* Destroy FD handler here. */
/* Shutdown ares */
ares_library_cleanup();
/* Destroy FD handler here. */
/* Shutdown ares */
ares_library_cleanup();
}
return info_init;
}
int
ecore_con_info_tcp_connect(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -113,8 +120,8 @@ ecore_con_info_tcp_connect(Ecore_Con_Server *svr,
int
ecore_con_info_tcp_listen(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -132,8 +139,8 @@ ecore_con_info_tcp_listen(Ecore_Con_Server *svr,
int
ecore_con_info_udp_connect(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -151,8 +158,8 @@ ecore_con_info_udp_connect(Ecore_Con_Server *svr,
int
ecore_con_info_udp_listen(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -170,8 +177,8 @@ ecore_con_info_udp_listen(Ecore_Con_Server *svr,
int
ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -189,19 +196,19 @@ ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
static Eina_Bool
_ecore_con_info_ares_getnameinfo(Ecore_Con_CAres *arg,
int addrtype, const char *name,
struct sockaddr *addr, int addrlen)
int addrtype, const char *name,
struct sockaddr *addr, int addrlen)
{
int length = 0;
if (name)
length = strlen(name) + 1;
length = strlen(name) + 1;
else
length = 1;
length = 1;
arg->result = malloc(sizeof (Ecore_Con_Info) + length);
if (!arg->result)
return EINA_FALSE;
return EINA_FALSE;
/* FIXME: What to do when hint is not set ? */
arg->result->info.ai_flags = arg->hints.ai_flags;
@ -211,18 +218,20 @@ _ecore_con_info_ares_getnameinfo(Ecore_Con_CAres *arg,
arg->result->info.ai_family = addrtype;
arg->result->info.ai_addrlen = addrlen;
arg->result->info.ai_addr = addr;
arg->result->info.ai_canonname = (char*) (arg->result + 1);
arg->result->info.ai_canonname = (char *)(arg->result + 1);
if (!name)
*arg->result->info.ai_canonname = '\0';
*arg->result->info.ai_canonname = '\0';
else
strcpy(arg->result->info.ai_canonname, name);
strcpy(arg->result->info.ai_canonname, name);
arg->result->info.ai_next = NULL;
ares_getnameinfo(info_channel, addr, addrlen,
ARES_NI_NUMERICSERV | ARES_NI_NUMERICHOST | ARES_NI_LOOKUPSERVICE | ARES_NI_LOOKUPHOST,
(ares_nameinfo_callback) _ecore_con_info_ares_nameinfo, arg);
ares_getnameinfo(
info_channel, addr, addrlen,
ARES_NI_NUMERICSERV | ARES_NI_NUMERICHOST |
ARES_NI_LOOKUPSERVICE | ARES_NI_LOOKUPHOST,
(ares_nameinfo_callback)_ecore_con_info_ares_nameinfo, arg);
return EINA_TRUE;
}
@ -230,15 +239,16 @@ _ecore_con_info_ares_getnameinfo(Ecore_Con_CAres *arg,
EAPI int
ecore_con_info_get(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data,
struct addrinfo *hints)
Ecore_Con_Info_Cb done_cb,
void *data,
struct addrinfo *hints)
{
Ecore_Con_CAres *cares;
int ai_family = AF_INET6;
cares = calloc(1, sizeof (Ecore_Con_CAres));
if (!cares) return 0;
if (!cares)
return 0;
cares->svr = svr;
cares->done_cb = done_cb;
@ -246,26 +256,36 @@ ecore_con_info_get(Ecore_Con_Server *svr,
if (hints)
{
ai_family = hints->ai_family;
memcpy(&cares->hints, hints, sizeof (struct addrinfo));
ai_family = hints->ai_family;
memcpy(&cares->hints, hints, sizeof (struct addrinfo));
}
if (inet_pton(AF_INET, svr->name, &cares->addr.v4) == 1)
{
cares->byaddr = EINA_TRUE;
cares->isv6 = EINA_FALSE;
ares_gethostbyaddr(info_channel, &cares->addr.v4, sizeof (cares->addr.v4), AF_INET, (ares_host_callback) _ecore_con_info_ares_host_cb, cares);
cares->byaddr = EINA_TRUE;
cares->isv6 = EINA_FALSE;
ares_gethostbyaddr(info_channel, &cares->addr.v4,
sizeof (cares->addr.v4),
AF_INET,
(ares_host_callback)_ecore_con_info_ares_host_cb,
cares);
}
else if (inet_pton(AF_INET6, svr->name, &cares->addr.v6) == 1)
{
cares->byaddr = EINA_TRUE;
cares->isv6 = EINA_TRUE;
ares_gethostbyaddr(info_channel, &cares->addr.v6, sizeof (cares->addr.v6), AF_INET6, (ares_host_callback) _ecore_con_info_ares_host_cb, cares);
cares->byaddr = EINA_TRUE;
cares->isv6 = EINA_TRUE;
ares_gethostbyaddr(info_channel, &cares->addr.v6,
sizeof (cares->addr.v6),
AF_INET6,
(ares_host_callback)_ecore_con_info_ares_host_cb,
cares);
}
else
{
cares->byaddr = EINA_FALSE;
ares_gethostbyname(info_channel, svr->name, ai_family, (ares_host_callback) _ecore_con_info_ares_host_cb, cares);
cares->byaddr = EINA_FALSE;
ares_gethostbyname(info_channel, svr->name, ai_family,
(ares_host_callback)_ecore_con_info_ares_host_cb,
cares);
}
_ecore_con_info_cares_clean();
@ -287,13 +307,15 @@ _ecore_con_info_fds_lookup(int fd)
fdl.fd = fd;
search = eina_list_search_unsorted(info_fds, (Eina_Compare_Cb) _ecore_con_info_fds_search, &fdl);
search = eina_list_search_unsorted(
info_fds, (Eina_Compare_Cb)_ecore_con_info_fds_search, &fdl);
if (search)
{
search->active = active;
return EINA_TRUE;
search->active = active;
return EINA_TRUE;
}
return EINA_FALSE;
}
@ -313,57 +335,65 @@ _ecore_con_info_cares_clean(void)
active++;
for (i = 0; i < nfds; ++i)
{
int flags = 0;
int flags = 0;
if (FD_ISSET(i, &readers)) flags |= ECORE_FD_READ;
if (FD_ISSET(i, &writers)) flags |= ECORE_FD_WRITE;
if (FD_ISSET(i, &readers))
flags |= ECORE_FD_READ;
if (FD_ISSET(i, &writers))
flags |= ECORE_FD_WRITE;
if (flags)
if (!_ecore_con_info_fds_lookup(i))
{
ecf = malloc(sizeof (Ecore_Con_FD));
if (ecf)
{
ecf->fd = i;
ecf->active = active;
ecf->handler = ecore_main_fd_handler_add(
i, ECORE_FD_WRITE | ECORE_FD_READ,
_ecore_con_info_cares_fd_cb,
NULL, NULL, NULL);
info_fds = eina_list_append(info_fds, ecf);
}
}
if (flags)
{
if (!_ecore_con_info_fds_lookup(i))
{
ecf = malloc(sizeof (Ecore_Con_FD));
if (ecf)
{
ecf->fd = i;
ecf->active = active;
ecf->handler = ecore_main_fd_handler_add(i, ECORE_FD_WRITE | ECORE_FD_READ,
_ecore_con_info_cares_fd_cb,
NULL, NULL, NULL);
info_fds = eina_list_append(info_fds, ecf);
}
}
}
}
info_readers = readers;
info_writers = writers;
EINA_LIST_FOREACH_SAFE(info_fds, l, l_next, ecf)
{
if (ecf->active != active)
{
ecore_main_fd_handler_del(ecf->handler);
free(ecf);
info_fds = eina_list_remove_list(info_fds, l);
}
}
{
if (ecf->active != active)
{
ecore_main_fd_handler_del(ecf->handler);
free(ecf);
info_fds = eina_list_remove_list(info_fds, l);
}
}
if (!info_fds)
{
if (tm) ecore_timer_del(tm);
tm = NULL;
if (tm)
ecore_timer_del(tm);
tm = NULL;
}
else
{
struct timeval tv;
struct timeval tv;
ares_timeout(info_channel, NULL, &tv);
ares_timeout(info_channel, NULL, &tv);
if (tm)
ecore_timer_delay(tm, tv.tv_sec);
else
tm = ecore_timer_add((double) tv.tv_sec, _ecore_con_info_cares_timeout_cb, NULL);
if (tm)
ecore_timer_delay(tm, tv.tv_sec);
else
tm =
ecore_timer_add((double)tv.tv_sec,
_ecore_con_info_cares_timeout_cb,
NULL);
}
}
@ -386,7 +416,8 @@ _ecore_con_info_cares_fd_cb(void *data, Ecore_Fd_Handler *fd_handler)
}
static void
_ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg, int status, int timeouts, struct hostent *hostent)
_ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg, int status, int timeouts,
struct hostent *hostent)
{
struct sockaddr *addr;
int addrlen;
@ -396,147 +427,172 @@ _ecore_con_info_ares_host_cb(Ecore_Con_CAres *arg, int status, int timeouts, str
switch (status)
{
case ARES_SUCCESS:
if (hostent->h_addr_list[0] == NULL)
{
fprintf(stderr, "No IP found\n");
goto on_error;
}
if (hostent->h_addr_list[0] == NULL)
{
fprintf(stderr, "No IP found\n");
goto on_error;
}
switch (hostent->h_addrtype)
{
case AF_INET:
{
struct sockaddr_in *addri;
switch (hostent->h_addrtype)
{
case AF_INET:
{
struct sockaddr_in *addri;
addrlen = sizeof (struct sockaddr_in);
addri = malloc(addrlen);
addrlen = sizeof (struct sockaddr_in);
addri = malloc(addrlen);
if (!addri) goto on_mem_error;
if (!addri)
goto on_mem_error;
addri->sin_family = AF_INET;
addri->sin_port = htons(arg->svr->port);
addri->sin_family = AF_INET;
addri->sin_port = htons(arg->svr->port);
memcpy(&addri->sin_addr.s_addr,
hostent->h_addr_list[0], sizeof (struct in_addr));
memcpy(&addri->sin_addr.s_addr,
hostent->h_addr_list[0], sizeof (struct in_addr));
addr = (struct sockaddr*) addri;
break;
}
case AF_INET6:
{
struct sockaddr_in6 *addri6;
addr = (struct sockaddr *)addri;
break;
}
addrlen = sizeof (struct sockaddr_in6);
addri6 = malloc(addrlen);
case AF_INET6:
{
struct sockaddr_in6 *addri6;
if (!addri6) goto on_mem_error;
addrlen = sizeof (struct sockaddr_in6);
addri6 = malloc(addrlen);
addri6->sin6_family = AF_INET6;
addri6->sin6_port = htons(arg->svr->port);
addri6->sin6_flowinfo = 0;
addri6->sin6_scope_id = 0;
if (!addri6)
goto on_mem_error;
memcpy(&addri6->sin6_addr.s6_addr,
hostent->h_addr_list[0], sizeof (struct in6_addr));
addri6->sin6_family = AF_INET6;
addri6->sin6_port = htons(arg->svr->port);
addri6->sin6_flowinfo = 0;
addri6->sin6_scope_id = 0;
addr = (struct sockaddr*) addri6;
break;
}
default:
fprintf(stderr, "Unknown addrtype %i\n", hostent->h_addrtype);
goto on_error;
}
memcpy(&addri6->sin6_addr.s6_addr,
hostent->h_addr_list[0], sizeof (struct in6_addr));
addr = (struct sockaddr *)addri6;
break;
}
default:
fprintf(stderr, "Unknown addrtype %i\n", hostent->h_addrtype);
goto on_error;
}
if (!_ecore_con_info_ares_getnameinfo(arg, hostent->h_addrtype,
hostent->h_name,
addr, addrlen))
goto on_error;
break;
if (!_ecore_con_info_ares_getnameinfo(arg, hostent->h_addrtype, hostent->h_name,
addr, addrlen))
goto on_error;
break;
case ARES_ENOTFOUND: /* address notfound */
if (arg->byaddr)
{
/* This happen when host doesn't have a reverse. */
if (arg->isv6)
{
struct sockaddr_in6 *addri6;
if (arg->byaddr)
{
/* This happen when host doesn't have a reverse. */
if (arg->isv6)
{
struct sockaddr_in6 *addri6;
addrlen = sizeof (struct sockaddr_in6);
addri6 = malloc(addrlen);
addrlen = sizeof (struct sockaddr_in6);
addri6 = malloc(addrlen);
if (!addri6) goto on_mem_error;
if (!addri6)
goto on_mem_error;
addri6->sin6_family = AF_INET6;
addri6->sin6_port = htons(arg->svr->port);
addri6->sin6_flowinfo = 0;
addri6->sin6_scope_id = 0;
addri6->sin6_family = AF_INET6;
addri6->sin6_port = htons(arg->svr->port);
addri6->sin6_flowinfo = 0;
addri6->sin6_scope_id = 0;
memcpy(&addri6->sin6_addr.s6_addr,
&arg->addr.v6, sizeof (struct in6_addr));
memcpy(&addri6->sin6_addr.s6_addr,
&arg->addr.v6, sizeof (struct in6_addr));
addr = (struct sockaddr*) addri6;
}
else
{
struct sockaddr_in *addri;
addr = (struct sockaddr *)addri6;
}
else
{
struct sockaddr_in *addri;
addrlen = sizeof (struct sockaddr_in);
addri = malloc(addrlen);
addrlen = sizeof (struct sockaddr_in);
addri = malloc(addrlen);
if (!addri) goto on_mem_error;
if (!addri)
goto on_mem_error;
addri->sin_family = AF_INET;
addri->sin_port = htons(arg->svr->port);
addri->sin_family = AF_INET;
addri->sin_port = htons(arg->svr->port);
memcpy(&addri->sin_addr.s_addr,
&arg->addr.v4, sizeof (struct in_addr));
memcpy(&addri->sin_addr.s_addr,
&arg->addr.v4, sizeof (struct in_addr));
addr = (struct sockaddr*) addri;
}
addr = (struct sockaddr *)addri;
}
if (!_ecore_con_info_ares_getnameinfo(arg,
arg->isv6 ? AF_INET6 :
AF_INET,
NULL, addr,
addrlen))
goto on_error;
break;
}
if (!_ecore_con_info_ares_getnameinfo(arg, arg->isv6 ? AF_INET6 : AF_INET,
NULL, addr, addrlen))
goto on_error;
break;
}
case ARES_ENOTIMP: /* unknown family */
case ARES_EBADNAME: /* not a valid internet address */
case ARES_ENOMEM: /* not enough memory */
case ARES_EDESTRUCTION: /* request canceled, shuting down */
goto on_error;
goto on_error;
default:
fprintf(stderr, "Unknown status returned by c-ares: %i assuming error\n", status);
goto on_error;
fprintf(stderr,
"Unknown status returned by c-ares: %i assuming error\n",
status);
goto on_error;
}
return ;
return;
on_mem_error:
fprintf(stderr, "Not enough memory\n");
on_mem_error:
fprintf(stderr, "Not enough memory\n");
on_error:
on_error:
arg->done_cb(arg->data, NULL);
free(arg);
}
static void
_ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg, int status, int timeouts, char *node, char *service)
_ecore_con_info_ares_nameinfo(Ecore_Con_CAres *arg, int status, int timeouts,
char *node,
char *service)
{
switch (status)
{
case ARES_SUCCESS:
if (node) strcpy(arg->result->ip, node);
else *arg->result->ip = '\0';
if (service) strcpy(arg->result->service, service);
else *arg->result->service = '\0';
if (node)
strcpy(arg->result->ip, node);
else
*arg->result->ip = '\0';
if (service)
strcpy(arg->result->service, service);
else
*arg->result->service = '\0';
arg->done_cb(arg->data, arg->result);
break;
arg->done_cb(arg->data, arg->result);
break;
case ARES_ENOTIMP:
case ARES_ENOTFOUND:
case ARES_ENOMEM:
case ARES_EDESTRUCTION:
case ARES_EBADFLAGS:
arg->done_cb(arg->data, NULL);
break;
arg->done_cb(arg->data, NULL);
break;
}
free(arg->result->info.ai_addr);

View File

@ -76,10 +76,12 @@ struct _CB_Data
};
static void _ecore_con_info_readdata(CB_Data *cbdata);
static void _ecore_con_info_slave_free(CB_Data *cbdata);
static Eina_Bool _ecore_con_info_data_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_con_info_exit_handler(void *data, int type __UNUSED__, void *event);
static void _ecore_con_info_readdata(CB_Data *cbdata);
static void _ecore_con_info_slave_free(CB_Data *cbdata);
static Eina_Bool _ecore_con_info_data_handler(void *data,
Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_con_info_exit_handler(void *data, int type __UNUSED__,
void *event);
static int info_init = 0;
static CB_Data *info_slaves = NULL;
@ -96,16 +98,15 @@ ecore_con_info_shutdown(void)
{
info_init--;
if (info_init == 0)
{
while (info_slaves) _ecore_con_info_slave_free(info_slaves);
}
while (info_slaves) _ecore_con_info_slave_free(info_slaves);
return info_init;
}
int
ecore_con_info_tcp_connect(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -123,8 +124,8 @@ ecore_con_info_tcp_connect(Ecore_Con_Server *svr,
int
ecore_con_info_tcp_listen(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -142,8 +143,8 @@ ecore_con_info_tcp_listen(Ecore_Con_Server *svr,
int
ecore_con_info_udp_connect(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -161,8 +162,8 @@ ecore_con_info_udp_connect(Ecore_Con_Server *svr,
int
ecore_con_info_udp_listen(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -180,8 +181,8 @@ ecore_con_info_udp_listen(Ecore_Con_Server *svr,
int
ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data)
Ecore_Con_Info_Cb done_cb,
void *data)
{
struct addrinfo hints;
@ -199,98 +200,119 @@ ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
EAPI int
ecore_con_info_get(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data,
struct addrinfo *hints)
Ecore_Con_Info_Cb done_cb,
void *data,
struct addrinfo *hints)
{
CB_Data *cbdata;
int fd[2];
if (pipe(fd) < 0) return 0;
if (pipe(fd) < 0)
return 0;
cbdata = calloc(1, sizeof(CB_Data));
if (!cbdata)
{
close(fd[0]);
close(fd[1]);
return 0;
close(fd[0]);
close(fd[1]);
return 0;
}
cbdata->cb_done = done_cb;
cbdata->data = data;
cbdata->fd2 = fd[1];
if (!(cbdata->fdh = ecore_main_fd_handler_add(fd[0], ECORE_FD_READ,
_ecore_con_info_data_handler,
cbdata,
NULL, NULL)))
_ecore_con_info_data_handler,
cbdata,
NULL, NULL)))
{
free(cbdata);
close(fd[0]);
close(fd[1]);
return 0;
free(cbdata);
close(fd[0]);
close(fd[1]);
return 0;
}
if ((cbdata->pid = fork()) == 0)
{
Ecore_Con_Info *container;
struct addrinfo *result = NULL;
char service[NI_MAXSERV];
char hbuf[NI_MAXHOST];
char sbuf[NI_MAXSERV];
void *tosend = NULL;
int tosend_len;
int canonname_len = 0;
int err;
struct addrinfo *result = NULL;
char service[NI_MAXSERV];
char hbuf[NI_MAXHOST];
char sbuf[NI_MAXSERV];
void *tosend = NULL;
int tosend_len;
int canonname_len = 0;
int err;
eina_convert_itoa(svr->port, service);
/* CHILD */
if (!getaddrinfo(svr->name, service, hints, &result) && result)
{
if (result->ai_canonname)
canonname_len = strlen(result->ai_canonname) + 1;
tosend_len = sizeof(Ecore_Con_Info) + result->ai_addrlen + canonname_len;
eina_convert_itoa(svr->port, service);
/* CHILD */
if (!getaddrinfo(svr->name, service, hints, &result) && result)
{
if (result->ai_canonname)
canonname_len =
strlen(result->ai_canonname) + 1;
if (!(tosend = alloca(tosend_len)))
goto on_error;
tosend_len = sizeof(Ecore_Con_Info) + result->ai_addrlen +
canonname_len;
container = (Ecore_Con_Info *)tosend;
if (!(tosend = alloca(tosend_len)))
goto on_error;
container->size = tosend_len;
container = (Ecore_Con_Info *)tosend;
memcpy(&container->info, result, sizeof(struct addrinfo));
memcpy((char *)tosend + sizeof(Ecore_Con_Info), result->ai_addr, result->ai_addrlen);
memcpy((char *)tosend + sizeof(Ecore_Con_Info) + result->ai_addrlen, result->ai_canonname, canonname_len);
container->size = tosend_len;
if (!getnameinfo(result->ai_addr, result->ai_addrlen,
hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),
NI_NUMERICHOST | NI_NUMERICSERV))
{
memcpy(container->ip, hbuf, sizeof(container->ip));
memcpy(container->service, sbuf, sizeof(container->service));
}
err = write(fd[1], tosend, tosend_len);
}
memcpy(&container->info,
result,
sizeof(struct addrinfo));
memcpy((char *)tosend + sizeof(Ecore_Con_Info),
result->ai_addr,
result->ai_addrlen);
memcpy(
(char *)tosend + sizeof(Ecore_Con_Info) + result->ai_addrlen,
result->ai_canonname,
canonname_len);
if (!getnameinfo(result->ai_addr, result->ai_addrlen,
hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),
NI_NUMERICHOST | NI_NUMERICSERV))
{
memcpy(container->ip, hbuf, sizeof(container->ip));
memcpy(container->service, sbuf, sizeof(container->service));
}
err = write(fd[1], tosend, tosend_len);
}
on_error:
if (result)
freeaddrinfo(result);
err = write(fd[1], "", 1);
close(fd[1]);
if (result)
freeaddrinfo(result);
err = write(fd[1], "", 1);
close(fd[1]);
# ifdef __USE_ISOC99
_Exit(0);
_Exit(0);
# else
_exit(0);
_exit(0);
# endif
}
/* PARENT */
cbdata->handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _ecore_con_info_exit_handler, cbdata);
cbdata->handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _ecore_con_info_exit_handler,
cbdata);
close(fd[1]);
if (!cbdata->handler)
{
ecore_main_fd_handler_del(cbdata->fdh);
free(cbdata);
close(fd[0]);
return 0;
ecore_main_fd_handler_del(cbdata->fdh);
free(cbdata);
close(fd[0]);
return 0;
}
info_slaves = (CB_Data *) eina_inlist_append(EINA_INLIST_GET(info_slaves), EINA_INLIST_GET(cbdata));
info_slaves = (CB_Data *)eina_inlist_append(EINA_INLIST_GET(
info_slaves),
EINA_INLIST_GET(cbdata));
return 1;
}
@ -305,43 +327,53 @@ _ecore_con_info_readdata(CB_Data *cbdata)
ssize_t size;
size = read(ecore_main_fd_handler_fd_get(cbdata->fdh), &container,
sizeof(Ecore_Con_Info));
sizeof(Ecore_Con_Info));
if (size == sizeof(Ecore_Con_Info))
{
torecv_len = container.size;
torecv = malloc(torecv_len);
torecv = malloc(torecv_len);
memcpy(torecv, &container, sizeof(Ecore_Con_Info));
memcpy(torecv, &container, sizeof(Ecore_Con_Info));
size = read(ecore_main_fd_handler_fd_get(cbdata->fdh), (char *)torecv + sizeof(Ecore_Con_Info),
torecv_len - sizeof(Ecore_Con_Info));
if ((size > 0) && ((size_t)size == torecv_len - sizeof(Ecore_Con_Info)))
{
recv = (Ecore_Con_Info *)torecv;
size = read(ecore_main_fd_handler_fd_get(
cbdata->fdh), (char *)torecv + sizeof(Ecore_Con_Info),
torecv_len - sizeof(Ecore_Con_Info));
if ((size > 0) && ((size_t)size == torecv_len - sizeof(Ecore_Con_Info)))
{
recv = (Ecore_Con_Info *)torecv;
recv->info.ai_addr = (struct sockaddr *)((char *)torecv + sizeof(Ecore_Con_Info));
if ((size_t)torecv_len != (sizeof(Ecore_Con_Info) + recv->info.ai_addrlen))
recv->info.ai_canonname = (char *)torecv + sizeof(Ecore_Con_Info) + recv->info.ai_addrlen;
else
recv->info.ai_canonname = NULL;
recv->info.ai_next = NULL;
recv->info.ai_addr =
(struct sockaddr *)((char *)torecv + sizeof(Ecore_Con_Info));
if ((size_t)torecv_len !=
(sizeof(Ecore_Con_Info) +
recv->info.ai_addrlen))
recv->info.ai_canonname =
(char *)torecv +
sizeof(Ecore_Con_Info) + recv->info.ai_addrlen;
else
recv->info.ai_canonname = NULL;
cbdata->cb_done(cbdata->data, recv);
recv->info.ai_next = NULL;
free(torecv);
}
else
cbdata->cb_done(cbdata->data, NULL);
cbdata->cb_done(cbdata->data, recv);
free(torecv);
}
else
cbdata->cb_done(cbdata->data, NULL);
}
else
cbdata->cb_done(cbdata->data, NULL);
cbdata->cb_done(cbdata->data, NULL);
cbdata->cb_done = NULL;
}
static void
_ecore_con_info_slave_free(CB_Data *cbdata)
{
info_slaves = (CB_Data *) eina_inlist_remove(EINA_INLIST_GET(info_slaves), EINA_INLIST_GET(cbdata));
info_slaves = (CB_Data *)eina_inlist_remove(EINA_INLIST_GET(
info_slaves),
EINA_INLIST_GET(cbdata));
close(ecore_main_fd_handler_fd_get(cbdata->fdh));
ecore_main_fd_handler_del(cbdata->fdh);
ecore_event_handler_del(cbdata->handler);
@ -356,14 +388,16 @@ _ecore_con_info_data_handler(void *data, Ecore_Fd_Handler *fd_handler)
cbdata = data;
if (cbdata->cb_done)
{
if (ecore_main_fd_handler_active_get(fd_handler, ECORE_FD_READ))
_ecore_con_info_readdata(cbdata);
else
{
cbdata->cb_done(cbdata->data, NULL);
cbdata->cb_done = NULL;
}
if (ecore_main_fd_handler_active_get(fd_handler,
ECORE_FD_READ))
_ecore_con_info_readdata(cbdata);
else
{
cbdata->cb_done(cbdata->data, NULL);
cbdata->cb_done = NULL;
}
}
_ecore_con_info_slave_free(cbdata);
return ECORE_CALLBACK_CANCEL;
}
@ -376,7 +410,9 @@ _ecore_con_info_exit_handler(void *data, int type __UNUSED__, void *event)
ev = event;
cbdata = data;
if (cbdata->pid != ev->pid) return ECORE_CALLBACK_RENEW;
if (cbdata->pid != ev->pid)
return ECORE_CALLBACK_RENEW;
return ECORE_CALLBACK_CANCEL; /* FIXME: Woot ??? */
_ecore_con_info_slave_free(cbdata);
return ECORE_CALLBACK_CANCEL;

View File

@ -36,8 +36,12 @@
#include "ecore_con_private.h"
#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
#define LENGTH_OF_ABSTRACT_SOCKADDR_UN(s, path) (strlen(path) + 1 + (size_t)(((struct sockaddr_un *)NULL)->sun_path))
#define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + \
(size_t)(((struct sockaddr_un *)NULL)-> \
sun_path))
#define LENGTH_OF_ABSTRACT_SOCKADDR_UN(s, path) (strlen(path) + 1 + \
(size_t)(((struct sockaddr_un \
*)NULL)->sun_path))
static int _ecore_con_local_init_count = 0;
@ -46,7 +50,7 @@ int
ecore_con_local_init(void)
{
if (++_ecore_con_local_init_count != 1)
return _ecore_con_local_init_count;
return _ecore_con_local_init_count;
return _ecore_con_local_init_count;
}
@ -55,200 +59,277 @@ int
ecore_con_local_shutdown(void)
{
if (--_ecore_con_local_init_count != 0)
return _ecore_con_local_init_count;
return _ecore_con_local_init_count;
return _ecore_con_local_init_count;
}
int
ecore_con_local_connect(Ecore_Con_Server *svr,
Eina_Bool (*cb_done)(void *data, Ecore_Fd_Handler *fd_handler),
void *data __UNUSED__,
void (*cb_free)(void *data, void *ev))
Eina_Bool (*cb_done)(void *data,
Ecore_Fd_Handler *fd_handler),
void *data __UNUSED__,
void (*cb_free)(void *data, void *ev))
{
char buf[4096];
char buf[4096];
struct sockaddr_un socket_unix;
int curstate = 0;
const char *homedir;
int socket_unix_len;
int curstate = 0;
const char *homedir;
int socket_unix_len;
if (svr->type == ECORE_CON_LOCAL_USER)
{
homedir = getenv("HOME");
if (!homedir) homedir = getenv("TMP");
if (!homedir) homedir = "/tmp";
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name, svr->port);
homedir = getenv("HOME");
if (!homedir)
homedir = getenv("TMP");
if (!homedir)
homedir = "/tmp";
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name,
svr->port);
}
else if (svr->type == ECORE_CON_LOCAL_SYSTEM)
{
if (svr->port < 0)
{
if (svr->name[0] == '/')
strncpy(buf, svr->name, sizeof(buf));
else
snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s", svr->name);
}
else
{
if (svr->name[0] == '/')
snprintf(buf, sizeof(buf), "%s|%i", svr->name, svr->port);
else
snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i", svr->name, svr->port);
}
if (svr->port < 0)
{
if (svr->name[0] == '/')
strncpy(buf, svr->name, sizeof(buf));
else
snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s", svr->name);
}
else
{
if (svr->name[0] ==
'/')
snprintf(buf, sizeof(buf), "%s|%i", svr->name,
svr->port);
else
snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i",
svr->name,
svr->port);
}
}
else if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
strncpy(buf, svr->name, sizeof(buf));
strncpy(buf, svr->name,
sizeof(buf));
svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (svr->fd < 0) return 0;
if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) return 0;
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) return 0;
if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate, sizeof(curstate)) < 0) return 0;
if (svr->fd < 0)
return 0;
if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0)
return 0;
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
return 0;
if (setsockopt(svr->fd, SOL_SOCKET, SO_REUSEADDR, (const void *)&curstate,
sizeof(curstate)) < 0)
return 0;
socket_unix.sun_family = AF_UNIX;
if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
{
#ifdef HAVE_ABSTRACT_SOCKETS
/* copy name insto sun_path, prefixed by null to indicate abstract namespace */
snprintf(socket_unix.sun_path, sizeof(socket_unix.sun_path), ".%s", svr->name);
socket_unix.sun_path[0] = '\0';
socket_unix_len = LENGTH_OF_ABSTRACT_SOCKADDR_UN(&socket_unix, svr->name);
/* copy name insto sun_path, prefixed by null to indicate abstract namespace */
snprintf(socket_unix.sun_path, sizeof(socket_unix.sun_path), ".%s",
svr->name);
socket_unix.sun_path[0] = '\0';
socket_unix_len = LENGTH_OF_ABSTRACT_SOCKADDR_UN(&socket_unix,
svr->name);
#else
WRN("Your system does not support abstract sockets!");
return 0;
WRN("Your system does not support abstract sockets!");
return 0;
#endif
}
else
{
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
}
if (connect(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
return 0;
if (connect(svr->fd, (struct sockaddr *)&socket_unix,
socket_unix_len) < 0)
return 0;
svr->path = strdup(buf);
if (!svr->path) return 0;
if (!svr->path)
return 0;
if (svr->type & ECORE_CON_SSL)
ecore_con_ssl_server_init(svr);
ecore_con_ssl_server_init(svr);
svr->fd_handler =
ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ,
cb_done, svr, NULL, NULL);
if (!svr->fd_handler) return 0;
ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ,
cb_done, svr, NULL, NULL);
if (!svr->fd_handler)
return 0;
if (!svr->delete_me)
{
/* we got our server! */
Ecore_Con_Event_Server_Add *e;
/* we got our server! */
Ecore_Con_Event_Server_Add *e;
e = calloc(1, sizeof(Ecore_Con_Event_Server_Add));
if (e)
{
svr->event_count++;
e->server = svr;
ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e,
cb_free, NULL);
}
e = calloc(1, sizeof(Ecore_Con_Event_Server_Add));
if (e)
{
svr->event_count++;
e->server = svr;
ecore_event_add(ECORE_CON_EVENT_SERVER_ADD, e,
cb_free, NULL);
}
}
return 1;
}
int
ecore_con_local_listen(Ecore_Con_Server *svr,
Eina_Bool (*cb_listen)(void *data, Ecore_Fd_Handler *fd_handler),
void *data __UNUSED__)
ecore_con_local_listen(
Ecore_Con_Server *svr,
Eina_Bool (*
cb_listen)(void *data,
Ecore_Fd_Handler *
fd_handler),
void *data
__UNUSED__)
{
char buf[4096];
char buf[4096];
struct sockaddr_un socket_unix;
struct linger lin;
mode_t pmode;
const char *homedir;
struct stat st;
mode_t mask;
int socket_unix_len;
struct linger lin;
mode_t pmode;
const char *homedir;
struct stat st;
mode_t mask;
int socket_unix_len;
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
if (svr->type == ECORE_CON_LOCAL_USER)
{
homedir = getenv("HOME");
if (!homedir) homedir = getenv("TMP");
if (!homedir) homedir = "/tmp";
mask = S_IRUSR | S_IWUSR | S_IXUSR;
snprintf(buf, sizeof(buf), "%s/.ecore", homedir);
if (stat(buf, &st) < 0) mkdir(buf, mask);
snprintf(buf, sizeof(buf), "%s/.ecore/%s", homedir, svr->name);
if (stat(buf, &st) < 0) mkdir(buf, mask);
snprintf(buf, sizeof(buf), "%s/.ecore/%s/%i", homedir, svr->name, svr->port);
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
homedir = getenv("HOME");
if (!homedir)
homedir = getenv("TMP");
if (!homedir)
homedir = "/tmp";
mask = S_IRUSR | S_IWUSR | S_IXUSR;
snprintf(buf, sizeof(buf), "%s/.ecore", homedir);
if (stat(buf, &st) < 0)
mkdir(buf, mask);
snprintf(buf, sizeof(buf), "%s/.ecore/%s", homedir, svr->name);
if (stat(buf, &st) < 0)
mkdir(buf, mask);
snprintf(buf,
sizeof(buf),
"%s/.ecore/%s/%i",
homedir,
svr->name,
svr->port);
mask = S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH;
}
else if (svr->type == ECORE_CON_LOCAL_SYSTEM)
{
mask = 0;
if (svr->name[0] == '/')
{
if (svr->port >= 0)
snprintf(buf, sizeof(buf), "%s|%i", svr->name, svr->port);
else
snprintf(buf, sizeof(buf), "%s", svr->name);
}
else
snprintf(buf, sizeof(buf), "/tmp/.ecore_service|%s|%i", svr->name, svr->port);
mask = 0;
if (svr->name[0] == '/')
{
if (svr->port >= 0)
snprintf(buf,
sizeof(buf),
"%s|%i",
svr->name,
svr->port);
else
snprintf(buf,
sizeof(buf),
"%s",
svr->name);
}
else
snprintf(buf,
sizeof(buf),
"/tmp/.ecore_service|%s|%i",
svr->name,
svr->port);
}
else if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
strncpy(buf, svr->name, sizeof(buf));
strncpy(buf, svr->name,
sizeof(buf));
pmode = umask(mask);
start:
start:
svr->fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (svr->fd < 0) goto error_umask;
if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0) goto error_umask;
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0) goto error_umask;
if (svr->fd < 0)
goto error_umask;
if (fcntl(svr->fd, F_SETFL, O_NONBLOCK) < 0)
goto error_umask;
if (fcntl(svr->fd, F_SETFD, FD_CLOEXEC) < 0)
goto error_umask;
lin.l_onoff = 1;
lin.l_linger = 0;
if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, (const void *)&lin, sizeof(struct linger)) < 0) goto error_umask;
if (setsockopt(svr->fd, SOL_SOCKET, SO_LINGER, (const void *)&lin,
sizeof(struct linger)) < 0)
goto error_umask;
socket_unix.sun_family = AF_UNIX;
if (svr->type == ECORE_CON_LOCAL_ABSTRACT)
{
#ifdef HAVE_ABSTRACT_SOCKETS
/* . is a placeholder */
snprintf(socket_unix.sun_path, sizeof(socket_unix.sun_path), ".%s", svr->name);
/* first char null indicates abstract namespace */
socket_unix.sun_path[0] = '\0';
socket_unix_len = LENGTH_OF_ABSTRACT_SOCKADDR_UN(&socket_unix, svr->name);
/* . is a placeholder */
snprintf(socket_unix.sun_path, sizeof(socket_unix.sun_path), ".%s",
svr->name);
/* first char null indicates abstract namespace */
socket_unix.sun_path[0] = '\0';
socket_unix_len = LENGTH_OF_ABSTRACT_SOCKADDR_UN(&socket_unix,
svr->name);
#else
ERR("Your system does not support abstract sockets!");
goto error_umask;
ERR("Your system does not support abstract sockets!");
goto error_umask;
#endif
}
else
{
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path));
socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix);
}
if (bind(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0)
{
if (((svr->type == ECORE_CON_LOCAL_USER) || (svr->type == ECORE_CON_LOCAL_SYSTEM)) &&
(connect(svr->fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) &&
(unlink(buf) >= 0))
goto start;
else
goto error_umask;
if (((svr->type == ECORE_CON_LOCAL_USER) ||
(svr->type == ECORE_CON_LOCAL_SYSTEM)) &&
(connect(svr->fd, (struct sockaddr *)&socket_unix,
socket_unix_len) < 0) &&
(unlink(buf) >= 0))
goto start;
else
goto error_umask;
}
if (listen(svr->fd, 4096) < 0) goto error_umask;
if (listen(svr->fd, 4096) < 0)
goto error_umask;
svr->path = strdup(buf);
if (!svr->path) goto error_umask;
if (!svr->path)
goto error_umask;
svr->fd_handler =
ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ,
cb_listen, svr, NULL, NULL);
ecore_main_fd_handler_add(svr->fd, ECORE_FD_READ,
cb_listen, svr, NULL, NULL);
umask(pmode);
if (!svr->fd_handler) goto error;
if (!svr->fd_handler)
goto error;
return 1;
error_umask:
error_umask:
umask(pmode);
error:
error:
return 0;
}

View File

@ -22,7 +22,7 @@
#define READBUFSIZ 65536
extern int _ecore_con_log_dom ;
extern int _ecore_con_log_dom;
#ifdef ECORE_CON_DEFAULT_LOG_COLOR
#undef ECORE_LOG_DEFAULT_LOG_COLOR
@ -60,112 +60,113 @@ typedef struct _Ecore_Con_Info Ecore_Con_Info;
typedef void (*Ecore_Con_Info_Cb)(void *data, Ecore_Con_Info *infos);
typedef enum _Ecore_Con_State
{
ECORE_CON_CONNECTED,
ECORE_CON_DISCONNECTED,
ECORE_CON_INPROGRESS
} Ecore_Con_State;
{
ECORE_CON_CONNECTED,
ECORE_CON_DISCONNECTED,
ECORE_CON_INPROGRESS
} Ecore_Con_State;
typedef enum _Ecore_Con_Ssl_Error
{
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;
{
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;
struct _Ecore_Con_Client
{
ECORE_MAGIC;
int fd;
int fd;
Ecore_Con_Server *server;
void *data;
void *data;
Ecore_Fd_Handler *fd_handler;
int buf_size;
int buf_offset;
unsigned char *buf;
char *ip;
int event_count;
struct sockaddr *client_addr;
int client_addr_len;
int buf_size;
int buf_offset;
unsigned char *buf;
char *ip;
int event_count;
struct sockaddr *client_addr;
int client_addr_len;
#if USE_GNUTLS
gnutls_session session;
gnutls_session session;
#elif USE_OPENSSL
SSL_CTX *ssl_ctx;
SSL *ssl;
int ssl_err;
SSL_CTX *ssl_ctx;
SSL *ssl;
int ssl_err;
#endif
char dead : 1;
char delete_me : 1;
char dead : 1;
char delete_me : 1;
};
struct _Ecore_Con_Server
{
ECORE_MAGIC;
int fd;
Ecore_Con_Type type;
char *name;
int port;
char *path;
void *data;
int fd;
Ecore_Con_Type type;
char *name;
int port;
char *path;
void *data;
Ecore_Fd_Handler *fd_handler;
Eina_List *clients;
int write_buf_size;
int write_buf_offset;
unsigned char *write_buf;
int event_count;
int client_limit;
pid_t ppid;
Eina_List *clients;
int write_buf_size;
int write_buf_offset;
unsigned char *write_buf;
int event_count;
int client_limit;
pid_t ppid;
#if USE_GNUTLS
gnutls_session session;
gnutls_session session;
gnutls_anon_client_credentials_t anoncred_c;
gnutls_anon_server_credentials_t anoncred_s;
gnutls_certificate_credentials_t cert;
#elif USE_OPENSSL
SSL_CTX *ssl_ctx;
SSL *ssl;
int ssl_err;
SSL_CTX *ssl_ctx;
SSL *ssl;
int ssl_err;
#endif
char *ip;
char dead : 1;
char created : 1;
char connecting : 1;
char reject_excess_clients : 1;
char delete_me : 1;
char *ip;
char dead : 1;
char created : 1;
char connecting : 1;
char reject_excess_clients : 1;
char delete_me : 1;
};
#ifdef HAVE_CURL
struct _Ecore_Con_Url
{
ECORE_MAGIC;
CURL *curl_easy;
CURL *curl_easy;
struct curl_slist *headers;
struct curl_httppost* post;
Eina_List *additional_headers;
Eina_List *response_headers;
char *url;
struct curl_httppost *post;
Eina_List *additional_headers;
Eina_List *response_headers;
char *url;
Ecore_Con_Url_Time condition;
time_t time;
void *data;
time_t time;
void *data;
Ecore_Fd_Handler *fd_handler;
int fd;
int flags;
Ecore_Fd_Handler *fd_handler;
int fd;
int flags;
int received;
int write_fd;
int received;
int write_fd;
unsigned char active : 1;
unsigned char active : 1;
};
#endif
struct _Ecore_Con_Info
{
unsigned int size;
unsigned int size;
struct addrinfo info;
char ip[NI_MAXHOST];
char service[NI_MAXSERV];
char ip[NI_MAXHOST];
char service[NI_MAXSERV];
};
struct _Ecore_Con_Lookup
@ -177,35 +178,65 @@ struct _Ecore_Con_Lookup
/* from ecore_local.c */
int ecore_con_local_init(void);
int ecore_con_local_shutdown(void);
int ecore_con_local_connect(Ecore_Con_Server *svr, Eina_Bool (*cb_done)(void *data, Ecore_Fd_Handler *fd_handler), void *data, void (*cb_free)(void *data, void *ev));
int ecore_con_local_listen(Ecore_Con_Server *svr, Eina_Bool (*cb_listen)(void *data, Ecore_Fd_Handler *fd_handler), void *data);
int ecore_con_local_connect(Ecore_Con_Server *svr,
Eina_Bool (*cb_done)(
void *data,
Ecore_Fd_Handler *fd_handler),
void *data,
void (*cb_free)(
void *data, void *ev));
int ecore_con_local_listen(Ecore_Con_Server *svr,
Eina_Bool (*cb_listen)(
void *data,
Ecore_Fd_Handler *fd_handler),
void *data);
/* from ecore_con_info.c */
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);
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);
/* from ecore_con_ssl.c */
Ecore_Con_Ssl_Error ecore_con_ssl_init(void);
Ecore_Con_Ssl_Error ecore_con_ssl_shutdown(void);
void _ecore_con_ssl_server_cert_add(Ecore_Con_Server *svr,
const char *cert);
void ecore_con_ssl_server_prepare(Ecore_Con_Server *svr);
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);
Ecore_Con_State ecore_con_ssl_server_try(Ecore_Con_Server *svr);
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, unsigned char *buf, int size);
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,
unsigned char *buf,
int size);
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);
Ecore_Con_State ecore_con_ssl_client_try(Ecore_Con_Client *svr);
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, unsigned char *buf, int size);
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,
unsigned char *buf,
int size);
int ecore_con_info_get(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data,
struct addrinfo *hints);
int ecore_con_info_get(Ecore_Con_Server *svr,
Ecore_Con_Info_Cb done_cb,
void *data,
struct addrinfo *hints);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff