diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_con/Ecore_Con.h | 124 |
1 files changed, 123 insertions, 1 deletions
diff --git a/libraries/ecore/src/lib/ecore_con/Ecore_Con.h b/libraries/ecore/src/lib/ecore_con/Ecore_Con.h index e3b68c4..c3af46a 100644 --- a/libraries/ecore/src/lib/ecore_con/Ecore_Con.h +++ b/libraries/ecore/src/lib/ecore_con/Ecore_Con.h | |||
@@ -234,6 +234,14 @@ typedef struct _Ecore_Con_Server Ecore_Con_Server; | |||
234 | typedef struct _Ecore_Con_Client Ecore_Con_Client; | 234 | typedef struct _Ecore_Con_Client Ecore_Con_Client; |
235 | 235 | ||
236 | /** | 236 | /** |
237 | * @typedef Ecore_Con_Socks | ||
238 | * An object representing a SOCKS proxy | ||
239 | * @ingroup Ecore_Con_Socks_Group | ||
240 | * @since 1.2 | ||
241 | */ | ||
242 | typedef struct Ecore_Con_Socks Ecore_Con_Socks; | ||
243 | |||
244 | /** | ||
237 | * @typedef Ecore_Con_Url | 245 | * @typedef Ecore_Con_Url |
238 | * A handle to an http upload/download object | 246 | * A handle to an http upload/download object |
239 | * @ingroup Ecore_Con_Url_Group | 247 | * @ingroup Ecore_Con_Url_Group |
@@ -325,6 +333,13 @@ typedef struct _Ecore_Con_Event_Client_Write Ecore_Con_Event_Client_Write; | |||
325 | typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write; | 333 | typedef struct _Ecore_Con_Event_Server_Write Ecore_Con_Event_Server_Write; |
326 | 334 | ||
327 | /** | 335 | /** |
336 | * @typedef Ecore_Con_Event_Proxy_Bind | ||
337 | * Used as the @p data param for the corresponding event | ||
338 | * @since 1.2 | ||
339 | */ | ||
340 | typedef struct _Ecore_Con_Event_Proxy_Bind Ecore_Con_Event_Proxy_Bind; | ||
341 | |||
342 | /** | ||
328 | * @typedef Ecore_Con_Event_Url_Data | 343 | * @typedef Ecore_Con_Event_Url_Data |
329 | * Used as the @p data param for the corresponding event | 344 | * Used as the @p data param for the corresponding event |
330 | * @ingroup Ecore_Con_Url_Group | 345 | * @ingroup Ecore_Con_Url_Group |
@@ -464,6 +479,19 @@ struct _Ecore_Con_Event_Server_Write | |||
464 | }; | 479 | }; |
465 | 480 | ||
466 | /** | 481 | /** |
482 | * @struct _Ecore_Con_Event_Proxy_Bind | ||
483 | * Used as the @p data param for the @ref ECORE_CON_EVENT_PROXY_BIND event | ||
484 | * @ingroup Ecore_Con_Socks_Group | ||
485 | * @since 1.2 | ||
486 | */ | ||
487 | struct _Ecore_Con_Event_Proxy_Bind | ||
488 | { | ||
489 | Ecore_Con_Server *server; /**< the server object connected to the proxy */ | ||
490 | const char *ip; /**< the proxy-bound ip address */ | ||
491 | int port; /**< the proxy-bound port */ | ||
492 | }; | ||
493 | |||
494 | /** | ||
467 | * @struct _Ecore_Con_Event_Url_Data | 495 | * @struct _Ecore_Con_Event_Url_Data |
468 | * Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event | 496 | * Used as the @p data param for the @ref ECORE_CON_EVENT_URL_DATA event |
469 | * @ingroup Ecore_Con_Url_Group | 497 | * @ingroup Ecore_Con_Url_Group |
@@ -542,6 +570,10 @@ EAPI extern int ECORE_CON_EVENT_SERVER_WRITE; | |||
542 | EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; | 570 | EAPI extern int ECORE_CON_EVENT_CLIENT_DATA; |
543 | /** A server connection object has data */ | 571 | /** A server connection object has data */ |
544 | EAPI extern int ECORE_CON_EVENT_SERVER_DATA; | 572 | EAPI extern int ECORE_CON_EVENT_SERVER_DATA; |
573 | /** A server connection has successfully negotiated an ip:port binding | ||
574 | * @since 1.2 | ||
575 | */ | ||
576 | EAPI extern int ECORE_CON_EVENT_PROXY_BIND; | ||
545 | /** A URL object has data */ | 577 | /** A URL object has data */ |
546 | EAPI extern int ECORE_CON_EVENT_URL_DATA; | 578 | EAPI extern int ECORE_CON_EVENT_URL_DATA; |
547 | /** A URL object has completed its transfer to and from the server and can be reused */ | 579 | /** A URL object has completed its transfer to and from the server and can be reused */ |
@@ -605,7 +637,13 @@ typedef enum _Ecore_Con_Type | |||
605 | ECORE_CON_REMOTE_UDP = 5, | 637 | ECORE_CON_REMOTE_UDP = 5, |
606 | /** Remote broadcast using UDP */ | 638 | /** Remote broadcast using UDP */ |
607 | ECORE_CON_REMOTE_BROADCAST = 6, | 639 | ECORE_CON_REMOTE_BROADCAST = 6, |
640 | /** Remote connection sending packets immediately */ | ||
608 | ECORE_CON_REMOTE_NODELAY = 7, | 641 | ECORE_CON_REMOTE_NODELAY = 7, |
642 | /** Remote connection sending data in large chunks | ||
643 | * @note Only available on Linux | ||
644 | * @since 1.2 | ||
645 | */ | ||
646 | ECORE_CON_REMOTE_CORK = 8, | ||
609 | /** Use SSL2: UNSUPPORTED. **/ | 647 | /** Use SSL2: UNSUPPORTED. **/ |
610 | ECORE_CON_USE_SSL2 = (1 << 4), | 648 | ECORE_CON_USE_SSL2 = (1 << 4), |
611 | /** Use SSL3 */ | 649 | /** Use SSL3 */ |
@@ -675,6 +713,8 @@ EAPI Eina_Bool ecore_con_ssl_server_crl_add(Ecore_Con_Server *svr, const | |||
675 | EAPI Eina_Bool ecore_con_ssl_server_cafile_add(Ecore_Con_Server *svr, const char *ca_file); | 713 | EAPI Eina_Bool ecore_con_ssl_server_cafile_add(Ecore_Con_Server *svr, const char *ca_file); |
676 | EAPI void ecore_con_ssl_server_verify(Ecore_Con_Server *svr); | 714 | EAPI void ecore_con_ssl_server_verify(Ecore_Con_Server *svr); |
677 | EAPI void ecore_con_ssl_server_verify_basic(Ecore_Con_Server *svr); | 715 | EAPI void ecore_con_ssl_server_verify_basic(Ecore_Con_Server *svr); |
716 | EAPI void ecore_con_ssl_server_verify_name_set(Ecore_Con_Server *svr, const char *name); | ||
717 | EAPI const char *ecore_con_ssl_server_verify_name_get(Ecore_Con_Server *svr); | ||
678 | EAPI Eina_Bool ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr, Ecore_Con_Type compl_type); | 718 | EAPI Eina_Bool ecore_con_ssl_server_upgrade(Ecore_Con_Server *svr, Ecore_Con_Type compl_type); |
679 | EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_Con_Type compl_type); | 719 | EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_Con_Type compl_type); |
680 | 720 | ||
@@ -682,6 +722,18 @@ EAPI Eina_Bool ecore_con_ssl_client_upgrade(Ecore_Con_Client *cl, Ecore_ | |||
682 | * @} | 722 | * @} |
683 | */ | 723 | */ |
684 | 724 | ||
725 | EAPI Ecore_Con_Socks *ecore_con_socks4_remote_add(const char *ip, int port, const char *username); | ||
726 | EAPI void ecore_con_socks4_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable); | ||
727 | EAPI Eina_Bool ecore_con_socks4_lookup_get(Ecore_Con_Socks *ecs); | ||
728 | EAPI Eina_Bool ecore_con_socks4_remote_exists(const char *ip, int port, const char *username); | ||
729 | EAPI void ecore_con_socks4_remote_del(const char *ip, int port, const char *username); | ||
730 | EAPI void ecore_con_socks_bind_set(Ecore_Con_Socks *ecs, Eina_Bool is_bind); | ||
731 | EAPI Eina_Bool ecore_con_socks_bind_get(Ecore_Con_Socks *ecs); | ||
732 | EAPI unsigned int ecore_con_socks_version_get(Ecore_Con_Socks *ecs); | ||
733 | EAPI void ecore_con_socks_remote_del(Ecore_Con_Socks *ecs); | ||
734 | EAPI void ecore_con_socks_apply_once(Ecore_Con_Socks *ecs); | ||
735 | EAPI void ecore_con_socks_apply_always(Ecore_Con_Socks *ecs); | ||
736 | |||
685 | /** | 737 | /** |
686 | * @defgroup Ecore_Con_Server_Group Ecore Connection Server Functions | 738 | * @defgroup Ecore_Con_Server_Group Ecore Connection Server Functions |
687 | * | 739 | * |
@@ -1185,6 +1237,8 @@ EAPI Eina_Bool ecore_con_client_connected_get(Ecore_Con_Client *cl); | |||
1185 | */ | 1237 | */ |
1186 | EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl); | 1238 | EAPI int ecore_con_client_port_get(Ecore_Con_Client *cl); |
1187 | 1239 | ||
1240 | |||
1241 | |||
1188 | /** | 1242 | /** |
1189 | * @} | 1243 | * @} |
1190 | */ | 1244 | */ |
@@ -1583,7 +1637,7 @@ EAPI Eina_Bool ecore_con_url_post(Ecore_Con_Url *url_con, | |||
1583 | * modification time. | 1637 | * modification time. |
1584 | * | 1638 | * |
1585 | * @param url_con Ecore_Con_Url to act upon. | 1639 | * @param url_con Ecore_Con_Url to act upon. |
1586 | * @param condition Condition to use for HTTP requests. | 1640 | * @param time_condition Condition to use for HTTP requests. |
1587 | * @param timestamp Time since 1 Jan 1970 to use in the condition. | 1641 | * @param timestamp Time since 1 Jan 1970 to use in the condition. |
1588 | * | 1642 | * |
1589 | * This function may set the header "If-Modified-Since" or | 1643 | * This function may set the header "If-Modified-Since" or |
@@ -1791,6 +1845,74 @@ EAPI int ecore_con_url_ssl_ca_set(Ecore_Con_Url *url_con, | |||
1791 | const char *ca_path); | 1845 | const char *ca_path); |
1792 | 1846 | ||
1793 | /** | 1847 | /** |
1848 | * Set HTTP proxy to use. | ||
1849 | * | ||
1850 | * The parameter should be a char * to a zero terminated string holding | ||
1851 | * the host name or dotted IP address. To specify port number in this string, | ||
1852 | * append :[port] to the end of the host name. | ||
1853 | * The proxy string may be prefixed with [protocol]:// since any such prefix | ||
1854 | * will be ignored. | ||
1855 | * The proxy's port number may optionally be specified with the separate option. | ||
1856 | * If not specified, libcurl will default to using port 1080 for proxies. | ||
1857 | * | ||
1858 | * @param url_con Connection object that will use the proxy. | ||
1859 | * @param proxy Porxy string or @c NULL to disable | ||
1860 | * | ||
1861 | * @return #EINA_TRUE on success, #EINA_FALSE on error. | ||
1862 | * @since 1.2 | ||
1863 | */ | ||
1864 | EAPI Eina_Bool ecore_con_url_proxy_set(Ecore_Con_Url *url_con, const char *proxy); | ||
1865 | |||
1866 | /** | ||
1867 | * Set zero terminated username to use for proxy. | ||
1868 | * | ||
1869 | * if socks protocol is used for proxy, protocol should be socks5 and above. | ||
1870 | * | ||
1871 | * @param url_con Connection object that will use the proxy. | ||
1872 | * @param username Username string. | ||
1873 | * | ||
1874 | * @return #EINA_TRUE on success, #EINA_FALSE on error. | ||
1875 | * | ||
1876 | * @see ecore_con_url_proxy_set() | ||
1877 | * | ||
1878 | * @since 1.2 | ||
1879 | */ | ||
1880 | EAPI Eina_Bool ecore_con_url_proxy_username_set(Ecore_Con_Url *url_con, const char *username); | ||
1881 | |||
1882 | /** | ||
1883 | * Set zero terminated password to use for proxy. | ||
1884 | * | ||
1885 | * if socks protocol is used for proxy, protocol should be socks5 and above. | ||
1886 | * | ||
1887 | * @param url_con Connection object that will use the proxy. | ||
1888 | * @param password Password string. | ||
1889 | * | ||
1890 | * @return #EINA_TRUE on success, #EINA_FALSE on error. | ||
1891 | * | ||
1892 | * @see ecore_con_url_proxy_set() | ||
1893 | * | ||
1894 | * @since 1.2 | ||
1895 | */ | ||
1896 | EAPI Eina_Bool ecore_con_url_proxy_password_set(Ecore_Con_Url *url_con, const char *password); | ||
1897 | |||
1898 | /** | ||
1899 | * Set timeout in seconds. | ||
1900 | * | ||
1901 | * the maximum time in seconds that you allow the ecore con url transfer | ||
1902 | * operation to take. Normally, name lookups can take a considerable time | ||
1903 | * and limiting operations to less than a few minutes risk aborting perfectly | ||
1904 | * normal operations. | ||
1905 | * | ||
1906 | * @param url_con Connection object that will use the timeout. | ||
1907 | * @param timeout time in seconds. | ||
1908 | * | ||
1909 | * @see ecore_con_url_cookies_jar_file_set() | ||
1910 | * | ||
1911 | * @since 1.2 | ||
1912 | */ | ||
1913 | EAPI void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout); | ||
1914 | |||
1915 | /** | ||
1794 | * @} | 1916 | * @} |
1795 | */ | 1917 | */ |
1796 | 1918 | ||