sslgen.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #ifndef __SSLGEN_H
  2. #define __SSLGEN_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at http://curl.haxx.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * $Id$
  24. ***************************************************************************/
  25. bool Curl_ssl_config_matches(struct ssl_config_data* data,
  26. struct ssl_config_data* needle);
  27. bool Curl_clone_ssl_config(struct ssl_config_data* source,
  28. struct ssl_config_data* dest);
  29. void Curl_free_ssl_config(struct ssl_config_data* sslc);
  30. int Curl_ssl_init(void);
  31. void Curl_ssl_cleanup(void);
  32. CURLcode Curl_ssl_connect(struct connectdata *conn, int sockindex);
  33. CURLcode Curl_ssl_connect_nonblocking(struct connectdata *conn,
  34. int sockindex,
  35. bool *done);
  36. void Curl_ssl_close(struct connectdata *conn);
  37. /* tell the SSL stuff to close down all open information regarding
  38. connections (and thus session ID caching etc) */
  39. void Curl_ssl_close_all(struct SessionHandle *data);
  40. CURLcode Curl_ssl_set_engine(struct SessionHandle *data, const char *engine);
  41. /* Sets engine as default for all SSL operations */
  42. CURLcode Curl_ssl_set_engine_default(struct SessionHandle *data);
  43. ssize_t Curl_ssl_send(struct connectdata *conn,
  44. int sockindex,
  45. void *mem,
  46. size_t len);
  47. ssize_t Curl_ssl_recv(struct connectdata *conn, /* connection data */
  48. int sockindex, /* socketindex */
  49. char *mem, /* store read data here */
  50. size_t len); /* max amount to read */
  51. /* init the SSL session ID cache */
  52. CURLcode Curl_ssl_initsessions(struct SessionHandle *, long);
  53. /* extract a session ID */
  54. int Curl_ssl_getsessionid(struct connectdata *conn,
  55. void **ssl_sessionid,
  56. size_t *idsize) /* set 0 if unknown */;
  57. /* add a new session ID */
  58. CURLcode Curl_ssl_addsessionid(struct connectdata *conn,
  59. void *ssl_sessionid,
  60. size_t idsize);
  61. struct curl_slist *Curl_ssl_engines_list(struct SessionHandle *data);
  62. size_t Curl_ssl_version(char *buffer, size_t size);
  63. int Curl_ssl_check_cxn(struct connectdata *conn);
  64. CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex);
  65. bool Curl_ssl_data_pending(struct connectdata *conn,
  66. int connindex);
  67. #if !defined(USE_SSL) && !defined(SSLGEN_C)
  68. /* set up blank macros for none-SSL builds */
  69. #define Curl_ssl_close_all(x)
  70. #endif
  71. #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
  72. #endif