d5d9258d43ef2029c66b83901a34885414255c7c
[framework/uifw/ecore.git] / src / lib / ecore_con / ecore_con_private.h
1 #ifndef _ECORE_CON_PRIVATE_H
2 #define _ECORE_CON_PRIVATE_H
3
4 #include "Ecore_Con.h"
5 #include "Ecore_Data.h"
6
7 #define ECORE_MAGIC_CON_SERVER             0x77665544
8 #define ECORE_MAGIC_CON_CLIENT             0x77556677
9 #define ECORE_MAGIC_CON_URL                0x77074255
10
11 #define ECORE_CON_TYPE 0x0f
12 #define ECORE_CON_SSL  0xf0
13
14 #if USE_OPENSSL
15 #include <openssl/ssl.h>
16 #endif
17 #ifdef HAVE_CURL
18 #include <curl/curl.h>
19 #endif
20
21 #define READBUFSIZ 65536
22
23 struct _Ecore_Con_Client
24 {
25    ECORE_MAGIC;
26    int               fd;
27    Ecore_Con_Server *server;
28    void             *data;
29    Ecore_Fd_Handler *fd_handler;
30    int               buf_size;
31    int               buf_offset;
32    unsigned char    *buf;
33    char             *ip;
34    int               event_count;
35    char              dead : 1;
36    char              delete_me : 1;
37 };
38
39 struct _Ecore_Con_Server
40 {
41    ECORE_MAGIC;
42    int               fd;
43    Ecore_Con_Type    type;
44    char             *name;
45    int               port;
46    char             *path;
47    void             *data;
48    Ecore_Fd_Handler *fd_handler;
49    Ecore_List       *clients;
50    int               write_buf_size;
51    int               write_buf_offset;
52    unsigned char    *write_buf;
53    int               event_count;
54    int               client_limit;
55    pid_t             ppid;
56 #if USE_OPENSSL
57    SSL_CTX          *ssl_ctx;
58    SSL              *ssl;
59 #endif
60    char             *ip;
61    char              dead : 1;
62    char              created : 1;
63    char              connecting : 1;
64    char              reject_excess_clients : 1;
65    char              delete_me : 1;
66 };
67
68 #ifdef HAVE_CURL
69 struct _Ecore_Con_Url
70 {
71    ECORE_MAGIC;
72    CURL              *curl_easy;
73    struct curl_slist *headers;
74    char              *url;
75
76    Ecore_Con_Url_Time condition;
77    time_t             time;
78    void              *data;
79
80    Ecore_Fd_Handler  *fd_handler;
81    int                fd;
82    int                flags;
83
84    int                received;
85    int                write_fd;
86
87    unsigned char      active : 1;
88 };
89 #endif
90
91 /* from ecore_con_dns.c */
92 int ecore_con_dns_init(void);
93 int ecore_con_dns_shutdown(void);
94 #endif