2003-09-23 01:09:32 -07:00
|
|
|
#ifndef _ECORE_CON_PRIVATE_H
|
|
|
|
#define _ECORE_CON_PRIVATE_H
|
|
|
|
|
2005-09-05 03:17:08 -07:00
|
|
|
#include "Ecore_Data.h"
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#define ECORE_MAGIC_CON_SERVER 0x77665544
|
|
|
|
#define ECORE_MAGIC_CON_CLIENT 0x77556677
|
|
|
|
|
2004-03-31 08:47:45 -08:00
|
|
|
#if USE_OPENSSL
|
|
|
|
#include <openssl/ssl.h>
|
|
|
|
#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
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
typedef struct _Ecore_Con_Client Ecore_Con_Client;
|
|
|
|
typedef struct _Ecore_Con_Server Ecore_Con_Server;
|
2005-06-24 06:38:27 -07:00
|
|
|
#ifdef HAVE_CURL
|
|
|
|
typedef struct _Ecore_Con_Url Ecore_Con_Url;
|
|
|
|
#else
|
|
|
|
typedef void Ecore_Con_Url;
|
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
|
|
|
|
typedef enum _Ecore_Con_Type
|
|
|
|
{
|
|
|
|
ECORE_CON_LOCAL_USER,
|
2004-03-31 08:47:45 -08:00
|
|
|
ECORE_CON_LOCAL_SYSTEM,
|
|
|
|
ECORE_CON_REMOTE_SYSTEM
|
|
|
|
#if USE_OPENSSL
|
|
|
|
,ECORE_CON_USE_SSL = 16
|
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
} Ecore_Con_Type;
|
|
|
|
|
|
|
|
struct _Ecore_Con_Client
|
|
|
|
{
|
|
|
|
Ecore_List __list_data;
|
|
|
|
ECORE_MAGIC;
|
|
|
|
int fd;
|
|
|
|
Ecore_Con_Server *server;
|
|
|
|
void *data;
|
|
|
|
Ecore_Fd_Handler *fd_handler;
|
|
|
|
int buf_size;
|
|
|
|
int buf_offset;
|
|
|
|
unsigned char *buf;
|
|
|
|
char dead : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Ecore_Con_Server
|
|
|
|
{
|
|
|
|
Ecore_List __list_data;
|
|
|
|
ECORE_MAGIC;
|
|
|
|
int fd;
|
|
|
|
Ecore_Con_Type type;
|
|
|
|
char *name;
|
|
|
|
int port;
|
|
|
|
char *path;
|
|
|
|
void *data;
|
|
|
|
Ecore_Fd_Handler *fd_handler;
|
2005-04-28 21:51:31 -07:00
|
|
|
Ecore_List *clients;
|
2004-04-03 07:03:33 -08:00
|
|
|
int write_buf_size;
|
|
|
|
int write_buf_offset;
|
|
|
|
unsigned char *write_buf;
|
2003-09-23 01:09:32 -07:00
|
|
|
char dead : 1;
|
|
|
|
char created : 1;
|
|
|
|
char connecting : 1;
|
2005-04-28 21:51:31 -07:00
|
|
|
char reject_excess_clients : 1;
|
|
|
|
int client_limit;
|
2004-04-03 07:03:33 -08:00
|
|
|
|
2004-03-31 08:47:45 -08:00
|
|
|
#if USE_OPENSSL
|
|
|
|
SSL_CTX *ssl_ctx;
|
|
|
|
SSL *ssl;
|
|
|
|
#endif
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
|
2005-06-24 06:38:27 -07:00
|
|
|
#ifdef HAVE_CURL
|
|
|
|
struct _Ecore_Con_Url
|
|
|
|
{
|
|
|
|
/* FIXME: ECORE_MAGIC ? */
|
|
|
|
CURL *curl_easy;
|
|
|
|
char *url;
|
|
|
|
struct curl_slist *headers;
|
|
|
|
Ecore_Fd_Handler *fd_handler;
|
|
|
|
char active : 1;
|
|
|
|
};
|
|
|
|
#endif
|
2005-08-16 02:25:02 -07:00
|
|
|
|
|
|
|
/* from ecore_con_dns.c */
|
|
|
|
int ecore_con_dns_init(void);
|
|
|
|
void ecore_con_dns_shutdown(void);
|
2003-09-23 01:09:32 -07:00
|
|
|
#endif
|