AMPS C/C++ Client Class Reference
AMPS C/C++ Client Version 5.3.3.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_AUTO_RETRY 0x4L
46 
47 #define AMPS_CRYPTO_LOCK 0x01
48 
49 typedef void _amps_SSL_CTX;
50 typedef void _amps_SSL_METHOD;
51 typedef void _amps_SSL;
52 
53 extern void (*_amps_SSL_library_init)(void);
54 extern void (*_amps_SSL_load_error_strings)(void);
55 extern unsigned long (*_amps_ERR_get_error)(void);
56 extern void (*_amps_ERR_error_string_n)(unsigned long,char*,size_t);
57 extern void (*_amps_ERR_clear_error)(void);
58 extern _amps_SSL_METHOD* (*_amps_SSLv23_client_method)(void);
59 extern _amps_SSL_CTX* (*_amps_SSL_CTX_new)(const _amps_SSL_METHOD*);
60 extern void (*_amps_SSL_CTX_free)(_amps_SSL_CTX*);
61 extern _amps_SSL* (*_amps_SSL_new)(_amps_SSL_CTX*);
62 extern int (*_amps_SSL_set_fd)(_amps_SSL*,int);
63 extern int (*_amps_SSL_get_error)(_amps_SSL*,int);
64 extern int (*_amps_SSL_connect)(_amps_SSL*);
65 extern int (*_amps_SSL_read)(_amps_SSL*,void*,int);
66 extern int (*_amps_SSL_ctrl)(_amps_SSL*,int,long,void*);
67 extern int (*_amps_SSL_write)(_amps_SSL*,const void*,int);
68 extern int (*_amps_SSL_shutdown)(_amps_SSL*);
69 extern int (*_amps_SSL_pending)(_amps_SSL*);
70 extern void (*_amps_SSL_free)(_amps_SSL*);
71 
72 /* global context created when amps_ssl_init is called. */
73 extern _amps_SSL_CTX* _amps_ssl_ctx;
74 
75 #endif