summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bio.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/bio.h')
-rw-r--r--src/lib/libcrypto/bio/bio.h64
1 files changed, 29 insertions, 35 deletions
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h
index cecb6a7207..152802fbdf 100644
--- a/src/lib/libcrypto/bio/bio.h
+++ b/src/lib/libcrypto/bio/bio.h
@@ -95,6 +95,7 @@ extern "C" {
95#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ 95#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */
96#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ 96#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */
97#define BIO_TYPE_DGRAM (21|0x0400|0x0100) 97#define BIO_TYPE_DGRAM (21|0x0400|0x0100)
98#define BIO_TYPE_ASN1 (22|0x0200) /* filter */
98#define BIO_TYPE_COMP (23|0x0200) /* filter */ 99#define BIO_TYPE_COMP (23|0x0200) /* filter */
99 100
100#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ 101#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
@@ -156,8 +157,11 @@ extern "C" {
156 * previous write 157 * previous write
157 * operation */ 158 * operation */
158 159
160#define BIO_CTRL_DGRAM_GET_PEER 46
159#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ 161#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */
160 162
163#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to
164 * adjust socket timeouts */
161 165
162/* modifiers */ 166/* modifiers */
163#define BIO_FP_READ 0x02 167#define BIO_FP_READ 0x02
@@ -262,7 +266,6 @@ int BIO_method_type(const BIO *b);
262 266
263typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); 267typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
264 268
265#ifndef OPENSSL_SYS_WIN16
266typedef struct bio_method_st 269typedef struct bio_method_st
267 { 270 {
268 int type; 271 int type;
@@ -276,21 +279,6 @@ typedef struct bio_method_st
276 int (*destroy)(BIO *); 279 int (*destroy)(BIO *);
277 long (*callback_ctrl)(BIO *, int, bio_info_cb *); 280 long (*callback_ctrl)(BIO *, int, bio_info_cb *);
278 } BIO_METHOD; 281 } BIO_METHOD;
279#else
280typedef struct bio_method_st
281 {
282 int type;
283 const char *name;
284 int (_far *bwrite)();
285 int (_far *bread)();
286 int (_far *bputs)();
287 int (_far *bgets)();
288 long (_far *ctrl)();
289 int (_far *create)();
290 int (_far *destroy)();
291 long (_far *callback_ctrl)();
292 } BIO_METHOD;
293#endif
294 282
295struct bio_st 283struct bio_st
296 { 284 {
@@ -331,6 +319,9 @@ typedef struct bio_f_buffer_ctx_struct
331 int obuf_off; /* write/read offset */ 319 int obuf_off; /* write/read offset */
332 } BIO_F_BUFFER_CTX; 320 } BIO_F_BUFFER_CTX;
333 321
322/* Prefix and suffix callback in ASN1 BIO */
323typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg);
324
334/* connect BIO stuff */ 325/* connect BIO stuff */
335#define BIO_CONN_S_BEFORE 1 326#define BIO_CONN_S_BEFORE 1
336#define BIO_CONN_S_GET_IP 2 327#define BIO_CONN_S_GET_IP 2
@@ -393,6 +384,13 @@ typedef struct bio_f_buffer_ctx_struct
393#define BIO_C_RESET_READ_REQUEST 147 384#define BIO_C_RESET_READ_REQUEST 147
394#define BIO_C_SET_MD_CTX 148 385#define BIO_C_SET_MD_CTX 148
395 386
387#define BIO_C_SET_PREFIX 149
388#define BIO_C_GET_PREFIX 150
389#define BIO_C_SET_SUFFIX 151
390#define BIO_C_GET_SUFFIX 152
391
392#define BIO_C_SET_EX_ARG 153
393#define BIO_C_GET_EX_ARG 154
396 394
397#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) 395#define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg)
398#define BIO_get_app_data(s) BIO_get_ex_data(s,0) 396#define BIO_get_app_data(s) BIO_get_ex_data(s,0)
@@ -405,7 +403,7 @@ typedef struct bio_f_buffer_ctx_struct
405#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) 403#define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)
406#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) 404#define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)
407#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) 405#define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)
408#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3) 406#define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0)
409 407
410 408
411#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) 409#define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)
@@ -414,7 +412,7 @@ typedef struct bio_f_buffer_ctx_struct
414#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) 412#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
415#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) 413#define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
416/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ 414/* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
417#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL) 415#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL)
418#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) 416#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
419 417
420#define BIO_BIND_NORMAL 0 418#define BIO_BIND_NORMAL 0
@@ -541,6 +539,8 @@ int BIO_ctrl_reset_read_request(BIO *b);
541 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL) 539 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)
542#define BIO_dgram_send_timedout(b) \ 540#define BIO_dgram_send_timedout(b) \
543 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL) 541 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)
542#define BIO_dgram_get_peer(b,peer) \
543 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)
544#define BIO_dgram_set_peer(b,peer) \ 544#define BIO_dgram_set_peer(b,peer) \
545 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer) 545 (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)
546 546
@@ -554,22 +554,21 @@ int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
554unsigned long BIO_number_read(BIO *bio); 554unsigned long BIO_number_read(BIO *bio);
555unsigned long BIO_number_written(BIO *bio); 555unsigned long BIO_number_written(BIO *bio);
556 556
557/* For BIO_f_asn1() */
558int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,
559 asn1_ps_func *prefix_free);
560int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,
561 asn1_ps_func **pprefix_free);
562int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,
563 asn1_ps_func *suffix_free);
564int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
565 asn1_ps_func **psuffix_free);
566
557# ifndef OPENSSL_NO_FP_API 567# ifndef OPENSSL_NO_FP_API
558# if defined(OPENSSL_SYS_WIN16) && defined(_WINDLL)
559BIO_METHOD *BIO_s_file_internal(void);
560BIO *BIO_new_file_internal(char *filename, char *mode);
561BIO *BIO_new_fp_internal(FILE *stream, int close_flag);
562# define BIO_s_file BIO_s_file_internal
563# define BIO_new_file BIO_new_file_internal
564# define BIO_new_fp BIO_new_fp_internal
565# else /* FP_API */
566BIO_METHOD *BIO_s_file(void ); 568BIO_METHOD *BIO_s_file(void );
567BIO *BIO_new_file(const char *filename, const char *mode); 569BIO *BIO_new_file(const char *filename, const char *mode);
568BIO *BIO_new_fp(FILE *stream, int close_flag); 570BIO *BIO_new_fp(FILE *stream, int close_flag);
569# define BIO_s_file_internal BIO_s_file 571# define BIO_s_file_internal BIO_s_file
570# define BIO_new_file_internal BIO_new_file
571# define BIO_new_fp_internal BIO_s_file
572# endif /* FP_API */
573# endif 572# endif
574BIO * BIO_new(BIO_METHOD *type); 573BIO * BIO_new(BIO_METHOD *type);
575int BIO_set(BIO *a,BIO_METHOD *type); 574int BIO_set(BIO *a,BIO_METHOD *type);
@@ -598,13 +597,8 @@ int BIO_nread(BIO *bio, char **buf, int num);
598int BIO_nwrite0(BIO *bio, char **buf); 597int BIO_nwrite0(BIO *bio, char **buf);
599int BIO_nwrite(BIO *bio, char **buf, int num); 598int BIO_nwrite(BIO *bio, char **buf, int num);
600 599
601#ifndef OPENSSL_SYS_WIN16
602long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, 600long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
603 long argl,long ret); 601 long argl,long ret);
604#else
605long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi,
606 long argl,long ret);
607#endif
608 602
609BIO_METHOD *BIO_s_mem(void); 603BIO_METHOD *BIO_s_mem(void);
610BIO *BIO_new_mem_buf(void *buf, int len); 604BIO *BIO_new_mem_buf(void *buf, int len);