Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00022
00023
00024
00025
00026
00027
00028 #ifndef __tls_bio_h
00029 #define __tls_bio_h
00030
00031 #include <openssl/bio.h>
00032
00033
00034 struct tls_mbuf {
00035 unsigned char* buf;
00036 int pos;
00037 int used;
00038 int size;
00039 };
00040
00041 struct tls_bio_mbuf_data {
00042 struct tls_mbuf* rd;
00043 struct tls_mbuf* wr;
00044 };
00045
00046
00047 BIO_METHOD* tls_BIO_mbuf(void);
00048 BIO* tls_BIO_new_mbuf(struct tls_mbuf* rd, struct tls_mbuf* wr);
00049 int tls_BIO_mbuf_set(BIO* b, struct tls_mbuf* rd, struct tls_mbuf* wr);
00050
00051
00052
00059 #define tls_mbuf_init(mb, b, sz) \
00060 do { \
00061 (mb)->buf = (b); \
00062 (mb)->size = (sz); \
00063 (mb)->pos = 0; \
00064 (mb)->used = 0; \
00065 } while(0)
00066
00067
00068
00069 #endif
00070
00071