support openssl info callback
[platform/upstream/libwebsockets.git] / lib / libwebsockets.h
index 5e8e188..ad754b0 100644 (file)
@@ -673,9 +673,12 @@ typedef int lws_filefd_type;
 
 #if (defined(WIN32) || defined(_WIN32)) && !defined(__MINGW32__)
 /* ... */
-#if !defined(ssize_t)
-typedef SSIZE_T ssize_t;
+#define ssize_t SSIZE_T
 #endif
+
+#if defined(WIN32) && defined(LWS_HAVE__STAT32I64)
+#include <sys/types.h>
+#include <sys/stat.h>
 #endif
 
 #if defined(LWS_HAVE_STDINT_H)
@@ -693,8 +696,8 @@ typedef unsigned char uint8_t;
 #endif
 #endif
 
-typedef size_t lws_filepos_t;
-typedef ssize_t lws_fileofs_t;
+typedef unsigned long long lws_filepos_t;
+typedef long long lws_fileofs_t;
 typedef uint32_t lws_fop_flags_t;
 
 /** struct lws_pollargs - argument structure for all external poll related calls
@@ -826,6 +829,10 @@ struct lws_extension;
  */
 ///@{
 
+struct lws_ssl_info {
+       int where;
+       int ret;
+};
 
 /*
  * NOTE: These public enums are part of the abi.  If you want to add one,
@@ -1232,6 +1239,12 @@ enum lws_callback_reasons {
        /**< RAW mode file is writeable */
        LWS_CALLBACK_RAW_CLOSE_FILE                             = 66,
        /**< RAW mode wsi that adopted a file is closing */
+       LWS_CALLBACK_SSL_INFO                                   = 67,
+       /**< SSL connections only.  An event you registered an
+        * interest in at the vhost has occurred on a connection
+        * using the vhost.  @in is a pointer to a
+        * struct lws_ssl_info containing information about the
+        * event*/
 
        /****** add new things just above ---^ ******/
 
@@ -2037,6 +2050,12 @@ struct lws_context_creation_info {
         * members added above will see 0 (default) even if the app
         * was not built against the newer headers.
         */
+       int ssl_info_event_mask;
+       /**< VHOST: mask of ssl events to be reported on LWS_CALLBACK_SSL_INFO
+        * callback for connections on this vhost.  The mask values are of
+        * the form SSL_CB_ALERT, defined in openssl/ssl.h.  The default of
+        * 0 means no info events will be reported.
+        */
 
        void *_unused[8]; /**< dummy */
 };
@@ -2286,8 +2305,8 @@ struct lws_protocol_vhost_options {
  * served from a filesystem, or it is a cgi etc.
  */
 enum lws_mount_protocols {
-       LWSMPRO_HTTP            = 0, /**< not supported yet */
-       LWSMPRO_HTTPS           = 1, /**< not supported yet */
+       LWSMPRO_HTTP            = 0, /**< http reverse proxy */
+       LWSMPRO_HTTPS           = 1, /**< https reverse proxy */
        LWSMPRO_FILE            = 2, /**< serve from filesystem directory */
        LWSMPRO_CGI             = 3, /**< pass to CGI to handle */
        LWSMPRO_REDIR_HTTP      = 4, /**< redirect to http:// url */
@@ -2420,6 +2439,9 @@ struct lws_client_connect_info {
         * even before the new wsi is returned and even if ultimately no wsi
         * is returned.
         */
+       const char *iface;
+       /**< NULL to allow routing on any interface, or interface name or IP
+        * to bind the socket to */
 
        /* Add new things just above here ---^
         * This is part of the ABI, don't needlessly break compatibility
@@ -3017,6 +3039,7 @@ enum lws_token_indexes {
        _WSI_TOKEN_CLIENT_HOST,
        _WSI_TOKEN_CLIENT_ORIGIN,
        _WSI_TOKEN_CLIENT_METHOD,
+       _WSI_TOKEN_CLIENT_IFACE,
 
        /* always last real token index*/
        WSI_TOKEN_COUNT,
@@ -3567,6 +3590,7 @@ enum pending_timeout {
        PENDING_TIMEOUT_AWAITING_SOCKS_GREETING_REPLY           = 19,
        PENDING_TIMEOUT_AWAITING_SOCKS_CONNECT_REPLY            = 20,
        PENDING_TIMEOUT_AWAITING_SOCKS_AUTH_REPLY               = 21,
+       PENDING_TIMEOUT_KILLED_BY_SSL_INFO                      = 22,
 
        /****** add new things just above ---^ ******/
 };
@@ -4296,7 +4320,7 @@ lws_get_child(const struct lws *wsi);
  * useful when integrating with other app poll loop service code.
  */
 LWS_VISIBLE LWS_EXTERN int
-lws_read(struct lws *wsi, unsigned char *buf, size_t len);
+lws_read(struct lws *wsi, unsigned char *buf, lws_filepos_t len);
 
 /**
  * lws_set_allocator() - custom allocator support