2003-09-23 01:09:32 -07:00
|
|
|
#ifndef _ECORE_CON_H
|
|
|
|
#define _ECORE_CON_H
|
|
|
|
|
2009-01-31 10:33:39 -08:00
|
|
|
#include <time.h>
|
|
|
|
#include <libgen.h>
|
2010-02-24 09:52:54 -08:00
|
|
|
#ifdef _WIN32
|
|
|
|
# include <ws2tcpip.h>
|
|
|
|
#else
|
2009-01-31 10:33:39 -08:00
|
|
|
# include <netdb.h>
|
|
|
|
#endif
|
2010-01-15 13:47:27 -08:00
|
|
|
#include <Eina.h>
|
2009-01-31 10:33:39 -08:00
|
|
|
|
2004-11-24 21:18:31 -08:00
|
|
|
#ifdef EAPI
|
2009-01-31 10:33:39 -08:00
|
|
|
# undef EAPI
|
2004-11-24 21:18:31 -08:00
|
|
|
#endif
|
2009-01-31 10:33:39 -08:00
|
|
|
|
2007-03-15 15:21:28 -07:00
|
|
|
#ifdef _MSC_VER
|
2004-11-24 21:18:31 -08:00
|
|
|
# ifdef BUILDING_DLL
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
|
|
|
# endif
|
|
|
|
#else
|
2005-12-27 09:17:31 -08:00
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
2004-11-24 21:18:31 -08:00
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2004-04-29 20:10:17 -07:00
|
|
|
/**
|
|
|
|
* @file Ecore_Con.h
|
|
|
|
* @brief Sockets functions.
|
2004-09-22 21:58:16 -07:00
|
|
|
*
|
|
|
|
* The Ecore Connection Library ( @c Ecore_Con ) provides simple mechanisms
|
|
|
|
* for communications between programs using reliable sockets. It saves
|
2010-09-08 04:23:42 -07:00
|
|
|
* the programmer from having to worry about file descriptors and waiting
|
2004-09-22 21:58:16 -07:00
|
|
|
* for incoming connections.
|
|
|
|
*
|
|
|
|
* There are two main objects in the @c Ecore_Con library: the @c
|
|
|
|
* Ecore_Con_Server and the @c Ecore_Con_Client.
|
|
|
|
*
|
2008-10-09 05:30:19 -07:00
|
|
|
* The @c Ecore_Con_Server represents a server that can be connected to.
|
|
|
|
* It is used regardless of whether the program is acting as a server or
|
2007-11-30 00:10:37 -08:00
|
|
|
* client itself.
|
2004-09-22 21:58:16 -07:00
|
|
|
*
|
2010-07-26 18:00:24 -07:00
|
|
|
* To create a listening server call @c ecore_con_server_add(), optionally using
|
|
|
|
* an ECORE_CON_USE_* encryption type OR'ed with the type for encryption.
|
2004-09-22 21:58:16 -07:00
|
|
|
*
|
2005-02-17 09:15:22 -08:00
|
|
|
* To connect to a server, call @c ecore_con_server_connect(). Data can
|
2004-09-22 21:58:16 -07:00
|
|
|
* then be sent to the server using the @c ecore_con_server_send().
|
2010-07-28 18:28:18 -07:00
|
|
|
*
|
2004-09-22 21:58:16 -07:00
|
|
|
* Functions are described in the following groupings:
|
|
|
|
* @li @ref Ecore_Con_Lib_Group
|
|
|
|
* @li @ref Ecore_Con_Server_Group
|
|
|
|
* @li @ref Ecore_Con_Client_Group
|
2008-02-11 15:24:11 -08:00
|
|
|
* @li @ref Ecore_Con_Url_Group
|
2010-07-28 18:28:18 -07:00
|
|
|
*
|
|
|
|
* Events are described in @ref Ecore_Con_Events_Group.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup Ecore_Con_Events_Group Events
|
|
|
|
*
|
2010-09-20 13:33:50 -07:00
|
|
|
* @li ECORE_CON_CLIENT_ADD: Whenever a client connection is made to an
|
2010-07-28 18:28:18 -07:00
|
|
|
* @c Ecore_Con_Server, an event of this type is emitted, allowing the
|
|
|
|
* retrieval of the client's ip with @ref ecore_con_client_ip_get and
|
|
|
|
* associating data with the client using ecore_con_client_data_set.
|
2010-09-20 13:33:50 -07:00
|
|
|
* @li ECORE_CON_EVENT_CLIENT_DEL: Whenever a client connection to an
|
2010-07-28 18:28:18 -07:00
|
|
|
* @c Ecore_Con_Server, an event of this type is emitted. The contents of
|
|
|
|
* the data with this event are variable, but if the client object in the data
|
|
|
|
* is non-null, it must be freed with @ref ecore_con_client_del.
|
2010-09-20 13:33:50 -07:00
|
|
|
* @li ECORE_CON_EVENT_SERVER_ADD: Whenever a server object is created
|
2010-07-28 18:28:18 -07:00
|
|
|
* with @ref ecore_con_server_connect, an event of this type is emitted,
|
|
|
|
* allowing for data to be serialized and sent to the server using
|
|
|
|
* @ref ecore_con_server_send. At this point, the http handshake has
|
|
|
|
* occurred.
|
2010-09-20 13:33:50 -07:00
|
|
|
* @li ECORE_CON_EVENT_SERVER_DEL: Whenever a server object is destroyed,
|
2010-07-28 18:28:18 -07:00
|
|
|
* usually by the server connection being refused or dropped, an event of this
|
|
|
|
* type is emitted. The contents of the data with this event are variable,
|
|
|
|
* but if the server object in the data is non-null, it must be freed
|
|
|
|
* with @ref ecore_con_server_del.
|
2010-09-20 13:33:50 -07:00
|
|
|
* @li ECORE_CON_EVENT_CLIENT_DATA: Whenever a client connects to your server
|
2010-07-28 18:28:18 -07:00
|
|
|
* object and sends data, an event of this type is emitted. The data will contain both
|
|
|
|
* the size and contents of the message sent by the client. It should be noted that
|
|
|
|
* data within this object is transient, so it must be duplicated in order to be
|
|
|
|
* retained. This event will continue to occur until the client has stopped sending its
|
|
|
|
* message, so a good option for storing this data is an Eina_Strbuf. Once the message has
|
2010-09-20 13:33:50 -07:00
|
|
|
* been received in full, the client object must be freed with ecore_con_client_free.
|
|
|
|
* @li ECORE_CON_EVENT_SERVER_DATA: Whenever your server object connects to its destination
|
2010-07-28 18:28:18 -07:00
|
|
|
* and receives data, an event of this type is emitted. The data will contain both
|
|
|
|
* the size and contents of the message sent by the server. It should be noted that
|
|
|
|
* data within this object is transient, so it must be duplicated in order to be
|
|
|
|
* retained. This event will continue to occur until the server has stopped sending its
|
|
|
|
* message, so a good option for storing this data is an Eina_Strbuf. Once the message has
|
2010-09-20 13:33:50 -07:00
|
|
|
* been received in full, the server object must be freed with ecore_con_server_free.
|
2010-07-28 18:28:18 -07:00
|
|
|
*
|
2004-04-29 20:10:17 -07:00
|
|
|
*/
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2008-10-09 05:30:19 -07:00
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Server
|
|
|
|
* A connection handle to a server
|
|
|
|
*/
|
|
|
|
typedef struct _Ecore_Con_Server Ecore_Con_Server;
|
|
|
|
/** @typedef Ecore_Con_Client
|
|
|
|
* A connection handle to a client
|
|
|
|
*/
|
|
|
|
typedef struct _Ecore_Con_Client Ecore_Con_Client;
|
|
|
|
/** @typedef Ecore_Con_Url
|
|
|
|
* A handle to an http upload/download object
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Url Ecore_Con_Url;
|
2008-10-09 05:30:19 -07:00
|
|
|
|
2010-07-26 18:00:24 -07:00
|
|
|
/**
|
2010-07-28 18:28:18 -07:00
|
|
|
* @typedef Ecore_Con_Dns_Cb
|
2010-07-26 18:00:24 -07:00
|
|
|
* A callback type for use with @ref ecore_con_lookup.
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef void (*Ecore_Con_Dns_Cb)(const char *canonname,
|
|
|
|
const char *ip,
|
|
|
|
struct sockaddr *addr,
|
|
|
|
int addrlen,
|
|
|
|
void *data);
|
2008-10-09 05:30:19 -07:00
|
|
|
|
2010-07-26 18:00:24 -07:00
|
|
|
/**
|
2010-07-28 18:28:18 -07:00
|
|
|
* @typedef Ecore_Con_Type
|
|
|
|
* @enum _Ecore_Con_Type
|
2010-07-26 18:00:24 -07:00
|
|
|
* Types for an ecore_con client/server object. A correct way to set this type is
|
2010-07-26 23:30:27 -07:00
|
|
|
* 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.
|
2010-09-20 13:33:50 -07:00
|
|
|
* @code
|
|
|
|
* ECORE_CON_REMOTE_TCP | ECORE_CON_USE_TLS | ECORE_CON_LOAD_CERT
|
|
|
|
* @endcode
|
2010-07-26 18:00:24 -07:00
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef enum _Ecore_Con_Type
|
|
|
|
{
|
2010-07-30 13:33:32 -07:00
|
|
|
/** Socket in ~/.ecore */
|
|
|
|
ECORE_CON_LOCAL_USER = 0,
|
|
|
|
/** Socket in /tmp */
|
|
|
|
ECORE_CON_LOCAL_SYSTEM = 1,
|
|
|
|
/** Abstract socket */
|
|
|
|
ECORE_CON_LOCAL_ABSTRACT = 2,
|
|
|
|
/** Remote server using TCP */
|
|
|
|
ECORE_CON_REMOTE_TCP = 3,
|
|
|
|
/** Remote multicast server */
|
|
|
|
ECORE_CON_REMOTE_MCAST = 4,
|
|
|
|
/** Remote server using UDP */
|
|
|
|
ECORE_CON_REMOTE_UDP = 5,
|
|
|
|
/** Remote broadcast using UDP */
|
|
|
|
ECORE_CON_REMOTE_BROADCAST = 6,
|
2010-07-26 23:30:27 -07:00
|
|
|
ECORE_CON_REMOTE_NODELAY = 7,
|
2010-07-30 13:33:32 -07:00
|
|
|
/** Use SSL2: UNSUPPORTED. **/
|
|
|
|
ECORE_CON_USE_SSL2 = (1 << 4),
|
|
|
|
/** Use SSL3 */
|
|
|
|
ECORE_CON_USE_SSL3 = (1 << 5),
|
|
|
|
/** Use TLS */
|
|
|
|
ECORE_CON_USE_TLS = (1 << 6),
|
|
|
|
/** Attempt to use the previously loaded certificate */
|
|
|
|
ECORE_CON_LOAD_CERT = (1 << 7)
|
2010-07-26 23:30:27 -07:00
|
|
|
} Ecore_Con_Type;
|
2008-01-08 13:06:43 -08:00
|
|
|
#define ECORE_CON_USE_SSL ECORE_CON_USE_SSL2
|
2008-09-25 04:37:01 -07:00
|
|
|
#define ECORE_CON_REMOTE_SYSTEM ECORE_CON_REMOTE_TCP
|
2007-09-26 09:01:04 -07:00
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @typedef Ecore_Con_Url_Time
|
|
|
|
* @enum _Ecore_Con_Url_Time
|
|
|
|
* The type of time in the object
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
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;
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @addtogroup Ecore_Con_Events_Group Events
|
|
|
|
* @{
|
2010-07-29 05:29:19 -07:00
|
|
|
*/
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Client_Add
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Client_Add Ecore_Con_Event_Client_Add;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Client_Del
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Client_Del Ecore_Con_Event_Client_Del;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Server_Add
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Server_Add Ecore_Con_Event_Server_Add;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Server_Del
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Server_Del Ecore_Con_Event_Server_Del;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Client_Data
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Client_Data Ecore_Con_Event_Client_Data;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Server_Data
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Server_Data Ecore_Con_Event_Server_Data;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Url_Data
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Url_Data Ecore_Con_Event_Url_Data;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Url_Complete
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Url_Complete Ecore_Con_Event_Url_Complete;
|
2010-07-28 18:28:18 -07:00
|
|
|
/** @typedef Ecore_Con_Event_Url_Progress
|
|
|
|
* Used as the @p data param for the corresponding event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
typedef struct _Ecore_Con_Event_Url_Progress Ecore_Con_Event_Url_Progress;
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Client_Add
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_CLIENT_ADD event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Client_Add
|
|
|
|
{
|
2010-07-28 18:28:18 -07:00
|
|
|
Ecore_Con_Client *client; /** the client that connected */
|
2010-07-26 23:30:27 -07:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Client_Del
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_CLIENT_DEL event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Client_Del
|
|
|
|
{
|
2010-07-28 18:28:18 -07:00
|
|
|
Ecore_Con_Client *client; /** the client that was lost */
|
2010-07-26 23:30:27 -07:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Server_Add
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_ADD event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Server_Add
|
|
|
|
{
|
2010-07-28 18:28:18 -07:00
|
|
|
Ecore_Con_Server *server; /** the server that was connected to */
|
2010-07-26 23:30:27 -07:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Server_Del
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_DEL event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Server_Del
|
|
|
|
{
|
2010-07-28 18:28:18 -07:00
|
|
|
Ecore_Con_Server *server; /** the client that was lost */
|
2010-07-26 23:30:27 -07:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Client_Data
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_CLIENT_DATA event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Client_Data
|
|
|
|
{
|
2010-07-30 13:33:32 -07:00
|
|
|
/** the client that connected */
|
|
|
|
Ecore_Con_Client *client;
|
|
|
|
/** the data that the client sent */
|
|
|
|
void *data;
|
|
|
|
/** the length of the data sent */
|
|
|
|
int size;
|
2010-07-26 23:30:27 -07:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Server_Data
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_SERVER_DATA event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Server_Data
|
|
|
|
{
|
2010-07-30 13:33:32 -07:00
|
|
|
/** the server that was connected to */
|
|
|
|
Ecore_Con_Server *server;
|
|
|
|
/** the data that the server sent */
|
|
|
|
void *data;
|
|
|
|
/** the length of the data sent */
|
|
|
|
int size;
|
2010-07-26 23:30:27 -07:00
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Url_Data
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Url_Data
|
|
|
|
{
|
|
|
|
Ecore_Con_Url *url_con;
|
|
|
|
int size;
|
|
|
|
unsigned char data[1];
|
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Url_Complete
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_URL_COMPLETE event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Url_Complete
|
|
|
|
{
|
|
|
|
Ecore_Con_Url *url_con;
|
|
|
|
int status;
|
|
|
|
};
|
|
|
|
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @struct _Ecore_Con_Event_Url_Progress
|
|
|
|
* Used as the @p data param for the @ref ECORE_CON_EVENT_URL_PROGRESS event
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
struct _Ecore_Con_Event_Url_Progress
|
|
|
|
{
|
|
|
|
Ecore_Con_Url *url_con;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
double total;
|
|
|
|
double now;
|
|
|
|
} down;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
double total;
|
|
|
|
double now;
|
|
|
|
} up;
|
|
|
|
};
|
|
|
|
|
2010-07-30 13:33:32 -07:00
|
|
|
/** A client has connected to the server */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_CLIENT_ADD;
|
|
|
|
/** A client has disconnected from the server */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_CLIENT_DEL;
|
|
|
|
/** A server was created */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_SERVER_ADD;
|
|
|
|
/** A server connection was lost */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_SERVER_DEL;
|
|
|
|
/** A client connected to the server has sent data */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_CLIENT_DATA;
|
|
|
|
/** A server connection object has data */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_SERVER_DATA;
|
|
|
|
/** A URL object has data */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_URL_DATA;
|
|
|
|
/** A URL object has completed its transfer to and from the server and can be reused */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_URL_COMPLETE;
|
|
|
|
/** A URL object has made progress in its transfer */
|
|
|
|
EAPI extern int ECORE_CON_EVENT_URL_PROGRESS;
|
2010-07-28 18:28:18 -07:00
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
2010-07-26 23:30:27 -07:00
|
|
|
EAPI int ecore_con_init(void);
|
|
|
|
EAPI int ecore_con_shutdown(void);
|
2010-07-28 11:25:46 -07:00
|
|
|
EAPI Eina_Bool ecore_con_server_ssl_cert_add(const char *cert);
|
|
|
|
EAPI Eina_Bool ecore_con_client_ssl_cert_add(const char *cert_file,
|
|
|
|
const char *crl_file,
|
|
|
|
const char *key_file);
|
2010-07-26 23:30:27 -07:00
|
|
|
|
|
|
|
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);
|
2010-07-28 18:28:18 -07:00
|
|
|
EAPI void * ecore_con_server_data_set(Ecore_Con_Server *svr,
|
|
|
|
void *data);
|
2010-07-26 23:30:27 -07:00
|
|
|
EAPI int ecore_con_server_connected_get(Ecore_Con_Server *svr);
|
|
|
|
EAPI Eina_List * ecore_con_server_clients_get(Ecore_Con_Server *svr);
|
2010-08-26 22:16:00 -07:00
|
|
|
EAPI const char * ecore_con_server_name_get(Ecore_Con_Server *svr);
|
|
|
|
EAPI int ecore_con_server_port_get(Ecore_Con_Server *svr);
|
2010-07-26 23:30:27 -07:00
|
|
|
EAPI int ecore_con_server_send(Ecore_Con_Server *svr,
|
|
|
|
const void *data,
|
|
|
|
int size);
|
2010-07-28 11:25:46 -07:00
|
|
|
EAPI void ecore_con_server_client_limit_set(
|
|
|
|
Ecore_Con_Server *svr,
|
|
|
|
int client_limit,
|
|
|
|
char
|
|
|
|
reject_excess_clients);
|
2010-07-28 15:32:39 -07:00
|
|
|
EAPI const char * ecore_con_server_ip_get(Ecore_Con_Server *svr);
|
2010-07-26 23:30:27 -07:00
|
|
|
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);
|
2010-07-28 15:32:39 -07:00
|
|
|
EAPI const char * ecore_con_client_ip_get(Ecore_Con_Client *cl);
|
2010-07-26 23:30:27 -07:00
|
|
|
EAPI void ecore_con_client_flush(Ecore_Con_Client *cl);
|
|
|
|
|
|
|
|
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);
|
2010-07-28 11:25:46 -07:00
|
|
|
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);
|
2010-07-26 23:30:27 -07:00
|
|
|
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 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,
|
2010-07-26 23:33:47 -07:00
|
|
|
void *curl_httppost);
|
2005-08-16 02:25:02 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|