AMPS C/C++ Client Class Reference AMPS C/C++ Client Version 5.3.5.1

amps_ssl.h
1
26 #ifndef _AMPS_AMPS_SSL_H_
27 #define _AMPS_AMPS_SSL_H_
28
29 /*
30 * This file contains the small number of type declarations and forward
31 * declarations needed to work with OpenSSL.
32 */
33
34 #define AMPS_SSL_ERROR_NONE 0
35 #define AMPS_SSL_ERROR_SSL 1
36 #define AMPS_SSL_ERROR_WANT_READ 2
37 #define AMPS_SSL_ERROR_WANT_WRITE 3
38 #define AMPS_SSL_ERROR_WANT_X509_LOOKUP 4
39 #define AMPS_SSL_ERROR_SYSCALL 5
40 #define AMPS_SSL_ERROR_ZERO_RETURN 6
41 #define AMPS_SSL_ERROR_WANT_CONNECT 7
42 #define AMPS_SSL_ERROR_WANT_ACCEPT 8
43
44 #define AMPS_SSL_CTRL_MODE 33
45 #define AMPS_SSL_CTRL_SET_TLSEXT_HOSTNAME 55
46 #define AMPS_SSL_AUTO_RETRY 0x4L
47
48 #define AMPS_CRYPTO_LOCK 0x01
49
50 #define AMPS_TLSEXT_NAMETYPE_host_name 0
51
52 typedef void _amps_SSL_CTX;
53 typedef void _amps_SSL_METHOD;
54 typedef void _amps_SSL;
55
56 extern void (*_amps_SSL_library_init)(void);
57 extern void (*_amps_SSL_load_error_strings)(void);
58 extern unsigned long (*_amps_ERR_get_error)(void);
59 extern void (*_amps_ERR_error_string_n)(unsigned long, char*, size_t);
60 extern void (*_amps_ERR_clear_error)(void);
61 extern _amps_SSL_METHOD* (*_amps_SSLv23_client_method)(void);
62 extern _amps_SSL_CTX* (*_amps_SSL_CTX_new)(const _amps_SSL_METHOD*);
63 extern void (*_amps_SSL_CTX_free)(_amps_SSL_CTX*);
64 extern _amps_SSL* (*_amps_SSL_new)(_amps_SSL_CTX*);
65 extern int (*_amps_SSL_set_fd)(_amps_SSL*, int);
66 extern int (*_amps_SSL_get_error)(_amps_SSL*, int);
67 extern int (*_amps_SSL_connect)(_amps_SSL*);
68 extern int (*_amps_SSL_read)(_amps_SSL*, void*, int);
69 extern int (*_amps_SSL_ctrl)(_amps_SSL*, int, long, void*);
70 extern int (*_amps_SSL_write)(_amps_SSL*, const void*, int);
71 extern int (*_amps_SSL_shutdown)(_amps_SSL*);
72 extern int (*_amps_SSL_pending)(_amps_SSL*);
73 extern void (*_amps_SSL_free)(_amps_SSL*);
74
75 /* global context created when amps_ssl_init is called. */
76 extern _amps_SSL_CTX* _amps_ssl_ctx;
77
78 #endif