VCOM Linux Driver
Advantech Inc.
|
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <stdarg.h>
#include <ctype.h>
#include <dirent.h>
#include <sys/socket.h>
#include <pthread.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/select.h>
#include <arpa/inet.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <syslog.h>
#include <netinet/tcp.h>
#include <sys/mman.h>
#include <linux/limits.h>
#include "ssl_select.h"
Macros | |
#define | _GNU_SOURCE |
#define | _ssl_update_wait_event(INFO, WEVENT, ERRNO) |
#define | GEN_SSL_ACTION_DIRECT(ACTION, FUNC, SUCCESS_COND, ...) |
#define | GEN_SSL_ACTION_SIMPLE_TV(ACTION, FUNC, SUCCESS_COND, ...) |
#define | GEN_SSL_ACTION_SIMPLE(ACTION, FUNC, ...) |
#define | __handle_flag(INFO, FLAG, IOTYPE, BFIELD) |
#define | INIT_WAIT_EVENT(INFO, WEVENT) |
Functions | |
void | init_ssl_lib (void) |
SSL_CTX * | initialize_ctx (char *rootCA, char *keyfile, char *password, ssl_pwd_data *_pwd) |
void | destroy_ctx (SSL_CTX *ctx) |
int | ssl_set_fds (ssl_info *info, int maxfd, fd_set *rfds, fd_set *wfds) |
int | __set_block (int sock) |
int | __set_nonblock (int sock) |
int | ssl_errno_str (ssl_info *info, int ssl_errno, char *buf, int buflen) |
GEN_SSL_ACTION_DIRECT (accept, SSL_accept(info->ssl), ret==1) | |
GEN_SSL_ACTION_DIRECT (connect, SSL_connect(info->ssl), ret==1) | |
GEN_SSL_ACTION_DIRECT (recv, SSL_read(info->ssl, buf, len), ret > 0, void *buf, int len) | |
GEN_SSL_ACTION_DIRECT (send, SSL_write(info->ssl, buf, len), ret > 0, void *buf, int len) | |
GEN_SSL_ACTION_SIMPLE_TV (accept, ssl_accept_direct(info, ssl_errno), ret==1) | |
GEN_SSL_ACTION_SIMPLE_TV (connect, ssl_connect_direct(info, ssl_errno), ret==1) | |
GEN_SSL_ACTION_SIMPLE_TV (recv, ssl_recv_direct(info, buf, len, ssl_errno), ret > 0, void *buf, int len) | |
GEN_SSL_ACTION_SIMPLE_TV (send, ssl_send_direct(info, buf, len, ssl_errno), ret > 0, void *buf, int len) | |
GEN_SSL_ACTION_SIMPLE (accept, ssl_accept_simple_tv(info, &tv, ssl_errno)) | |
GEN_SSL_ACTION_SIMPLE (connect, ssl_connect_simple_tv(info, &tv, ssl_errno)) | |
GEN_SSL_ACTION_SIMPLE (recv, ssl_recv_simple_tv(info, buf, len, &tv, ssl_errno), void *buf, int len) | |
GEN_SSL_ACTION_SIMPLE (send, ssl_send_simple_tv(info, buf, len, &tv, ssl_errno), void *buf, int len) | |
int | ssl_handle_fds (ssl_info *info, fd_set *rfds, fd_set *wfds) |
ssl_info * | sslinfo_alloc (void) |
#define __handle_flag | ( | INFO, | |
FLAG, | |||
IOTYPE, | |||
BFIELD ) |
#define _GNU_SOURCE |
#define _ssl_update_wait_event | ( | INFO, | |
WEVENT, | |||
ERRNO ) |
#define GEN_SSL_ACTION_DIRECT | ( | ACTION, | |
FUNC, | |||
SUCCESS_COND, | |||
... ) |
#define GEN_SSL_ACTION_SIMPLE | ( | ACTION, | |
FUNC, | |||
... ) |
#define GEN_SSL_ACTION_SIMPLE_TV | ( | ACTION, | |
FUNC, | |||
SUCCESS_COND, | |||
... ) |
#define INIT_WAIT_EVENT | ( | INFO, | |
WEVENT ) |
int __set_block | ( | int | sock | ) |
int __set_nonblock | ( | int | sock | ) |
void destroy_ctx | ( | SSL_CTX * | ctx | ) |
GEN_SSL_ACTION_DIRECT | ( | accept | , |
SSL_accept(info->ssl) | , | ||
ret | = =1 ) |
GEN_SSL_ACTION_DIRECT | ( | connect | , |
SSL_connect(info->ssl) | , | ||
ret | = =1 ) |
GEN_SSL_ACTION_DIRECT | ( | recv | , |
SSL_read(info->ssl, buf, len) | , | ||
ret | , | ||
0 | , | ||
void * | buf, | ||
int | len ) |
GEN_SSL_ACTION_DIRECT | ( | send | , |
SSL_write(info->ssl, buf, len) | , | ||
ret | , | ||
0 | , | ||
void * | buf, | ||
int | len ) |
GEN_SSL_ACTION_SIMPLE | ( | accept | , |
ssl_accept_simple_tv(info, &tv, ssl_errno) | ) |
GEN_SSL_ACTION_SIMPLE | ( | connect | , |
ssl_connect_simple_tv(info, &tv, ssl_errno) | ) |
GEN_SSL_ACTION_SIMPLE | ( | recv | , |
ssl_recv_simple_tv(info, buf, len, &tv, ssl_errno) | , | ||
void * | buf, | ||
int | len ) |
GEN_SSL_ACTION_SIMPLE | ( | send | , |
ssl_send_simple_tv(info, buf, len, &tv, ssl_errno) | , | ||
void * | buf, | ||
int | len ) |
GEN_SSL_ACTION_SIMPLE_TV | ( | accept | , |
ssl_accept_direct(info, ssl_errno) | , | ||
ret | = =1 ) |
GEN_SSL_ACTION_SIMPLE_TV | ( | connect | , |
ssl_connect_direct(info, ssl_errno) | , | ||
ret | = =1 ) |
GEN_SSL_ACTION_SIMPLE_TV | ( | recv | , |
ssl_recv_direct(info, buf, len, ssl_errno) | , | ||
ret | , | ||
0 | , | ||
void * | buf, | ||
int | len ) |
GEN_SSL_ACTION_SIMPLE_TV | ( | send | , |
ssl_send_direct(info, buf, len, ssl_errno) | , | ||
ret | , | ||
0 | , | ||
void * | buf, | ||
int | len ) |
void init_ssl_lib | ( | void | ) |
SSL_CTX * initialize_ctx | ( | char * | rootCA, |
char * | keyfile, | ||
char * | password, | ||
ssl_pwd_data * | _pwd ) |
int ssl_errno_str | ( | ssl_info * | info, |
int | ssl_errno, | ||
char * | buf, | ||
int | buflen ) |
int ssl_handle_fds | ( | ssl_info * | info, |
fd_set * | rfds, | ||
fd_set * | wfds ) |
int ssl_set_fds | ( | ssl_info * | info, |
int | maxfd, | ||
fd_set * | rfds, | ||
fd_set * | wfds ) |
ssl_info * sslinfo_alloc | ( | void | ) |