ssl.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef _SSL_H
  2. #define _SSL_H
  3. #include "common.h"
  4. #include "dl.h"
  5. #include <bdlib/src/String.h>
  6. #ifdef EGG_SSL_EXT
  7. # ifndef EGG_SSL_INCS
  8. # include <openssl/ssl.h>
  9. # include <openssl/err.h>
  10. # include <openssl/rand.h>
  11. # define EGG_SSL_INCS 1
  12. # endif
  13. #endif
  14. typedef int (*SSL_get_error_t)(const SSL *, int);
  15. typedef void (*SSL_free_t)(SSL *);
  16. typedef int (*SSL_connect_t)(SSL *);
  17. typedef int (*SSL_read_t)(SSL *, void*, int);
  18. typedef int (*SSL_write_t)(SSL *, const void*, int);
  19. typedef SSL* (*SSL_new_t)(SSL_CTX *);
  20. typedef const SSL_METHOD* (*SSLv23_client_method_t)(void);
  21. typedef int (*SSL_shutdown_t)(SSL *);
  22. typedef int (*SSL_set_fd_t)(SSL *, int);
  23. typedef int (*SSL_pending_t)(const SSL *);
  24. typedef void (*SSL_load_error_strings_t)(void);
  25. typedef int (*SSL_library_init_t)(void);
  26. typedef void (*SSL_CTX_free_t)(SSL_CTX *);
  27. typedef SSL_CTX* (*SSL_CTX_new_t)(const SSL_METHOD *);
  28. #include ".defs/ssl_defs.h"
  29. int load_ssl();
  30. int unload_ssl();
  31. #ifdef EGG_SSL_EXT
  32. extern SSL_CTX *ssl_ctx;
  33. extern char *tls_rand_file;
  34. #endif
  35. extern int ssl_use;
  36. #endif /* !_SSL_H */