VCOM Linux Driver
Advantech Inc.
Loading...
Searching...
No Matches
ssl_select.h
Go to the documentation of this file.
1#ifndef _SSL_SELECT_H
2#define _SSL_SELECT_H
3#include <openssl/ssl.h>
4#include <openssl/err.h>
5
6enum{
9};
10
11
12
13typedef struct {
14 int write;
15 int read;
17
27
28#ifndef SSL_SEL_PASSWORD_MAX
29#define SSL_SEL_PASSWORD_MAX 512
30#endif
31
32typedef struct{
33 int len;
36
38
39void init_ssl_lib(void);
40SSL_CTX *initialize_ctx(char *rootCA, char * keyfile, char * password, ssl_pwd_data * buff);
41void destroy_ctx(SSL_CTX *ctx);
42
43int __set_block(int sock);
44int __set_nonblock(int sock);
45
46int ssl_connect_direct(ssl_info * info, int *ssl_errno);
47int ssl_send_direct(ssl_info * info, void *buf, int len, int *ssl_errno);
48int ssl_recv_direct(ssl_info * info, void * buf, int len, int *ssl_errno);
49int ssl_accept_direct(ssl_info * info, int *ssl_errno);
50
51int ssl_connect_simple(ssl_info * info, int to_ms, int *ssl_errno);
52int ssl_accept_simple(ssl_info * info, int to_ms, int *ssl_errno);
53int ssl_send_simple(ssl_info * info, void * buf, int len, int to_ms, int *ssl_errno);
54int ssl_recv_simple(ssl_info * info, void * buf, int len, int to_ms, int *ssl_errno);
55
56int ssl_connect_simple_tv(ssl_info * info, struct timeval * tv, int *ssl_errno);
57int ssl_connect_accept_tv(ssl_info * info, struct timeval * tv, int *ssl_errno);
58int ssl_send_simple_tv(ssl_info * info, void * buf, int len, struct timeval * tv, int *ssl_errno);
59int ssl_recv_simple_tv(ssl_info * info, void * buf, int len, struct timeval * tv, int *ssl_errno);
60
61int ssl_set_fds(ssl_info *info, int maxfd, fd_set *rfds, fd_set *wfds);
62int ssl_errno_str(ssl_info * info, int ssl_errno, char * buf, int buflen);
63
64#define invoke_ssl_send (1 << 0)
65#define invoke_ssl_recv (1 << 1)
66#define invoke_ssl_connect (1 << 2)
67#define invoke_ssl_accept (1 << 3)
68int ssl_handle_fds(ssl_info * info, fd_set *rfds, fd_set *wfds);
69
70#endif
int ssl_recv_simple(ssl_info *info, void *buf, int len, int to_ms, int *ssl_errno)
ssl_info * sslinfo_alloc(void)
Definition ssl_select.c:455
int ssl_recv_direct(ssl_info *info, void *buf, int len, int *ssl_errno)
int ssl_connect_direct(ssl_info *info, int *ssl_errno)
int ssl_connect_simple(ssl_info *info, int to_ms, int *ssl_errno)
int __set_nonblock(int sock)
Definition ssl_select.c:225
int ssl_accept_direct(ssl_info *info, int *ssl_errno)
int ssl_errno_str(ssl_info *info, int ssl_errno, char *buf, int buflen)
Definition ssl_select.c:301
int ssl_send_direct(ssl_info *info, void *buf, int len, int *ssl_errno)
void destroy_ctx(SSL_CTX *ctx)
Definition ssl_select.c:167
int ssl_send_simple(ssl_info *info, void *buf, int len, int to_ms, int *ssl_errno)
@ SSL_OPS_SELECT
Definition ssl_select.h:8
@ SSL_OPS_FAIL
Definition ssl_select.h:7
int ssl_connect_simple_tv(ssl_info *info, struct timeval *tv, int *ssl_errno)
int ssl_send_simple_tv(ssl_info *info, void *buf, int len, struct timeval *tv, int *ssl_errno)
void init_ssl_lib(void)
Definition ssl_select.c:86
int __set_block(int sock)
Definition ssl_select.c:206
SSL_CTX * initialize_ctx(char *rootCA, char *keyfile, char *password, ssl_pwd_data *buff)
Definition ssl_select.c:104
int ssl_connect_accept_tv(ssl_info *info, struct timeval *tv, int *ssl_errno)
int ssl_set_fds(ssl_info *info, int maxfd, fd_set *rfds, fd_set *wfds)
Definition ssl_select.c:173
int ssl_accept_simple(ssl_info *info, int to_ms, int *ssl_errno)
#define SSL_SEL_PASSWORD_MAX
Definition ssl_select.h:29
int ssl_handle_fds(ssl_info *info, fd_set *rfds, fd_set *wfds)
Definition ssl_select.c:426
int ssl_recv_simple_tv(ssl_info *info, void *buf, int len, struct timeval *tv, int *ssl_errno)
Definition ssl_select.h:18
wait_event recv
Definition ssl_select.h:22
int sk
Definition ssl_select.h:19
wait_event connect
Definition ssl_select.h:24
wait_event send
Definition ssl_select.h:23
SSL_CTX * ctx
Definition ssl_select.h:21
wait_event accept
Definition ssl_select.h:25
SSL * ssl
Definition ssl_select.h:20
Definition ssl_select.h:32
int len
Definition ssl_select.h:33
Definition ssl_select.h:13
int write
Definition ssl_select.h:14
int read
Definition ssl_select.h:15
struct vc_attach_data data
Definition vcom_proto.h:3
unsigned short len
Definition vcom_proto.h:3