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
00038 #ifndef SU_TYPES_H
00039 #include <sofia-sip/su_types.h>
00040 #endif
00041
00042 #include "tport_internal.h"
00043
00044 SOFIA_BEGIN_DECLS
00045
00046 #define TLS_MAX_HOSTS (16)
00047
00048 typedef struct tls_s tls_t;
00049
00050 extern char const tls_version[];
00051
00052 typedef struct tls_issues_s {
00053 unsigned policy;
00054 unsigned verify_depth;
00055 unsigned verify_date;
00056 int configured;
00057 char *cert;
00058 char *key;
00059 char *randFile;
00060 char *CAfile;
00061 char *CApath;
00062 char *cipher;
00063
00064
00065 int version;
00066
00067 } tls_issues_t;
00068
00069 typedef struct tport_tls_s {
00070 tport_t tlstp_tp[1];
00071 tls_t *tlstp_context;
00072 char *tlstp_buffer;
00073 } tport_tls_t;
00074
00075 typedef struct tport_tls_primary_s {
00076 tport_primary_t tlspri_pri[1];
00077 tls_t *tlspri_master;
00078 } tport_tls_primary_t;
00079
00080 tls_t *tls_init_master(tls_issues_t *tls_issues);
00081 tls_t *tls_init_secondary(tls_t *tls_master, int sock, int accept);
00082 void tls_free(tls_t *tls);
00083 int tls_get_socket(tls_t *tls);
00084 ssize_t tls_read(tls_t *tls);
00085 void *tls_read_buffer(tls_t *tls, size_t N);
00086 int tls_want_read(tls_t *tls, int events);
00087 int tls_pending(tls_t const *tls);
00088
00089 int tls_connect(su_root_magic_t *magic, su_wait_t *w, tport_t *self);
00090 ssize_t tls_write(tls_t *tls, void *buf, size_t size);
00091 int tls_want_write(tls_t *tls, int events);
00092
00093 int tls_events(tls_t const *tls, int flags);
00094
00095 SOFIA_END_DECLS
00096
00097 #endif