00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef TPORT_TLS_H
00026
00027 #define TPORT_TLS_H
00028
00036 #ifndef SU_TYPES_H
00037 #include <sofia-sip/su_types.h>
00038 #endif
00039
00040 SOFIA_BEGIN_DECLS
00041
00042 #define TLS_MAX_HOSTS (16)
00043
00044 typedef struct tls_s tls_t;
00045
00046 extern char const tls_version[];
00047
00048 typedef struct tls_issues_s {
00049 int verify_depth;
00050 int configured;
00051 char *cert;
00052 char *key;
00053 char *randFile;
00054 char *CAfile;
00055 char *CApath;
00056 char *cipher;
00057
00058
00059 int version;
00060
00061 } tls_issues_t;
00062
00063 tls_t *tls_init_master(tls_issues_t *tls_issues);
00064 tls_t *tls_init_slave(tls_t *tls_master, int sock);
00065 tls_t *tls_init_client(tls_t *tls_master, int sock);
00066 void tls_free(tls_t *tls);
00067 int tls_get_socket(tls_t *tls);
00068 ssize_t tls_read(tls_t *tls);
00069 void *tls_read_buffer(tls_t *tls, size_t N);
00070 int tls_want_read(tls_t *tls, int events);
00071 int tls_pending(tls_t const *tls);
00072
00073 ssize_t tls_write(tls_t *tls, void *buf, size_t size);
00074 int tls_want_write(tls_t *tls, int events);
00075
00076 int tls_check_hosts(tls_t *tls, char const *hosts[TLS_MAX_HOSTS]);
00077
00078 int tls_events(tls_t const *tls, int flags);
00079
00080 SOFIA_END_DECLS
00081
00082 #endif