diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bio.h')
-rw-r--r-- | src/lib/libcrypto/bio/bio.h | 456 |
1 files changed, 229 insertions, 227 deletions
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h index 300b330e00..b122c7069d 100644 --- a/src/lib/libcrypto/bio/bio.h +++ b/src/lib/libcrypto/bio/bio.h | |||
@@ -59,12 +59,18 @@ | |||
59 | #ifndef HEADER_BIO_H | 59 | #ifndef HEADER_BIO_H |
60 | #define HEADER_BIO_H | 60 | #define HEADER_BIO_H |
61 | 61 | ||
62 | #ifndef OPENSSL_NO_FP_API | ||
63 | # include <stdio.h> | ||
64 | #endif | ||
65 | #include <stdarg.h> | ||
66 | |||
67 | #include <openssl/crypto.h> | ||
68 | #include <openssl/e_os2.h> | ||
69 | |||
62 | #ifdef __cplusplus | 70 | #ifdef __cplusplus |
63 | extern "C" { | 71 | extern "C" { |
64 | #endif | 72 | #endif |
65 | 73 | ||
66 | #include "crypto.h" | ||
67 | |||
68 | /* These are the 'types' of BIOs */ | 74 | /* These are the 'types' of BIOs */ |
69 | #define BIO_TYPE_NONE 0 | 75 | #define BIO_TYPE_NONE 0 |
70 | #define BIO_TYPE_MEM (1|0x0400) | 76 | #define BIO_TYPE_MEM (1|0x0400) |
@@ -74,7 +80,7 @@ extern "C" { | |||
74 | #define BIO_TYPE_SOCKET (5|0x0400|0x0100) | 80 | #define BIO_TYPE_SOCKET (5|0x0400|0x0100) |
75 | #define BIO_TYPE_NULL (6|0x0400) | 81 | #define BIO_TYPE_NULL (6|0x0400) |
76 | #define BIO_TYPE_SSL (7|0x0200) | 82 | #define BIO_TYPE_SSL (7|0x0200) |
77 | #define BIO_TYPE_MD (8|0x0200) /* pasive filter */ | 83 | #define BIO_TYPE_MD (8|0x0200) /* passive filter */ |
78 | #define BIO_TYPE_BUFFER (9|0x0200) /* filter */ | 84 | #define BIO_TYPE_BUFFER (9|0x0200) /* filter */ |
79 | #define BIO_TYPE_CIPHER (10|0x0200) /* filter */ | 85 | #define BIO_TYPE_CIPHER (10|0x0200) /* filter */ |
80 | #define BIO_TYPE_BASE64 (11|0x0200) /* filter */ | 86 | #define BIO_TYPE_BASE64 (11|0x0200) /* filter */ |
@@ -84,6 +90,9 @@ extern "C" { | |||
84 | #define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */ | 90 | #define BIO_TYPE_PROXY_SERVER (15|0x0200) /* server proxy BIO */ |
85 | #define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */ | 91 | #define BIO_TYPE_NBIO_TEST (16|0x0200) /* server proxy BIO */ |
86 | #define BIO_TYPE_NULL_FILTER (17|0x0200) | 92 | #define BIO_TYPE_NULL_FILTER (17|0x0200) |
93 | #define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */ | ||
94 | #define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ | ||
95 | #define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ | ||
87 | 96 | ||
88 | #define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ | 97 | #define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ |
89 | #define BIO_TYPE_FILTER 0x0200 | 98 | #define BIO_TYPE_FILTER 0x0200 |
@@ -143,6 +152,11 @@ extern "C" { | |||
143 | 152 | ||
144 | #define BIO_FLAGS_BASE64_NO_NL 0x100 | 153 | #define BIO_FLAGS_BASE64_NO_NL 0x100 |
145 | 154 | ||
155 | /* This is used with memory BIOs: it means we shouldn't free up or change the | ||
156 | * data in any way. | ||
157 | */ | ||
158 | #define BIO_FLAGS_MEM_RDONLY 0x200 | ||
159 | |||
146 | #define BIO_set_flags(b,f) ((b)->flags|=(f)) | 160 | #define BIO_set_flags(b,f) ((b)->flags|=(f)) |
147 | #define BIO_get_flags(b) ((b)->flags) | 161 | #define BIO_get_flags(b) ((b)->flags) |
148 | #define BIO_set_retry_special(b) \ | 162 | #define BIO_set_retry_special(b) \ |
@@ -159,14 +173,14 @@ extern "C" { | |||
159 | #define BIO_get_retry_flags(b) \ | 173 | #define BIO_get_retry_flags(b) \ |
160 | ((b)->flags&(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) | 174 | ((b)->flags&(BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY)) |
161 | 175 | ||
162 | /* These shouldbe used by the application to tell why we should retry */ | 176 | /* These should be used by the application to tell why we should retry */ |
163 | #define BIO_should_read(a) ((a)->flags & BIO_FLAGS_READ) | 177 | #define BIO_should_read(a) ((a)->flags & BIO_FLAGS_READ) |
164 | #define BIO_should_write(a) ((a)->flags & BIO_FLAGS_WRITE) | 178 | #define BIO_should_write(a) ((a)->flags & BIO_FLAGS_WRITE) |
165 | #define BIO_should_io_special(a) ((a)->flags & BIO_FLAGS_IO_SPECIAL) | 179 | #define BIO_should_io_special(a) ((a)->flags & BIO_FLAGS_IO_SPECIAL) |
166 | #define BIO_retry_type(a) ((a)->flags & BIO_FLAGS_RWS) | 180 | #define BIO_retry_type(a) ((a)->flags & BIO_FLAGS_RWS) |
167 | #define BIO_should_retry(a) ((a)->flags & BIO_FLAGS_SHOULD_RETRY) | 181 | #define BIO_should_retry(a) ((a)->flags & BIO_FLAGS_SHOULD_RETRY) |
168 | 182 | ||
169 | /* The next two are used in conjunction with the | 183 | /* The next three are used in conjunction with the |
170 | * BIO_should_io_special() condition. After this returns true, | 184 | * BIO_should_io_special() condition. After this returns true, |
171 | * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO | 185 | * BIO *BIO_get_retry_BIO(BIO *bio, int *reason); will walk the BIO |
172 | * stack and return the 'reason' for the special and the offending BIO. | 186 | * stack and return the 'reason' for the special and the offending BIO. |
@@ -175,6 +189,8 @@ extern "C" { | |||
175 | #define BIO_RR_SSL_X509_LOOKUP 0x01 | 189 | #define BIO_RR_SSL_X509_LOOKUP 0x01 |
176 | /* Returned from the connect BIO when a connect would have blocked */ | 190 | /* Returned from the connect BIO when a connect would have blocked */ |
177 | #define BIO_RR_CONNECT 0x02 | 191 | #define BIO_RR_CONNECT 0x02 |
192 | /* Returned from the accept BIO when an accept would have blocked */ | ||
193 | #define BIO_RR_ACCEPT 0x03 | ||
178 | 194 | ||
179 | /* These are passed by the BIO callback */ | 195 | /* These are passed by the BIO callback */ |
180 | #define BIO_CB_FREE 0x01 | 196 | #define BIO_CB_FREE 0x01 |
@@ -198,24 +214,29 @@ extern "C" { | |||
198 | #define BIO_method_name(b) ((b)->method->name) | 214 | #define BIO_method_name(b) ((b)->method->name) |
199 | #define BIO_method_type(b) ((b)->method->type) | 215 | #define BIO_method_type(b) ((b)->method->type) |
200 | 216 | ||
201 | #ifndef WIN16 | 217 | typedef struct bio_st BIO; |
218 | |||
219 | typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); | ||
220 | |||
221 | #ifndef OPENSSL_SYS_WIN16 | ||
202 | typedef struct bio_method_st | 222 | typedef struct bio_method_st |
203 | { | 223 | { |
204 | int type; | 224 | int type; |
205 | char *name; | 225 | const char *name; |
206 | int (*bwrite)(); | 226 | int (*bwrite)(BIO *, const char *, int); |
207 | int (*bread)(); | 227 | int (*bread)(BIO *, char *, int); |
208 | int (*bputs)(); | 228 | int (*bputs)(BIO *, const char *); |
209 | int (*bgets)(); | 229 | int (*bgets)(BIO *, char *, int); |
210 | long (*ctrl)(); | 230 | long (*ctrl)(BIO *, int, long, void *); |
211 | int (*create)(); | 231 | int (*create)(BIO *); |
212 | int (*destroy)(); | 232 | int (*destroy)(BIO *); |
233 | long (*callback_ctrl)(BIO *, int, bio_info_cb *); | ||
213 | } BIO_METHOD; | 234 | } BIO_METHOD; |
214 | #else | 235 | #else |
215 | typedef struct bio_method_st | 236 | typedef struct bio_method_st |
216 | { | 237 | { |
217 | int type; | 238 | int type; |
218 | char *name; | 239 | const char *name; |
219 | int (_far *bwrite)(); | 240 | int (_far *bwrite)(); |
220 | int (_far *bread)(); | 241 | int (_far *bread)(); |
221 | int (_far *bputs)(); | 242 | int (_far *bputs)(); |
@@ -223,18 +244,15 @@ typedef struct bio_method_st | |||
223 | long (_far *ctrl)(); | 244 | long (_far *ctrl)(); |
224 | int (_far *create)(); | 245 | int (_far *create)(); |
225 | int (_far *destroy)(); | 246 | int (_far *destroy)(); |
247 | long (_fat *callback_ctrl)(); | ||
226 | } BIO_METHOD; | 248 | } BIO_METHOD; |
227 | #endif | 249 | #endif |
228 | 250 | ||
229 | typedef struct bio_st | 251 | struct bio_st |
230 | { | 252 | { |
231 | BIO_METHOD *method; | 253 | BIO_METHOD *method; |
232 | #ifndef NOPROTO | ||
233 | /* bio, mode, argp, argi, argl, ret */ | 254 | /* bio, mode, argp, argi, argl, ret */ |
234 | long (*callback)(struct bio_st *,int,char *,int, long,long); | 255 | long (*callback)(struct bio_st *,int,const char *,int, long,long); |
235 | #else | ||
236 | long (*callback)(); | ||
237 | #endif | ||
238 | char *cb_arg; /* first argument for the callback */ | 256 | char *cb_arg; /* first argument for the callback */ |
239 | 257 | ||
240 | int init; | 258 | int init; |
@@ -242,7 +260,7 @@ typedef struct bio_st | |||
242 | int flags; /* extra storage */ | 260 | int flags; /* extra storage */ |
243 | int retry_reason; | 261 | int retry_reason; |
244 | int num; | 262 | int num; |
245 | char *ptr; | 263 | void *ptr; |
246 | struct bio_st *next_bio; /* used by filter BIOs */ | 264 | struct bio_st *next_bio; /* used by filter BIOs */ |
247 | struct bio_st *prev_bio; /* used by filter BIOs */ | 265 | struct bio_st *prev_bio; /* used by filter BIOs */ |
248 | int references; | 266 | int references; |
@@ -250,7 +268,9 @@ typedef struct bio_st | |||
250 | unsigned long num_write; | 268 | unsigned long num_write; |
251 | 269 | ||
252 | CRYPTO_EX_DATA ex_data; | 270 | CRYPTO_EX_DATA ex_data; |
253 | } BIO; | 271 | }; |
272 | |||
273 | DECLARE_STACK_OF(BIO) | ||
254 | 274 | ||
255 | typedef struct bio_f_buffer_ctx_struct | 275 | typedef struct bio_f_buffer_ctx_struct |
256 | { | 276 | { |
@@ -276,10 +296,7 @@ typedef struct bio_f_buffer_ctx_struct | |||
276 | #define BIO_CONN_S_OK 6 | 296 | #define BIO_CONN_S_OK 6 |
277 | #define BIO_CONN_S_BLOCKED_CONNECT 7 | 297 | #define BIO_CONN_S_BLOCKED_CONNECT 7 |
278 | #define BIO_CONN_S_NBIO 8 | 298 | #define BIO_CONN_S_NBIO 8 |
279 | #define BIO_CONN_get_param_hostname BIO_ctrl | 299 | /*#define BIO_CONN_get_param_hostname BIO_ctrl */ |
280 | |||
281 | #define BIO_number_read(b) ((b)->num_read) | ||
282 | #define BIO_number_written(b) ((b)->num_write) | ||
283 | 300 | ||
284 | #define BIO_C_SET_CONNECT 100 | 301 | #define BIO_C_SET_CONNECT 100 |
285 | #define BIO_C_DO_STATE_MACHINE 101 | 302 | #define BIO_C_DO_STATE_MACHINE 101 |
@@ -309,26 +326,42 @@ typedef struct bio_f_buffer_ctx_struct | |||
309 | #define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 | 326 | #define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 |
310 | #define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 | 327 | #define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 |
311 | #define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 | 328 | #define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 |
312 | 329 | #define BIO_C_FILE_SEEK 128 | |
313 | #define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,(char *)arg) | 330 | #define BIO_C_GET_CIPHER_CTX 129 |
331 | #define BIO_C_SET_BUF_MEM_EOF_RETURN 130/*return end of input value*/ | ||
332 | #define BIO_C_SET_BIND_MODE 131 | ||
333 | #define BIO_C_GET_BIND_MODE 132 | ||
334 | #define BIO_C_FILE_TELL 133 | ||
335 | #define BIO_C_GET_SOCKS 134 | ||
336 | #define BIO_C_SET_SOCKS 135 | ||
337 | |||
338 | #define BIO_C_SET_WRITE_BUF_SIZE 136/* for BIO_s_bio */ | ||
339 | #define BIO_C_GET_WRITE_BUF_SIZE 137 | ||
340 | #define BIO_C_MAKE_BIO_PAIR 138 | ||
341 | #define BIO_C_DESTROY_BIO_PAIR 139 | ||
342 | #define BIO_C_GET_WRITE_GUARANTEE 140 | ||
343 | #define BIO_C_GET_READ_REQUEST 141 | ||
344 | #define BIO_C_SHUTDOWN_WR 142 | ||
345 | #define BIO_C_NREAD0 143 | ||
346 | #define BIO_C_NREAD 144 | ||
347 | #define BIO_C_NWRITE0 145 | ||
348 | #define BIO_C_NWRITE 146 | ||
349 | #define BIO_C_RESET_READ_REQUEST 147 | ||
350 | |||
351 | |||
352 | #define BIO_set_app_data(s,arg) BIO_set_ex_data(s,0,arg) | ||
314 | #define BIO_get_app_data(s) BIO_get_ex_data(s,0) | 353 | #define BIO_get_app_data(s) BIO_get_ex_data(s,0) |
315 | 354 | ||
316 | int BIO_get_ex_num(BIO *bio); | 355 | /* BIO_s_connect() and BIO_s_socks4a_connect() */ |
317 | int BIO_set_ex_data(BIO *bio,int idx,char *data); | ||
318 | char *BIO_get_ex_data(BIO *bio,int idx); | ||
319 | void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); | ||
320 | int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | ||
321 | int (*dup_func)(), void (*free_func)()); | ||
322 | |||
323 | /* BIO_s_connect_socket() */ | ||
324 | #define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name) | 356 | #define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name) |
325 | #define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port) | 357 | #define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port) |
326 | #define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip) | 358 | #define BIO_set_conn_ip(b,ip) BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip) |
327 | #define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port) | 359 | #define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port) |
328 | #define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) | 360 | #define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) |
329 | #define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) | 361 | #define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) |
330 | #define BIO_get_conn_ip(b,ip) BIO_ptr_ctrl(b,BIO_C_SET_CONNECT,2) | 362 | #define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) |
331 | #define BIO_get_conn_int port(b,port) BIO_int_ctrl(b,BIO_C_SET_CONNECT,3,port) | 363 | #define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3) |
364 | |||
332 | 365 | ||
333 | #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) | 366 | #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) |
334 | 367 | ||
@@ -339,6 +372,12 @@ int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | |||
339 | #define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL) | 372 | #define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL) |
340 | #define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) | 373 | #define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio) |
341 | 374 | ||
375 | #define BIO_BIND_NORMAL 0 | ||
376 | #define BIO_BIND_REUSEADDR_IF_UNUSED 1 | ||
377 | #define BIO_BIND_REUSEADDR 2 | ||
378 | #define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) | ||
379 | #define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) | ||
380 | |||
342 | #define BIO_do_connect(b) BIO_do_handshake(b) | 381 | #define BIO_do_connect(b) BIO_do_handshake(b) |
343 | #define BIO_do_accept(b) BIO_do_handshake(b) | 382 | #define BIO_do_accept(b) BIO_do_handshake(b) |
344 | #define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) | 383 | #define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) |
@@ -349,7 +388,7 @@ int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | |||
349 | /* BIO_set_nbio(b,n) */ | 388 | /* BIO_set_nbio(b,n) */ |
350 | #define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) | 389 | #define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s)) |
351 | /* BIO *BIO_get_filter_bio(BIO *bio); */ | 390 | /* BIO *BIO_get_filter_bio(BIO *bio); */ |
352 | #define BIO_set_proxy_cb(b,cb) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(char *)(cb)) | 391 | #define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)())) |
353 | #define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) | 392 | #define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk) |
354 | #define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) | 393 | #define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool) |
355 | 394 | ||
@@ -364,12 +403,26 @@ int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | |||
364 | #define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) | 403 | #define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) |
365 | #define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) | 404 | #define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) |
366 | 405 | ||
406 | #define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) | ||
407 | #define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) | ||
408 | |||
409 | /* name is cast to lose const, but might be better to route through a function | ||
410 | so we can do it safely */ | ||
411 | #ifdef CONST_STRICT | ||
412 | /* If you are wondering why this isn't defined, its because CONST_STRICT is | ||
413 | * purely a compile-time kludge to allow const to be checked. | ||
414 | */ | ||
415 | int BIO_read_filename(BIO *b,const char *name); | ||
416 | #else | ||
367 | #define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ | 417 | #define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ |
368 | BIO_CLOSE|BIO_FP_READ,name) | 418 | BIO_CLOSE|BIO_FP_READ,(char *)name) |
419 | #endif | ||
369 | #define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ | 420 | #define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ |
370 | BIO_CLOSE|BIO_FP_WRITE,name) | 421 | BIO_CLOSE|BIO_FP_WRITE,name) |
371 | #define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ | 422 | #define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ |
372 | BIO_CLOSE|BIO_FP_APPEND,name) | 423 | BIO_CLOSE|BIO_FP_APPEND,name) |
424 | #define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \ | ||
425 | BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name) | ||
373 | 426 | ||
374 | /* WARNING WARNING, this ups the reference count on the read bio of the | 427 | /* WARNING WARNING, this ups the reference count on the read bio of the |
375 | * SSL structure. This is because the ssl read BIO is now pointed to by | 428 | * SSL structure. This is because the ssl read BIO is now pointed to by |
@@ -381,15 +434,18 @@ int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | |||
381 | #define BIO_set_ssl_renegotiate_bytes(b,num) \ | 434 | #define BIO_set_ssl_renegotiate_bytes(b,num) \ |
382 | BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); | 435 | BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); |
383 | #define BIO_get_num_renegotiates(b) \ | 436 | #define BIO_get_num_renegotiates(b) \ |
384 | BIO_ctrl(b,BIO_C_SET_SSL_NUM_RENEGOTIATES,0,NULL); | 437 | BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL); |
385 | #define BIO_set_ssl_renegotiate_timeout(b,seconds) \ | 438 | #define BIO_set_ssl_renegotiate_timeout(b,seconds) \ |
386 | BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); | 439 | BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); |
387 | 440 | ||
388 | /* defined in evp.h */ | 441 | /* defined in evp.h */ |
389 | /* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ | 442 | /* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ |
390 | 443 | ||
444 | #define BIO_get_mem_data(b,pp) BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp) | ||
391 | #define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm) | 445 | #define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm) |
392 | #define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp) | 446 | #define BIO_get_mem_ptr(b,pp) BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp) |
447 | #define BIO_set_mem_eof_return(b,v) \ | ||
448 | BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL) | ||
393 | 449 | ||
394 | /* For the BIO_f_buffer() type */ | 450 | /* For the BIO_f_buffer() type */ |
395 | #define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) | 451 | #define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) |
@@ -407,19 +463,42 @@ int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), | |||
407 | #define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL) | 463 | #define BIO_get_close(b) (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL) |
408 | #define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL) | 464 | #define BIO_pending(b) (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL) |
409 | #define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL) | 465 | #define BIO_wpending(b) (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL) |
466 | /* ...pending macros have inappropriate return type */ | ||
467 | size_t BIO_ctrl_pending(BIO *b); | ||
468 | size_t BIO_ctrl_wpending(BIO *b); | ||
410 | #define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) | 469 | #define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) |
411 | #define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(char *)cbp) | 470 | #define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \ |
412 | #define BIO_set_info_callback(b,cb) (int)BIO_ctrl(b,BIO_CTRL_SET_CALLBACK,0,(char *)cb) | 471 | cbp) |
472 | #define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb) | ||
413 | 473 | ||
414 | /* For the BIO_f_buffer() type */ | 474 | /* For the BIO_f_buffer() type */ |
415 | #define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) | 475 | #define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) |
416 | 476 | ||
417 | #ifdef NO_STDIO | 477 | /* For BIO_s_bio() */ |
418 | #define NO_FP_API | 478 | #define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL) |
419 | #endif | 479 | #define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL) |
420 | 480 | #define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) | |
421 | #ifndef NOPROTO | 481 | #define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) |
422 | # if defined(WIN16) && defined(_WINDLL) | 482 | #define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL) |
483 | /* macros with inappropriate type -- but ...pending macros use int too: */ | ||
484 | #define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) | ||
485 | #define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) | ||
486 | size_t BIO_ctrl_get_write_guarantee(BIO *b); | ||
487 | size_t BIO_ctrl_get_read_request(BIO *b); | ||
488 | int BIO_ctrl_reset_read_request(BIO *b); | ||
489 | |||
490 | /* These two aren't currently implemented */ | ||
491 | /* int BIO_get_ex_num(BIO *bio); */ | ||
492 | /* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ | ||
493 | int BIO_set_ex_data(BIO *bio,int idx,void *data); | ||
494 | void *BIO_get_ex_data(BIO *bio,int idx); | ||
495 | int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | ||
496 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | ||
497 | unsigned long BIO_number_read(BIO *bio); | ||
498 | unsigned long BIO_number_written(BIO *bio); | ||
499 | |||
500 | # ifndef OPENSSL_NO_FP_API | ||
501 | # if defined(OPENSSL_SYS_WIN16) && defined(_WINDLL) | ||
423 | BIO_METHOD *BIO_s_file_internal(void); | 502 | BIO_METHOD *BIO_s_file_internal(void); |
424 | BIO *BIO_new_file_internal(char *filename, char *mode); | 503 | BIO *BIO_new_file_internal(char *filename, char *mode); |
425 | BIO *BIO_new_fp_internal(FILE *stream, int close_flag); | 504 | BIO *BIO_new_fp_internal(FILE *stream, int close_flag); |
@@ -428,261 +507,184 @@ BIO *BIO_new_fp_internal(FILE *stream, int close_flag); | |||
428 | # define BIO_new_fp BIO_new_fp_internal | 507 | # define BIO_new_fp BIO_new_fp_internal |
429 | # else /* FP_API */ | 508 | # else /* FP_API */ |
430 | BIO_METHOD *BIO_s_file(void ); | 509 | BIO_METHOD *BIO_s_file(void ); |
431 | BIO *BIO_new_file(char *filename, char *mode); | 510 | BIO *BIO_new_file(const char *filename, const char *mode); |
432 | BIO *BIO_new_fp(FILE *stream, int close_flag); | 511 | BIO *BIO_new_fp(FILE *stream, int close_flag); |
433 | # define BIO_s_file_internal BIO_s_file | 512 | # define BIO_s_file_internal BIO_s_file |
434 | # define BIO_new_file_internal BIO_new_file | 513 | # define BIO_new_file_internal BIO_new_file |
435 | # define BIO_new_fp_internal BIO_s_file | 514 | # define BIO_new_fp_internal BIO_s_file |
436 | # endif /* FP_API */ | 515 | # endif /* FP_API */ |
437 | #else | 516 | # endif |
438 | # if defined(WIN16) && defined(_WINDLL) | ||
439 | BIO_METHOD *BIO_s_file_internal(); | ||
440 | BIO *BIO_new_file_internal(); | ||
441 | BIO *BIO_new_fp_internal(); | ||
442 | # define BIO_s_file BIO_s_file_internal | ||
443 | # define BIO_new_file BIO_new_file_internal | ||
444 | # define BIO_new_fp BIO_new_fp_internal | ||
445 | # else /* FP_API */ | ||
446 | BIO_METHOD *BIO_s_file(); | ||
447 | BIO *BIO_new_file(); | ||
448 | BIO *BIO_new_fp(); | ||
449 | # define BIO_s_file_internal BIO_s_file | ||
450 | # define BIO_new_file_internal BIO_new_file | ||
451 | # define BIO_new_fp_internal BIO_s_file | ||
452 | # endif /* FP_API */ | ||
453 | #endif | ||
454 | |||
455 | #ifndef NOPROTO | ||
456 | BIO * BIO_new(BIO_METHOD *type); | 517 | BIO * BIO_new(BIO_METHOD *type); |
457 | int BIO_set(BIO *a,BIO_METHOD *type); | 518 | int BIO_set(BIO *a,BIO_METHOD *type); |
458 | int BIO_free(BIO *a); | 519 | int BIO_free(BIO *a); |
459 | int BIO_read(BIO *b, char *data, int len); | 520 | void BIO_vfree(BIO *a); |
521 | int BIO_read(BIO *b, void *data, int len); | ||
460 | int BIO_gets(BIO *bp,char *buf, int size); | 522 | int BIO_gets(BIO *bp,char *buf, int size); |
461 | int BIO_write(BIO *b, char *data, int len); | 523 | int BIO_write(BIO *b, const void *data, int len); |
462 | int BIO_puts(BIO *bp,char *buf); | 524 | int BIO_puts(BIO *bp,const char *buf); |
463 | long BIO_ctrl(BIO *bp,int cmd,long larg,char *parg); | 525 | long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); |
526 | long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long)); | ||
464 | char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); | 527 | char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); |
465 | long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); | 528 | long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); |
466 | BIO * BIO_push(BIO *b,BIO *append); | 529 | BIO * BIO_push(BIO *b,BIO *append); |
467 | BIO * BIO_pop(BIO *b); | 530 | BIO * BIO_pop(BIO *b); |
468 | void BIO_free_all(BIO *a); | 531 | void BIO_free_all(BIO *a); |
469 | BIO * BIO_find_type(BIO *b,int bio_type); | 532 | BIO * BIO_find_type(BIO *b,int bio_type); |
533 | BIO * BIO_next(BIO *b); | ||
470 | BIO * BIO_get_retry_BIO(BIO *bio, int *reason); | 534 | BIO * BIO_get_retry_BIO(BIO *bio, int *reason); |
471 | int BIO_get_retry_reason(BIO *bio); | 535 | int BIO_get_retry_reason(BIO *bio); |
472 | BIO * BIO_dup_chain(BIO *in); | 536 | BIO * BIO_dup_chain(BIO *in); |
473 | 537 | ||
474 | #ifndef WIN16 | 538 | int BIO_nread0(BIO *bio, char **buf); |
475 | long BIO_debug_callback(BIO *bio,int cmd,char *argp,int argi, | 539 | int BIO_nread(BIO *bio, char **buf, int num); |
540 | int BIO_nwrite0(BIO *bio, char **buf); | ||
541 | int BIO_nwrite(BIO *bio, char **buf, int num); | ||
542 | |||
543 | #ifndef OPENSSL_SYS_WIN16 | ||
544 | long BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, | ||
476 | long argl,long ret); | 545 | long argl,long ret); |
477 | #else | 546 | #else |
478 | long _far _loadds BIO_debug_callback(BIO *bio,int cmd,char *argp,int argi, | 547 | long _far _loadds BIO_debug_callback(BIO *bio,int cmd,const char *argp,int argi, |
479 | long argl,long ret); | 548 | long argl,long ret); |
480 | #endif | 549 | #endif |
481 | 550 | ||
482 | BIO_METHOD *BIO_s_mem(void); | 551 | BIO_METHOD *BIO_s_mem(void); |
552 | BIO *BIO_new_mem_buf(void *buf, int len); | ||
483 | BIO_METHOD *BIO_s_socket(void); | 553 | BIO_METHOD *BIO_s_socket(void); |
484 | BIO_METHOD *BIO_s_connect(void); | 554 | BIO_METHOD *BIO_s_connect(void); |
485 | BIO_METHOD *BIO_s_accept(void); | 555 | BIO_METHOD *BIO_s_accept(void); |
486 | BIO_METHOD *BIO_s_fd(void); | 556 | BIO_METHOD *BIO_s_fd(void); |
557 | BIO_METHOD *BIO_s_log(void); | ||
558 | BIO_METHOD *BIO_s_bio(void); | ||
487 | BIO_METHOD *BIO_s_null(void); | 559 | BIO_METHOD *BIO_s_null(void); |
488 | BIO_METHOD *BIO_f_null(void); | 560 | BIO_METHOD *BIO_f_null(void); |
489 | BIO_METHOD *BIO_f_nbio_test(void); | ||
490 | BIO_METHOD *BIO_f_buffer(void); | 561 | BIO_METHOD *BIO_f_buffer(void); |
562 | #ifdef OPENSSL_SYS_VMS | ||
563 | BIO_METHOD *BIO_f_linebuffer(void); | ||
564 | #endif | ||
565 | BIO_METHOD *BIO_f_nbio_test(void); | ||
566 | /* BIO_METHOD *BIO_f_ber(void); */ | ||
491 | 567 | ||
492 | int BIO_sock_should_retry(int i); | 568 | int BIO_sock_should_retry(int i); |
493 | int BIO_sock_non_fatal_error(int error); | 569 | int BIO_sock_non_fatal_error(int error); |
494 | int BIO_fd_should_retry(int i); | 570 | int BIO_fd_should_retry(int i); |
495 | int BIO_fd_non_fatal_error(int error); | 571 | int BIO_fd_non_fatal_error(int error); |
496 | int BIO_dump(BIO *b,char *bytes,int len); | 572 | int BIO_dump(BIO *b,const char *bytes,int len); |
497 | 573 | int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent); | |
498 | struct hostent *BIO_gethostbyname(char *name); | 574 | |
575 | struct hostent *BIO_gethostbyname(const char *name); | ||
576 | /* We might want a thread-safe interface too: | ||
577 | * struct hostent *BIO_gethostbyname_r(const char *name, | ||
578 | * struct hostent *result, void *buffer, size_t buflen); | ||
579 | * or something similar (caller allocates a struct hostent, | ||
580 | * pointed to by "result", and additional buffer space for the various | ||
581 | * substructures; if the buffer does not suffice, NULL is returned | ||
582 | * and an appropriate error code is set). | ||
583 | */ | ||
499 | int BIO_sock_error(int sock); | 584 | int BIO_sock_error(int sock); |
500 | int BIO_socket_ioctl(int fd, long type, unsigned long *arg); | 585 | int BIO_socket_ioctl(int fd, long type, unsigned long *arg); |
501 | int BIO_get_port(char *str, short *port_ptr); | 586 | int BIO_socket_nbio(int fd,int mode); |
502 | int BIO_get_host_ip(char *str, unsigned char *ip); | 587 | int BIO_get_port(const char *str, unsigned short *port_ptr); |
503 | int BIO_get_accept_socket(char *host_port); | 588 | int BIO_get_host_ip(const char *str, unsigned char *ip); |
589 | int BIO_get_accept_socket(char *host_port,int mode); | ||
504 | int BIO_accept(int sock,char **ip_port); | 590 | int BIO_accept(int sock,char **ip_port); |
505 | int BIO_sock_init(void ); | 591 | int BIO_sock_init(void ); |
506 | void BIO_sock_cleanup(void); | 592 | void BIO_sock_cleanup(void); |
507 | int BIO_set_tcp_ndelay(int sock,int turn_on); | 593 | int BIO_set_tcp_ndelay(int sock,int turn_on); |
508 | 594 | ||
509 | void ERR_load_BIO_strings(void ); | ||
510 | |||
511 | BIO *BIO_new_socket(int sock, int close_flag); | 595 | BIO *BIO_new_socket(int sock, int close_flag); |
512 | BIO *BIO_new_fd(int fd, int close_flag); | 596 | BIO *BIO_new_fd(int fd, int close_flag); |
513 | BIO *BIO_new_connect(char *host_port); | 597 | BIO *BIO_new_connect(char *host_port); |
514 | BIO *BIO_new_accept(char *host_port); | 598 | BIO *BIO_new_accept(char *host_port); |
515 | 599 | ||
600 | int BIO_new_bio_pair(BIO **bio1, size_t writebuf1, | ||
601 | BIO **bio2, size_t writebuf2); | ||
602 | /* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints. | ||
603 | * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. | ||
604 | * Size 0 uses default value. | ||
605 | */ | ||
606 | |||
516 | void BIO_copy_next_retry(BIO *b); | 607 | void BIO_copy_next_retry(BIO *b); |
517 | 608 | ||
518 | long BIO_ghbn_ctrl(int cmd,int iarg,char *parg); | 609 | long BIO_ghbn_ctrl(int cmd,int iarg,char *parg); |
519 | 610 | ||
520 | #else | 611 | int BIO_printf(BIO *bio, const char *format, ...); |
521 | 612 | int BIO_vprintf(BIO *bio, const char *format, va_list args); | |
522 | BIO * BIO_new(); | 613 | int BIO_snprintf(char *buf, size_t n, const char *format, ...); |
523 | int BIO_set(); | 614 | int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args); |
524 | int BIO_free(); | ||
525 | int BIO_read(); | ||
526 | int BIO_gets(); | ||
527 | int BIO_write(); | ||
528 | int BIO_puts(); | ||
529 | char * BIO_ptr_ctrl(); | ||
530 | long BIO_ctrl(); | ||
531 | long BIO_int_ctrl(); | ||
532 | BIO * BIO_push(); | ||
533 | BIO * BIO_pop(); | ||
534 | void BIO_free_all(); | ||
535 | BIO * BIO_find_type(); | ||
536 | BIO * BIO_get_retry_BIO(); | ||
537 | int BIO_get_retry_reason(); | ||
538 | BIO * BIO_dup_chain(); | ||
539 | |||
540 | #ifndef WIN16 | ||
541 | long BIO_debug_callback(); | ||
542 | #else | ||
543 | long _far _loadds BIO_debug_callback(); | ||
544 | #endif | ||
545 | |||
546 | BIO_METHOD *BIO_s_mem(); | ||
547 | BIO_METHOD *BIO_s_socket(); | ||
548 | BIO_METHOD *BIO_s_connect(); | ||
549 | BIO_METHOD *BIO_s_accept(); | ||
550 | BIO_METHOD *BIO_s_fd(); | ||
551 | BIO_METHOD *BIO_s_null(); | ||
552 | BIO_METHOD *BIO_f_null(); | ||
553 | BIO_METHOD *BIO_f_buffer(); | ||
554 | BIO_METHOD *BIO_f_nbio_test(); | ||
555 | |||
556 | int BIO_sock_should_retry(); | ||
557 | int BIO_sock_non_fatal_error(); | ||
558 | int BIO_fd_should_retry(); | ||
559 | int BIO_fd_non_fatal_error(); | ||
560 | int BIO_dump(); | ||
561 | |||
562 | struct hostent *BIO_gethostbyname(); | ||
563 | int BIO_sock_error(); | ||
564 | int BIO_socket_ioctl(); | ||
565 | int BIO_get_port(); | ||
566 | int BIO_get_host_ip(); | ||
567 | int BIO_get_accept_socket(); | ||
568 | int BIO_accept(); | ||
569 | int BIO_sock_init(); | ||
570 | void BIO_sock_cleanup(); | ||
571 | int BIO_set_tcp_ndelay(); | ||
572 | |||
573 | void ERR_load_BIO_strings(); | ||
574 | |||
575 | BIO *BIO_new_socket(); | ||
576 | BIO *BIO_new_fd(); | ||
577 | BIO *BIO_new_connect(); | ||
578 | BIO *BIO_new_accept(); | ||
579 | |||
580 | void BIO_copy_next_retry(); | ||
581 | |||
582 | int BIO_ghbn_ctrl(); | ||
583 | |||
584 | #endif | ||
585 | |||
586 | /* Tim Hudson's portable varargs stuff */ | ||
587 | |||
588 | #ifndef NOPROTO | ||
589 | #define VAR_ANSI /* select ANSI version by default */ | ||
590 | #endif | ||
591 | |||
592 | #ifdef VAR_ANSI | ||
593 | /* ANSI version of a "portable" macro set for variable length args */ | ||
594 | #ifndef __STDARG_H__ /**/ | ||
595 | #include <stdarg.h> | ||
596 | #endif /**/ | ||
597 | |||
598 | #define VAR_PLIST(arg1type,arg1) arg1type arg1, ... | ||
599 | #define VAR_PLIST2(arg1type,arg1,arg2type,arg2) arg1type arg1,arg2type arg2,... | ||
600 | #define VAR_ALIST | ||
601 | #define VAR_BDEFN(args,arg1type,arg1) va_list args | ||
602 | #define VAR_BDEFN2(args,arg1type,arg1,arg2type,arg2) va_list args | ||
603 | #define VAR_INIT(args,arg1type,arg1) va_start(args,arg1); | ||
604 | #define VAR_INIT2(args,arg1type,arg1,arg2type,arg2) va_start(args,arg2); | ||
605 | #define VAR_ARG(args,type,arg) arg=va_arg(args,type) | ||
606 | #define VAR_END(args) va_end(args); | ||
607 | |||
608 | #else | ||
609 | |||
610 | /* K&R version of a "portable" macro set for variable length args */ | ||
611 | #ifndef __VARARGS_H__ | ||
612 | #include <varargs.h> | ||
613 | #endif | ||
614 | |||
615 | #define VAR_PLIST(arg1type,arg1) va_alist | ||
616 | #define VAR_PLIST2(arg1type,arg1,arg2type,arg2) va_alist | ||
617 | #define VAR_ALIST va_dcl | ||
618 | #define VAR_BDEFN(args,arg1type,arg1) va_list args; arg1type arg1 | ||
619 | #define VAR_BDEFN2(args,arg1type,arg1,arg2type,arg2) va_list args; \ | ||
620 | arg1type arg1; arg2type arg2 | ||
621 | #define VAR_INIT(args,arg1type,arg1) va_start(args); \ | ||
622 | arg1=va_arg(args,arg1type); | ||
623 | #define VAR_INIT2(args,arg1type,arg1,arg2type,arg2) va_start(args); \ | ||
624 | arg1=va_arg(args,arg1type); arg2=va_arg(args,arg2type); | ||
625 | #define VAR_ARG(args,type,arg) arg=va_arg(args,type) | ||
626 | #define VAR_END(args) va_end(args); | ||
627 | |||
628 | #endif | ||
629 | |||
630 | #ifndef NOPROTO | ||
631 | int BIO_printf( VAR_PLIST( BIO *, bio ) ); | ||
632 | #else | ||
633 | int BIO_printf(); | ||
634 | #endif | ||
635 | 615 | ||
636 | /* BEGIN ERROR CODES */ | 616 | /* BEGIN ERROR CODES */ |
617 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
618 | * made after this point may be overwritten when the script is next run. | ||
619 | */ | ||
620 | void ERR_load_BIO_strings(void); | ||
621 | |||
637 | /* Error codes for the BIO functions. */ | 622 | /* Error codes for the BIO functions. */ |
638 | 623 | ||
639 | /* Function codes. */ | 624 | /* Function codes. */ |
640 | #define BIO_F_ACPT_STATE 100 | 625 | #define BIO_F_ACPT_STATE 100 |
641 | #define BIO_F_BIO_ACCEPT 101 | 626 | #define BIO_F_BIO_ACCEPT 101 |
642 | #define BIO_F_BIO_CTRL 102 | 627 | #define BIO_F_BIO_BER_GET_HEADER 102 |
643 | #define BIO_F_BIO_GETS 103 | 628 | #define BIO_F_BIO_CTRL 103 |
644 | #define BIO_F_BIO_GET_ACCEPT_SOCKET 104 | 629 | #define BIO_F_BIO_GETHOSTBYNAME 120 |
645 | #define BIO_F_BIO_GET_HOST_IP 105 | 630 | #define BIO_F_BIO_GETS 104 |
646 | #define BIO_F_BIO_GET_PORT 106 | 631 | #define BIO_F_BIO_GET_ACCEPT_SOCKET 105 |
647 | #define BIO_F_BIO_NEW 107 | 632 | #define BIO_F_BIO_GET_HOST_IP 106 |
648 | #define BIO_F_BIO_NEW_FILE 108 | 633 | #define BIO_F_BIO_GET_PORT 107 |
649 | #define BIO_F_BIO_PUTS 109 | 634 | #define BIO_F_BIO_MAKE_PAIR 121 |
650 | #define BIO_F_BIO_READ 110 | 635 | #define BIO_F_BIO_NEW 108 |
651 | #define BIO_F_BIO_SOCK_INIT 111 | 636 | #define BIO_F_BIO_NEW_FILE 109 |
652 | #define BIO_F_BIO_WRITE 112 | 637 | #define BIO_F_BIO_NEW_MEM_BUF 126 |
653 | #define BIO_F_BUFFER_CTRL 113 | 638 | #define BIO_F_BIO_NREAD 123 |
654 | #define BIO_F_CONN_STATE 114 | 639 | #define BIO_F_BIO_NREAD0 124 |
655 | #define BIO_F_FILE_CTRL 115 | 640 | #define BIO_F_BIO_NWRITE 125 |
656 | #define BIO_F_MEM_WRITE 116 | 641 | #define BIO_F_BIO_NWRITE0 122 |
657 | #define BIO_F_SSL_NEW 117 | 642 | #define BIO_F_BIO_PUTS 110 |
658 | #define BIO_F_WSASTARTUP 118 | 643 | #define BIO_F_BIO_READ 111 |
644 | #define BIO_F_BIO_SOCK_INIT 112 | ||
645 | #define BIO_F_BIO_WRITE 113 | ||
646 | #define BIO_F_BUFFER_CTRL 114 | ||
647 | #define BIO_F_CONN_CTRL 127 | ||
648 | #define BIO_F_CONN_STATE 115 | ||
649 | #define BIO_F_FILE_CTRL 116 | ||
650 | #define BIO_F_LINEBUFFER_CTRL 129 | ||
651 | #define BIO_F_MEM_READ 128 | ||
652 | #define BIO_F_MEM_WRITE 117 | ||
653 | #define BIO_F_SSL_NEW 118 | ||
654 | #define BIO_F_WSASTARTUP 119 | ||
659 | 655 | ||
660 | /* Reason codes. */ | 656 | /* Reason codes. */ |
661 | #define BIO_R_ACCEPT_ERROR 100 | 657 | #define BIO_R_ACCEPT_ERROR 100 |
662 | #define BIO_R_BAD_FOPEN_MODE 101 | 658 | #define BIO_R_BAD_FOPEN_MODE 101 |
663 | #define BIO_R_BAD_HOSTNAME_LOOKUP 102 | 659 | #define BIO_R_BAD_HOSTNAME_LOOKUP 102 |
660 | #define BIO_R_BROKEN_PIPE 124 | ||
664 | #define BIO_R_CONNECT_ERROR 103 | 661 | #define BIO_R_CONNECT_ERROR 103 |
662 | #define BIO_R_EOF_ON_MEMORY_BIO 127 | ||
665 | #define BIO_R_ERROR_SETTING_NBIO 104 | 663 | #define BIO_R_ERROR_SETTING_NBIO 104 |
666 | #define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 | 664 | #define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 |
667 | #define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 | 665 | #define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 |
668 | #define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 | 666 | #define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107 |
667 | #define BIO_R_INVALID_ARGUMENT 125 | ||
669 | #define BIO_R_INVALID_IP_ADDRESS 108 | 668 | #define BIO_R_INVALID_IP_ADDRESS 108 |
669 | #define BIO_R_IN_USE 123 | ||
670 | #define BIO_R_KEEPALIVE 109 | 670 | #define BIO_R_KEEPALIVE 109 |
671 | #define BIO_R_NBIO_CONNECT_ERROR 110 | 671 | #define BIO_R_NBIO_CONNECT_ERROR 110 |
672 | #define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111 | 672 | #define BIO_R_NO_ACCEPT_PORT_SPECIFIED 111 |
673 | #define BIO_R_NO_HOSTHNAME_SPECIFIED 112 | 673 | #define BIO_R_NO_HOSTNAME_SPECIFIED 112 |
674 | #define BIO_R_NO_PORT_DEFINED 113 | 674 | #define BIO_R_NO_PORT_DEFINED 113 |
675 | #define BIO_R_NO_PORT_SPECIFIED 114 | 675 | #define BIO_R_NO_PORT_SPECIFIED 114 |
676 | #define BIO_R_NO_SUCH_FILE 128 | ||
676 | #define BIO_R_NULL_PARAMETER 115 | 677 | #define BIO_R_NULL_PARAMETER 115 |
677 | #define BIO_R_UNABLE_TO_BIND_SOCKET 116 | 678 | #define BIO_R_TAG_MISMATCH 116 |
678 | #define BIO_R_UNABLE_TO_CREATE_SOCKET 117 | 679 | #define BIO_R_UNABLE_TO_BIND_SOCKET 117 |
679 | #define BIO_R_UNABLE_TO_LISTEN_SOCKET 118 | 680 | #define BIO_R_UNABLE_TO_CREATE_SOCKET 118 |
680 | #define BIO_R_UNINITALISED 119 | 681 | #define BIO_R_UNABLE_TO_LISTEN_SOCKET 119 |
681 | #define BIO_R_UNSUPPORTED_METHOD 120 | 682 | #define BIO_R_UNINITIALIZED 120 |
682 | #define BIO_R_WSASTARTUP 121 | 683 | #define BIO_R_UNSUPPORTED_METHOD 121 |
683 | 684 | #define BIO_R_WRITE_TO_READ_ONLY_BIO 126 | |
685 | #define BIO_R_WSASTARTUP 122 | ||
686 | |||
684 | #ifdef __cplusplus | 687 | #ifdef __cplusplus |
685 | } | 688 | } |
686 | #endif | 689 | #endif |
687 | #endif | 690 | #endif |
688 | |||