RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

bio.h

Go to the documentation of this file.
00001 /* $Id: bio.h,v 1.213.2.4 2005/10/05 05:04:07 hpriddle Exp $ */
00002 /*
00003  * Copyright (C) 1998-2003 RSA Security Inc. All rights reserved.
00004  *
00005  * This work contains proprietary information of RSA Security.
00006  * Distribution is limited to authorized licensees of RSA
00007  * Security. Any unauthorized reproduction, distribution or
00008  * modification of this work is strictly prohibited.
00009  */
00016 #ifndef HEADER_COMMON_BIO_H
00017 #define HEADER_COMMON_BIO_H
00018 
00034 #ifdef        __cplusplus
00035 extern "C" {
00036 #endif
00037 
00041 #ifndef HEADER_BIO_H_TYPEDEF_DEF
00042 #define HEADER_BIO_H_TYPEDEF_DEF
00043 typedef struct bio_st BIO;
00044 #endif /* HEADER_BIO_H_TYPEDEF_DEF */
00045 
00046 #include "r_com.h"                      /* for NULL + MS_FAR + MS_CALLBACK */
00047 #include "r_vararg.h"
00048 #include "bio_err.h"
00049 
00050 #if !defined(NO_SOCK)
00051 #include "sio.h"
00052 #endif
00053 
00054 #ifndef HEADER_COMMON_R_LIB_CTX_TYPEDEF_DEF
00055 #define HEADER_COMMON_R_LIB_CTX_TYPEDEF_DEF
00056 typedef struct r_lib_ctx_st R_LIB_CTX;
00057 #endif
00058 
00059 #ifndef HEADER_COMMON_EX_DATA_H_TYPEDEF_DEF
00060 #define HEADER_COMMON_EX_DATA_H_TYPEDEF_DEF
00061 typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
00062 typedef struct crypto_ex_data_func_st CRYPTO_EX_DATA_FUNCS;
00063 
00064 typedef int ( R_CDECL CRYPTO_EX_DATA_NEW_FUNC)(char *obj, char *item,
00065                                       CRYPTO_EX_DATA *ad,
00066                                       int index, long argl, char *argp);
00067 typedef int ( R_CDECL CRYPTO_EX_DATA_DUP_FUNC)(CRYPTO_EX_DATA *obj_to,
00068                                       CRYPTO_EX_DATA *obj_from,
00069                                       char **new_ptr, int index,
00070                                         long argl, char *argp);
00071 typedef void ( R_CDECL CRYPTO_EX_DATA_FREE_FUNC)(char *obj, char *item,
00072                                         CRYPTO_EX_DATA *ad,
00073                                         int index, long argl, char *argp);
00074 #endif
00075 
00076 /* These are the 'types' of BIOs */
00077 
00078 /* socket/fd for connect or accept */
00103 #define BIO_TYPE_FILTER          0x0200
00104 
00116 #define BIO_TYPE_SOURCE_SINK     0x0400
00117 
00124 #define BIO_TYPE_DESCRIPTOR      0x0100
00125 
00130 #define BIO_TYPE_DGRAM           0x0800
00131 
00135 #define BIO_TYPE_NONE               0
00136 
00140 #define BIO_TYPE_MEM                (1 | BIO_TYPE_SOURCE_SINK)
00141 
00145 #define BIO_TYPE_FILE               (2 | BIO_TYPE_SOURCE_SINK)
00146 
00150 #define BIO_TYPE_FD                 (4 | BIO_TYPE_SOURCE_SINK | \
00151                                      BIO_TYPE_DESCRIPTOR)
00152 
00158 #define BIO_TYPE_NULL               (6 | BIO_TYPE_SOURCE_SINK)
00159 
00160 #define BIO_TYPE_MD                 (8 | BIO_TYPE_FILTER)
00161 
00167 #define BIO_TYPE_BUFFER             (9 | BIO_TYPE_FILTER)
00168 
00169 #define BIO_TYPE_CIPHER             (10 | BIO_TYPE_FILTER)
00170 
00174 #define BIO_TYPE_BASE64             (11 | BIO_TYPE_FILTER)
00175 
00176 /* BER -> BINARY filter. */
00177 #define BIO_TYPE_BER                (18 | BIO_TYPE_FILTER)
00178 
00179 /* Cryptographic Message filter. */
00180 #define BIO_TYPE_CM                 (22 | BIO_TYPE_FILTER)
00181 
00182 /* PKCS #7 message filters. */
00183 #define BIO_TYPE_P7                 (23 | BIO_TYPE_FILTER)
00184 
00185 /* Cryptographic filter. */
00186 #define BIO_TYPE_CR                 (24 | BIO_TYPE_FILTER)
00187 
00191 #define BIO_TYPE_TEFILTER                   (25 | BIO_TYPE_FILTER)
00192 
00198 #define BIO_TYPE_NULL_FILTER        (17 | BIO_TYPE_FILTER)
00199 
00200 #define BIO_TYPE_NBIO_TEST          (16 | BIO_TYPE_FILTER)
00201 #define BIO_TYPE_DNBIO_TEST         (18 | BIO_TYPE_FILTER)
00202 
00203 
00207 #define BIO_TYPE_SSL                (7 | BIO_TYPE_FILTER)
00208 
00212 #define BIO_TYPE_SOCKET             (5 | BIO_TYPE_SOURCE_SINK | \
00213                                      BIO_TYPE_DESCRIPTOR)
00214 
00215 #ifndef NO_SOCK
00216 
00219 #define BIO_TYPE_CONNECT            (12 | BIO_TYPE_SOURCE_SINK | \
00220                                      BIO_TYPE_DESCRIPTOR)
00221 
00225 #define BIO_TYPE_ACCEPT             (13 | BIO_TYPE_SOURCE_SINK | \
00226                                      BIO_TYPE_DESCRIPTOR)
00227 
00228 #define BIO_TYPE_PROXY_CLIENT       (14 | BIO_TYPE_FILTER)
00229 #define BIO_TYPE_PROXY_SERVER       (15 | BIO_TYPE_FILTER)
00230 
00231 #define BIO_TYPE_SOCKS4A_CONNECT    (19 | BIO_TYPE_FILTER)
00232 
00234 #define BIO_TYPE_WTLS               (20 | BIO_TYPE_FILTER)
00235 
00236 /* BIOs that support datagrams. */
00240 #define BIO_TYPE_DGRAM_SOCKET       (32 | BIO_TYPE_DGRAM | \
00241                                      BIO_TYPE_SOURCE_SINK| BIO_TYPE_DESCRIPTOR)
00242 
00246 #define BIO_TYPE_DGRAM_CONNECT      (33 | BIO_TYPE_DGRAM | \
00247                                      BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR)
00248 
00253 #define BIO_TYPE_DGRAM_MUX          (34 | BIO_TYPE_DGRAM | \
00254                                      BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR)
00255 
00260 #define BIO_TYPE_DGRAM_MUX_SESSION  (35 | BIO_TYPE_DGRAM | \
00261                                      BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR)
00262 
00263 #endif /* NO_SOCK */
00264 
00281 #define BIO_CTRL_RESET                1
00282 
00285 #define BIO_CTRL_EOF                2
00286 
00290 #define BIO_CTRL_INFO                3
00291 
00294 #define BIO_CTRL_SET                4
00295 
00298 #define BIO_CTRL_GET                5
00299 
00302 #define BIO_CTRL_PUSH                6
00303 
00306 #define BIO_CTRL_POP                7
00307 
00311 #define BIO_CTRL_GET_CLOSE        8
00312 
00316 #define BIO_CTRL_SET_CLOSE        9
00317 
00320 #define BIO_CTRL_PENDING        10
00321 
00324 #define BIO_CTRL_FLUSH                11
00325 
00328 #define BIO_CTRL_DUP                12
00329 
00332 #define BIO_CTRL_WPENDING        13
00333 
00336 #define BIO_CTRL_SET_CALLBACK        14
00337 
00340 #define BIO_CTRL_GET_CALLBACK        15
00341 
00344 #define BIO_CTRL_SET_FILENAME        30        /* BIO_s_file special */
00345 
00346 /* DGRAM session buffer size: */
00347 #define BIO_CTRL_SET_DGRAM_BUFFER 64
00348 #define BIO_CTRL_GET_DGRAM_BUFFER 65
00349 
00350 #define BIO_CTRL_SET_DGRAM_PEER          66  /* opt - set the peer */
00351 #define BIO_CTRL_GET_DGRAM_PEER          67  /* opt - get the peer */
00352 #define BIO_CTRL_SET_DGRAM_AUTO_CONNECT  68  /* opt - set auto-connect mode */
00353 #define BIO_CTRL_GET_DGRAM_AUTO_CONNECT  69  /* opt - get auto-connect mode */
00354 #define BIO_CTRL_GET_CURRENT_SESSION     70  /* opt - get current session */
00355 #define BIO_CTRL_SET_CURRENT_SESSION     71  /* opt - set current session */
00356 #define BIO_CTRL_GET_NETWORK_TYPE        72  /* opt - get the network type */
00357 #define BIO_CTRL_DELETE_CURRENT_SESSION  73  /* opt - delete current session */
00358 
00363 /* Network types */
00364 #define BIO_NETWORK_TYPE_PACKET           1
00365 #define BIO_NETWORK_TYPE_STREAM           2
00366 
00367 /* modifiers */
00368 #define BIO_FP_READ                 0x02
00369 #define BIO_FP_WRITE                0x04
00370 #define BIO_FP_APPEND               0x08
00371 #define BIO_FP_TEXT                 0x10
00372 #define BIO_FP_NO_SETMODE           0x20
00373 
00382 /* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
00383  * BIO_set_fp(in,stdin,BIO_NOCLOSE); */
00388 #define BIO_NOCLOSE         0x00
00389 
00393 #define BIO_CLOSE           0x01
00394 
00409 #define BIO_FLAGS_READ                        0x01
00410 
00413 #define BIO_FLAGS_WRITE                 0x02
00414 
00418 #define BIO_FLAGS_IO_SPECIAL                0x04
00419 
00423 #define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)
00424 
00429 #define BIO_FLAGS_SHOULD_RETRY                0x08
00430 
00437 #define BIO_FLAGS_FLUSH_ON_WRITE        0x10
00438 
00441 #define BIO_FLAGS_EOM                   0x20
00442 
00443 /* Mostly used in the SSL BIO */
00444 /* No longer in use
00445  * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10
00446  * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20
00447  * #define BIO_FLAGS_PROTOCOL_STARTUP        0x40
00448  */
00449 
00454 #define BIO_FLAGS_BASE64_NO_NL        0x100
00455 
00459 #define BIO_FLAGS_BASE64_NO_CR        0x200
00460 
00464 typedef struct bio_ctrl_peer_param_st
00465 {
00466     char *peer;
00467     int  peer_len;
00468 } BIO_CTRL_PEER_PARAM;
00469 
00470 
00471 #ifdef SSLEAY_MACROS
00472 #define BIO_set_flags(bio, f)   ((bio)->flags |= (f))
00473 
00474 #define BIO_get_flags(bio)      ((bio)->flags)
00475 
00476 #define BIO_set_retry_special(bio) \
00477                ((bio)->flags |= (BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY))
00478 
00479 #define BIO_set_retry_read(bio) \
00480                ((bio)->flags |=( BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY))
00481 
00482 #define BIO_set_retry_write(bio) \
00483                ((bio)->flags |= (BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY))
00484 
00485 /* These are normally used internally in BIOs */
00486 #define BIO_clear_flags(bio, nflags)    ((bio)->flags &= ~(nflags))
00487 
00488 #define BIO_clear_retry_flags(bio) \
00489                 ((bio)->flags &= ~(BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
00490 
00491 #define BIO_get_retry_flags(bio) \
00492                 ((bio)->flags & (BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY))
00493 
00494 /* These should be used by the application to tell why we should retry */
00495 #define BIO_should_read(bio)            ((bio)->flags & BIO_FLAGS_READ)
00496 
00497 #define BIO_should_write(bio)           ((bio)->flags & BIO_FLAGS_WRITE)
00498 
00499 #define BIO_should_io_special(bio)      ((bio)->flags & BIO_FLAGS_IO_SPECIAL)
00500 
00501 #define BIO_retry_type(bio)             ((bio)->flags & BIO_FLAGS_RWS)
00502 
00503 #define BIO_should_retry(bio)           ((bio)->flags & BIO_FLAGS_SHOULD_RETRY)
00504 
00505 
00506 #define BIO_set_cb(bio, cb)             ((bio)->callback=(cb))
00507 
00508 #define BIO_set_cb_arg(bio,arg)         ((bio)->cb_arg=(char *)(arg))
00509 
00510 #define BIO_get_cb_arg(bio)             ((bio)->cb_arg)
00511 
00512 #define BIO_get_cb(bio)                 ((bio)->callback)
00513 
00514 
00515 #define BIO_method_name(bio)            ((bio)->method->name)
00516 
00517 #define BIO_method_type(bio)            ((bio)->method->type)
00518 
00519 #endif /* SSLEAY_MACROS */
00520 
00532  #ifndef NO_SSL
00533 
00537 #define BIO_RR_SSL_X509_LOOKUP                0x01
00538 #endif /* NO_SSL */
00539 
00542 #define BIO_RR_CONNECT                                0x02
00543 
00547 #define BIO_RR_ACCEPT                                0x03
00548 
00565 #define BIO_CB_FREE         0x01
00566 
00567 
00572 #define BIO_CB_READ         0x02
00573 
00578 #define BIO_CB_WRITE        0x03
00579 
00584 #define BIO_CB_PUTS         0x04
00585 
00590 #define BIO_CB_GETS         0x05
00591 
00596 #define BIO_CB_CTRL         0x06
00597 
00601 #define BIO_CB_FUNC_MASK    0x7f
00602 
00610 #define BIO_CB_RETURN         0x80
00611 
00623 #define BIO_CB_return(state)      ((state) | BIO_CB_RETURN))
00624 
00635 #define BIO_cb_pre(state)         (!((state) & BIO_CB_RETURN))
00636 
00646 #define BIO_cb_post(state)        ((state) & BIO_CB_RETURN)
00647 
00648 /* End defgroup BIO_CB_DEF */
00669 #define BIO_CB_TYPE_FUNC            0
00670 
00676 #define BIO_CB_TYPE_INFO            1
00677 
00683 #define BIO_CB_TYPE_STATE           2
00684 
00786 typedef long R_CDECL BIO_CB_FUNC_T(BIO *bio, int cmd, char *argp, int argi,
00787                           long argl, long ret);
00789 typedef long R_CDECL R_BIO_CB_FUNC_T(BIO *bio, int cmd, char *argp, int argi,
00790                           long argl, long ret);
00791 
00808 typedef int R_CDECL BIO_STATE_CB_FUNC_T(BIO *bio, int type, int state, int ret,
00809                                 int flag, char *cb_arg);
00810 
00815 typedef struct bio_state_cb_st
00816 {
00820     BIO_STATE_CB_FUNC_T *cb;
00824     void *cb_arg;
00825 } BIO_STATE_CB;
00826 
00835 typedef struct bio_init_st
00836 {
00840     R_LIB_CTX *lib_ctx;
00841 
00846     int flag;
00847 
00851     void *value;
00852 } BIO_INIT;
00853 
00869 typedef struct bio_method_st
00870 {
00875     int type;
00876 
00881     char *name;
00882 
00883 #if defined(MS_CALLBACK) || defined(MS_FAR)
00884     int (MS_FAR *bwrite)(BIO *bio,char *buf,int len);
00885     int (MS_FAR *bread)(BIO *bio,char *buf,int len);
00886     int (MS_FAR *bputs)(BIO *bio,char *buf);
00887     int (MS_FAR *bgets)(BIO *bio,char *buf, int len);
00888     long (MS_FAR *ctrl)(BIO *bio,int argi,long argl,char *argp);
00889     int (MS_FAR *create)(BIO *bio);
00890     int (MS_FAR *destroy)(BIO *bio);
00891 #else /* !(defined(MS_CALLBACK) || defined(MS_FAR)) */
00892 
00893     int (*bwrite)(BIO *bio,char *buf,int len);
00894 
00896     int (*bread)(BIO *bio,char *buf,int len);
00897 
00899     int (*bputs)(BIO *bio,char *buf);
00900 
00902     int (*bgets)(BIO *bio,char *buf, int len);
00903 
00908     long (*ctrl)(BIO *bio,int argi,long argl,char *argp);
00909 
00914     int (*create)(BIO *bio);
00915 
00921     int (*destroy)(BIO *bio);
00922 #endif /* !(defined(MS_CALLBACK) || defined(MS_FAR)) */
00923 } BIO_METHOD;
00924 
00928 struct bio_st
00929 {
00931     BIO_METHOD *method;
00932 
00945     BIO_CB_FUNC_T *callback;
00946 
00948     char *cb_arg; /* first argument for the callback */
00949 
00957     int init;
00958 
00964     int shutdown;
00965 
00967     int flags;
00968 
00970     int retry_reason;
00971 
00973     int num;
00974 
00979     char *ptr;
00980 
00985     struct bio_st *next_bio;
00986 
00991     struct bio_st *prev_bio;        /* used by filter BIOs */
00992 
00997     int references;
00998 
01000     unsigned long num_read;
01001 
01003     unsigned long num_write;
01004 
01006     CRYPTO_EX_DATA *ex_data;
01007 };
01008 
01014 /* connect BIO information */
01015 #define BIO_CONN_S_BEFORE               1
01016 #define BIO_CONN_S_GET_IP               2
01017 #define BIO_CONN_S_GET_PORT             3
01018 #define BIO_CONN_S_CREATE_SOCKET        4
01019 #define BIO_CONN_S_CONNECT              5
01020 #define BIO_CONN_S_OK                   6
01021 #define BIO_CONN_S_BLOCKED_CONNECT      7
01022 #define BIO_CONN_S_NBIO                 8
01023 
01024 /* socks4a BIO information */
01025 #define BIO_SOCKS4A_S_BEFORE                 1
01026 #define BIO_SOCKS4A_S_GET_IP_AND_PORT        2
01027 #define BIO_SOCKS4A_S_SETUP_CONNECT          3
01028 #define BIO_SOCKS4A_S_CONNECT                4
01029 #define BIO_SOCKS4A_S_READ_RESPONSE          5
01030 #define BIO_SOCKS4A_S_OK                     6
01031 
01032 #define BIO_number_read(bio)        ((bio)->num_read)
01033 #define BIO_number_written(bio)     ((bio)->num_write)
01034 
01035 #define BIO_C_SET_CONNECT                        100
01036 #define BIO_C_DO_STATE_MACHINE                   101
01037 #define BIO_C_SET_NBIO                           102
01038 #define BIO_C_SET_PROXY_PARAM                    103
01039 #define BIO_C_SET_FD                             104
01040 #define BIO_C_GET_FD                             105
01041 #define BIO_C_SET_FILE_PTR                       106
01042 #define BIO_C_GET_FILE_PTR                       107
01043 #define BIO_C_SET_FILENAME                       108
01044 #define BIO_C_SET_SSL                            109
01045 #define BIO_C_GET_SSL                            110
01046 #define BIO_C_SET_MD                             111
01047 #define BIO_C_GET_MD                             112
01048 #define BIO_C_GET_CIPHER_STATUS                  113
01049 #define BIO_C_SET_BUF_MEM                        114
01050 #define BIO_C_GET_BUF_MEM_PTR                    115
01051 #define BIO_C_GET_BUFF_NUM_LINES                 116
01052 #define BIO_C_SET_BUFF_SIZE                      117
01053 #define BIO_C_SET_ACCEPT                         118
01054 #define BIO_C_SSL_MODE                           119
01055 #define BIO_C_GET_MD_CTX                         120
01056 #define BIO_C_GET_PROXY_PARAM                    121
01057 
01058 /* data to read first */
01059 #define BIO_C_SET_BUFF_READ_DATA                 122
01060 
01061 #define BIO_C_GET_CONNECT                        123
01062 #define BIO_C_GET_ACCEPT                         124
01063 #define BIO_C_SET_SSL_RENEGOTIATE_BYTES          125
01064 #define BIO_C_GET_SSL_NUM_RENEGOTIATES           126
01065 #define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT        127
01066 #define BIO_C_FILE_SEEK                          128
01067 #define BIO_C_GET_CIPHER_CTX                     129
01068 
01069 /* return end of input value */
01070 #define BIO_C_SET_BUF_MEM_EOF_RETURN             130
01071 
01072 #define BIO_C_SET_BIND_MODE                      131
01073 #define BIO_C_GET_BIND_MODE                      132
01074 #define BIO_C_FILE_TELL                          133
01075 #define BIO_C_GET_SOCKS                          134
01076 #define BIO_C_SET_SOCKS                          135
01077 #define BIO_C_OPEN_FILE                          136
01078 #define BIO_C_SET_WTLS                           137
01079 #define BIO_C_GET_WTLS                           138
01080 #define BIO_C_SET_WTLS_RENEGOTIATE_BYTES         139
01081 #define BIO_C_GET_WTLS_NUM_RENEGOTIATES          140
01082 #define BIO_C_SET_WTLS_RENEGOTIATE_TIMEOUT       141
01083 #define BIO_C_WTLS_MODE                          142
01084 
01092 #define BIO_C_NEXT_MSG                           143
01093 
01096 #define BIO_C_SET_STORE                          144
01097 
01100 #define BIO_C_SET_VFY_CTX                        145
01101 
01104 #define BIO_C_SET_EITEMS                         146
01105 
01108 #define BIO_C_SET_CTX                            147
01109 
01112 #define BIO_C_SET_CODE                           148
01113 
01117 #define BIO_C_SET_STATE_CB                       149
01118 
01121 #define BIO_C_GET_STATE_CB                       150
01122 
01126 #define BIO_C_END_OF_MSG                         151
01127 
01130 #define BIO_C_STATE_STRING                       152
01131 
01134 #define BIO_C_SET_PADDING_MODE                   153
01135 
01140 #define BIO_C_SET_ASYM_KEY                       154
01141 
01146 #define BIO_C_SET_CERT                           155
01147 
01151 #define BIO_C_SET_ALG_ID                         156
01152 
01155 #define BIO_C_GET_PARAMS                         157
01156 
01159 #define BIO_C_SET_KEY_SIZE                       158
01160 
01163 #define BIO_C_SET_EFF_BITS                       159
01164 
01167 #define BIO_C_SET_NO_ROUNDS                      160
01168 
01171 #define BIO_C_SET_WRAPPED                        161
01172 
01175 #define BIO_C_SET_CONTENT_TYPE                   162
01176 
01180 #define BIO_C_SET_OP_CB                          163
01181 
01184 #define BIO_C_SET_SIGNATURE_COMPUTING            164
01185 
01188 #define BIO_C_SET_SIGN                       BIO_C_SET_SIGNATURE_COMPUTING
01189 
01192 #define BIO_C_SET_SIGNATURE_VERIFICATION         165
01193 
01196 #define BIO_C_SET_VERIFY                     BIO_C_SET_SIGNATURE_VERIFICATION
01197 
01201 #define BIO_C_SET_EX_OP_CB                       166
01202 
01205 #define BIO_C_SET_EXTENSION_CB               BIO_C_SET_EX_OP_CB
01206 
01209 #define BIO_C_INIT                               200
01210 
01215 /* format defines for BIO_dump_format */
01219 #define BIO_DUMP_FORMAT_HEX                   0
01220 
01224 #define BIO_DUMP_FORMAT_HEX_PREFIX            1
01225 
01245 #define BIO_set_app_data(s,arg)     BIO_set_ex_data(s,0,(char *)arg)
01246 
01257 #define BIO_get_app_data(s)         BIO_get_ex_data(s,0)
01258 
01259 int R_CDECL BIO_get_ex_num(BIO *bio);
01260 int R_CDECL BIO_set_ex_data(BIO *bio,int idx,char *data);
01261 char * R_CDECL BIO_get_ex_data(BIO *bio,int idx);
01262 
01263 void R_CDECL BIO_set_ex_free_func(BIO *bio,int idx,CRYPTO_EX_DATA_FREE_FUNC *cb);
01264 int R_CDECL BIO_get_ex_new_index(long argl, char *argp,
01265     CRYPTO_EX_DATA_NEW_FUNC *new_func,
01266         CRYPTO_EX_DATA_DUP_FUNC *dup_func,
01267     CRYPTO_EX_DATA_FREE_FUNC *free_func);
01268 
01269 #if !defined(NO_SOCK)
01270 /* BIO_s_connect() and BIO_s_socks4a_connect() */
01271 
01289 #define BIO_set_conn_hostname(bio,name) \
01290                               BIO_ctrl(bio,BIO_C_SET_CONNECT,0,(char *)name)
01291 
01308 #define BIO_set_conn_port(bio,port) \
01309                       BIO_ctrl(bio,BIO_C_SET_CONNECT,1,(char *)port)
01310 
01327 #define BIO_set_conn_ip(bio,ip)   BIO_ctrl(bio,BIO_C_SET_CONNECT,2,(char *)ip)
01328 
01347 #define BIO_set_conn_int_port(bio,port) \
01348                         BIO_ctrl(bio,BIO_C_SET_CONNECT,3,(char *)&port)
01349 
01367 #define BIO_get_conn_hostname(bio)        BIO_ptr_ctrl(bio,BIO_C_GET_CONNECT,0)
01368 
01380 #define BIO_get_conn_port(bio)            BIO_ptr_ctrl(bio,BIO_C_GET_CONNECT,1)
01381 
01393 #define BIO_get_conn_ip(bio)              BIO_ptr_ctrl(bio,BIO_C_GET_CONNECT,2)
01394 
01410 #define BIO_get_conn_int_port(bio,portp) \
01411                                  BIO_ctrl(bio,BIO_C_GET_CONNECT,3,(char *)portp)
01412 
01413 /* BIO_s_socks4a_connect() also uses */
01414 #define BIO_set_socks_userid(bio,user)      BIO_ctrl(bio,BIO_C_SET_SOCKS,1,user)
01415 #define BIO_get_socks_userid(bio,user)      BIO_ptr_ctrl(bio,BIO_C_GET_SOCKS,1)
01416 
01438 #define BIO_set_nbio(bio,nb_flag) BIO_ctrl(bio,BIO_C_SET_NBIO,(nb_flag),NULL)
01439 
01455 #define BIO_set_accept_port(bio,name) \
01456                                    BIO_ctrl(bio,BIO_C_SET_ACCEPT,0,(char *)name)
01457 
01468 #define BIO_get_accept_port(bio)   BIO_ptr_ctrl(bio,BIO_C_GET_ACCEPT,0)
01469 
01488 #define BIO_set_nbio_accept(bio, nb_flag) \
01489     BIO_ctrl(bio,BIO_C_SET_ACCEPT,1,(nb_flag)?"a":NULL)
01490 
01504 #define BIO_set_accept_bios(accept_bio,template_bio) \
01505                     BIO_ctrl(accept_bio,BIO_C_SET_ACCEPT,2,(char *)template_bio)
01506 
01507 /* Mode needs to come from sio.h */
01508 
01538 #define BIO_set_bind_mode(bio,mode) BIO_ctrl(bio,BIO_C_SET_BIND_MODE,mode,NULL)
01539 
01567 #define BIO_get_bind_mode(bio)         BIO_ctrl(bio,BIO_C_GET_BIND_MODE,0,NULL)
01568 
01569 
01586 #define BIO_do_connect(bio) BIO_do_handshake(bio)
01587 
01612 #define BIO_do_accept(bio)        BIO_do_handshake(bio)
01613 #define BIO_do_dgram_mux(bio)     BIO_do_handshake(bio)
01614 
01629 #define BIO_do_handshake(bio)        BIO_ctrl(bio,BIO_C_DO_STATE_MACHINE,0,NULL)
01630 
01631 /* BIO_s_proxy_client() */
01632 #define BIO_set_url(bio,url) BIO_ctrl(bio,BIO_C_SET_PROXY_PARAM,0,(char *)(url))
01633 #define BIO_set_proxies(bio,p) BIO_ctrl(bio,BIO_C_SET_PROXY_PARAM,1,(char *)(p))
01634 #define BIO_set_filter_bio(bio,s) \
01635                                BIO_ctrl(bio,BIO_C_SET_PROXY_PARAM,2,(char *)(s))
01636 #define BIO_set_proxy_cb(bio,cb) \
01637                               BIO_ctrl(bio,BIO_C_SET_PROXY_PARAM,3,(char *)(cb))
01638 #define BIO_set_proxy_header(bio,sk) \
01639                                 BIO_ctrl(bio,BIO_C_SET_PROXY_PARAM,4,(char *)sk)
01640 #define BIO_set_no_connect_return(bio,bool) \
01641                                   BIO_int_ctrl(bio,BIO_C_SET_PROXY_PARAM,5,bool)
01642 
01643 #define BIO_get_proxy_header(bio,skp) \
01644                                BIO_ctrl(bio,BIO_C_GET_PROXY_PARAM,0,(char *)skp)
01645 #define BIO_get_proxies(bio,pxy_p) \
01646                            BIO_ctrl(bio,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))
01647 #define BIO_get_url(bio,url) BIO_ctrl(bio,BIO_C_GET_PROXY_PARAM,2,(char *)(url))
01648 #define BIO_get_no_connect_return(bio) \
01649                                   BIO_ctrl(bio,BIO_C_GET_PROXY_PARAM,5,NULL)
01650 
01651 #endif /* ! NO_SOCK */
01652 
01667 #define BIO_set_fd(bio,fd,close_flag) \
01668                                     BIO_int_ctrl(bio,BIO_C_SET_FD,close_flag,fd)
01669 
01689 #define BIO_get_fd(bio,fd) BIO_ctrl(bio,BIO_C_GET_FD,0,(char *)fd)
01690 
01714 #define BIO_set_fp(bio,fp,flags) \
01715                 BIO_ctrl(bio,BIO_C_SET_FILE_PTR,flags,(char *)fp)
01716 
01726 #define BIO_get_fp(bio,fp) BIO_ctrl(bio,BIO_C_GET_FILE_PTR,0,(char *)fp)
01727 
01728 
01746 #define BIO_seek(bio,offset)      (int)BIO_ctrl(bio,BIO_C_FILE_SEEK,offset,NULL)
01747 
01761 #define BIO_tell(bio)        (int)BIO_ctrl(bio,BIO_C_FILE_TELL,0,NULL)
01762 
01763 
01776 #define BIO_read_filename(bio,name) BIO_ctrl(bio,BIO_C_SET_FILENAME, \
01777                 BIO_CLOSE|BIO_FP_READ,name)
01778 
01791 #define BIO_write_filename(bio,name) BIO_ctrl(bio,BIO_C_SET_FILENAME, \
01792                 BIO_CLOSE|BIO_FP_WRITE,name)
01793 
01805 #define BIO_append_filename(bio,name) BIO_ctrl(bio,BIO_C_SET_FILENAME, \
01806                 BIO_CLOSE|BIO_FP_APPEND,name)
01807 
01822 #define BIO_rw_filename(bio,name) BIO_ctrl(bio,BIO_C_SET_FILENAME, \
01823                 BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)
01824 
01829 /* WARNING: This increments the reference count on the read BIO of the
01830  * SSL structure.  This is because the ssl read BIO is now pointed to by
01831  * the next_bio field in the BIO.  So when you free the BIO, make sure
01832  * you are doing a BIO_free_all() to catch the underlying BIO. */
01833 
01834 #if !defined(NO_SOCK)
01835 
01865 #define BIO_set_ssl(bio,ssl,close_flag) \
01866         BIO_ctrl(bio,BIO_C_SET_SSL,close_flag,(char *)ssl)
01867 
01880 #define BIO_get_ssl(bio,sslp)        BIO_ctrl(bio,BIO_C_GET_SSL,0,(char *)sslp)
01881 
01897 #define BIO_set_ssl_mode(bio,client)    BIO_ctrl(bio,BIO_C_SSL_MODE,client,NULL)
01898 
01912 #define BIO_set_ssl_renegotiate_bytes(bio,num) \
01913         BIO_ctrl(bio,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
01914 #define BIO_get_num_renegotiates(bio) \
01915         BIO_ctrl(bio,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
01916 
01930 #define BIO_set_ssl_renegotiate_timeout(bio,seconds) \
01931         BIO_ctrl(bio,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
01932 
01933 #define BIO_set_wtls(bio,wtls,c)     BIO_ctrl(bio,BIO_C_SET_WTLS,c,(char *)wtls)
01934 #define BIO_get_wtls(bio,wtlsp) BIO_ctrl(bio,BIO_C_GET_WTLS,0,(char *)wtlsp)
01935 #define BIO_set_wtls_mode(bio,client) BIO_ctrl(bio,BIO_C_WTLS_MODE,client,NULL)
01936 #define BIO_set_wtls_renegotiate_bytes(bio,num) \
01937         BIO_ctrl(bio,BIO_C_SET_WTLS_RENEGOTIATE_BYTES,num,NULL);
01938 #define BIO_set_wtls_renegotiate_timeout(bio,seconds) \
01939         BIO_ctrl(bio,BIO_C_SET_WTLS_RENEGOTIATE_TIMEOUT,seconds,NULL);
01940 
01944 #endif /* ! NO_SOCK */
01945 
01951 #define BIO_get_mem_data(bio,pp)    BIO_ctrl(bio,BIO_CTRL_INFO,0,(char *)pp)
01952 #define BIO_set_mem_buf(bio,bm,c)   BIO_ctrl(bio,BIO_C_SET_BUF_MEM,c,(char *)bm)
01953 #define BIO_get_mem_ptr(bio,pp) BIO_ctrl(bio,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)
01954 
01966 /* Note: this always returns 1 */
01967 #define BIO_set_mem_eof_return(bio,v) \
01968                                BIO_ctrl(bio,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)
01969 
01980 #define BIO_get_buffer_num_lines(bio) \
01981                                   BIO_ctrl(bio,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
01982 
01994 #define BIO_set_buffer_size(bio,size) \
01995                                   BIO_ctrl(bio,BIO_C_SET_BUFF_SIZE,size,NULL)
01996 
02008 #define BIO_set_read_buffer_size(bio,size) \
02009                                   BIO_int_ctrl(bio,BIO_C_SET_BUFF_SIZE,size,0)
02010 
02022 #define BIO_set_write_buffer_size(bio,size) \
02023                                   BIO_int_ctrl(bio,BIO_C_SET_BUFF_SIZE,size,1)
02024 
02037 #define BIO_set_buffer_read_data(bio,buf,num) \
02038                                   BIO_ctrl(bio,BIO_C_SET_BUFF_READ_DATA,num,buf)
02039 
02040 /* Don't use the next one unless you know what you are doing */
02041 #define BIO_dup_state(bio,ret)    BIO_ctrl(bio,BIO_CTRL_DUP,0,(char *)(ret))
02042 
02043 
02058 #define BIO_reset(bio)             (int)BIO_ctrl(bio,BIO_CTRL_RESET,0,NULL)
02059 
02070 #define BIO_eof(bio)               (int)BIO_ctrl(bio,BIO_CTRL_EOF,0,NULL)
02071 
02106 #define BIO_set_close(bio,mode) \
02107                                (int)BIO_ctrl(bio,BIO_CTRL_SET_CLOSE,(mode),NULL)
02108 
02121 #define BIO_get_close(bio)        (int)BIO_ctrl(bio,BIO_CTRL_GET_CLOSE,0,NULL)
02122 
02137 #define BIO_pending(bio)             (int)BIO_ctrl(bio,BIO_CTRL_PENDING,0,NULL)
02138 
02149 #define BIO_wpending(bio)            (int)BIO_ctrl(bio,BIO_CTRL_WPENDING,0,NULL)
02150 
02165 #define BIO_flush(bio)                (int)BIO_ctrl(bio,BIO_CTRL_FLUSH,0,NULL)
02166 
02181 #define BIO_get_info_cb(bio,cbp) \
02182                         (int)BIO_ctrl(bio,BIO_CTRL_GET_CALLBACK,0,(char *)cbp)
02183 
02197 #define BIO_set_info_cb(bio,cbp) \
02198                         (int)BIO_ctrl(bio,BIO_CTRL_SET_CALLBACK,0,(char *)cbp)
02199 
02200 #define BIO_get_network_type(bio) \
02201                            BIO_ctrl(bio, BIO_CTRL_GET_NETWORK_TYPE, 0, NULL)
02202 
02203 /* For the BIO_f_buffer() type */
02204 #define BIO_buffer_get_num_lines(bio) \
02205                            BIO_ctrl(bio,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
02206 
02211 #if !defined(SSLCME) || (defined(SSLCME) && defined(MES))
02212 
02234 #define BIO_end_of_msg(bio)     (int)BIO_ctrl(bio,BIO_C_END_OF_MSG,0,NULL)
02235 
02248 #define BIO_set_verification(bio, ctx)                  \
02249     BIO_ctrl(bio, BIO_C_SET_VFY_CTX, 0, (char *)ctx)
02250 
02263 #define BIO_set_store(bio, store)                       \
02264     BIO_ctrl(bio, BIO_C_SET_STORE, 0, (char *)store)
02265 
02278 #define BIO_set_cert(bio, cert)                         \
02279     BIO_ctrl(bio, BIO_C_SET_CERT, 0, (char *)cert)
02280 
02293 #define BIO_set_asym_key(bio, pkey)                     \
02294     BIO_ctrl(bio, BIO_C_SET_ASYM_KEY, 0, (char *)pkey)
02295 
02309 #define BIO_set_alg(bio, alg_id)                        \
02310     BIO_ctrl(bio, BIO_C_SET_ALG_ID, alg_id, NULL)
02311 
02328 #define BIO_set_content_type(bio, type)                 \
02329     BIO_ctrl(bio, BIO_C_SET_CONTENT_TYPE, type, NULL)
02330 
02344 #define BIO_set_unwrapped(bio)                          \
02345      BIO_ctrl(bio, BIO_C_SET_WRAPPED, 0, NULL)
02346 
02352 #endif /* SSLCME */
02353 
02354 /*
02355 #ifdef NO_STDIO
02356 #define NO_FP_API
02357 #endif
02358 */
02359 
02365 #ifdef SSLC_COMPAT_MACROS
02366 #define BIO_sock_should_retry            SIO_sock_should_retry
02367 #define BIO_conn_should_retry            SIO_conn_should_retry
02368 #define BIO_sock_non_fatal_error         SIO_sock_non_fatal_error
02369 #define BIO_conn_non_fatal_error         SIO_conn_non_fatal_error
02370 #define BIO_fd_should_retry              SIO_fd_should_retry
02371 #define BIO_fd_non_fatal_error           SIO_fd_non_fatal_error
02372 #define BIO_gethostbyname                SIO_gethostbyname
02373 #define BIO_gethostbyaddr                SIO_gethostbyaddr
02374 #define BIO_set_gethostbyname            SIO_set_gethostbyname
02375 #define BIO_get_gethostbyname            SIO_get_gethostbyname
02376 #define BIO_set_gethostbyaddr            SIO_set_gethostbyaddr
02377 #define BIO_get_gethostbyaddr            SIO_get_gethostbyaddr
02378 #define BIO_sock_error                   SIO_sock_error
02379 #define BIO_socket_ioctl                 SIO_socket_ioctl
02380 #define BIO_socket_nbio                  SIO_socket_nbio
02381 #define BIO_get_port                     SIO_get_port
02382 #define BIO_get_host_ip                  SIO_get_host_ip
02383 #define BIO_get_accept_socket            SIO_get_accept_socket
02384 #define BIO_accept                       SIO_accept
02385 #define BIO_connect                      SIO_connect
02386 #define BIO_sock_init                    SIO_sock_init
02387 #define BIO_sock_cleanup                 SIO_sock_cleanup
02388 #define BIO_set_tcp_nodelay              SIO_set_tcp_nodelay
02389 #define BIO_ghbn_ctrl                    SIO_ghbn_ctrl
02390 #define BIO_ghbn_default                 SIO_ghbn_default
02391 #define BIO_ghbn_cache                   SIO_ghbn_cache
02392 #define BIO_ghbn_cache_ctrl              SIO_ghbn_cache_ctrl
02393 #define BIO_ghba_default                 SIO_ghba_default
02394 
02395 
02399 #define BIO_BIND_NORMAL                  SIO_BIND_NORMAL
02400 
02401 #define BIO_BIND_REUSEADDR_IF_UNUSED     SIO_BIND_REUSEADDR_IF_UNUSED
02402 
02406 #define BIO_BIND_REUSEADDR               SIO_BIND_REUSEADDR
02407 #define BIO_R_SHOULD_RETRY               ERR_R_SHOULD_RETRY
02408 #endif /* SSLC_COMPAT_MACROS */
02409 
02410 /* old names */
02411 #define BIO_set_callback(a,b) BIO_set_cb(a,b)
02412 #define BIO_set_callback_arg(a,b) BIO_set_cb_arg(a,b)
02413 #define BIO_get_callback_arg(a) BIO_get_cb_arg(a)
02414 #define BIO_get_callback(a) BIO_get_cb(a)
02415 #define BIO_get_info_callback(a,b) BIO_get_info_cb(a,b)
02416 #define BIO_set_info_callback(a,b) BIO_set_info_cb(a,b)
02417 #define BIO_debug_callback BIO_debug_cb
02418 #define BIO_set_tcp_ndelay(x,y) BIO_set_tcp_nodelay(x,y)
02419 
02420 #ifndef NO_FP_API
02421 #  if defined(WIN16) && defined(_WINDLL)
02422 BIO_METHOD * R_CDECL BIO_s_file_internal();
02423 BIO * R_CDECL BIO_new_file_internal(char *filename, char *mode);
02424 BIO * R_CDECL BIO_new_fp_internal(FILE *stream, int close_flag);
02425 #         define BIO_s_file        BIO_s_file_internal
02426 #         define BIO_new_file      BIO_new_file_internal
02427 #         define BIO_new_fp        BIO_new_fp_internal
02428 #  else /* defined(WIN16) && defined(_WINDLL)  */
02429 
02430 BIO_METHOD * R_CDECL BIO_s_file();
02431 
02442 BIO * R_CDECL BIO_new_file(char *filename, char *mode);
02443 BIO * R_CDECL BIO_new_fp(FILE *stream, int close_flag);
02444 #         define BIO_s_file_internal         BIO_s_file
02445 #         define BIO_new_file_internal       BIO_new_file
02446 #         define BIO_new_fp_internal         BIO_new_fp
02447 #  endif /* defined(WIN16) && defined(_WINDLL)        */
02448 #endif /* NO_FP_API */
02449 
02462 BIO * R_CDECL BIO_new(BIO_METHOD *method);
02463 int R_CDECL BIO_new_init(R_LIB_CTX *lib_ctx, int flag, int type, int sub_id,
02464     void *value, BIO **bio);
02465 int R_CDECL BIO_set(BIO *bio,BIO_METHOD *type);
02466 int R_CDECL BIO_free(BIO *bio);
02467 void R_CDECL BIO_free_all(BIO *bio);
02477 int R_CDECL BIO_read(BIO *bio, char *out, int outl);
02478 int R_CDECL BIO_gets(BIO *bio, char *in, int inl);
02479 int R_CDECL BIO_write(BIO *bio, char *in, int inl);
02480 int R_CDECL BIO_puts(BIO *bio, char *in);
02481 long R_CDECL BIO_ctrl(BIO *bio, int cmd, long larg, char *parg);
02482 char * R_CDECL BIO_ptr_ctrl(BIO *bio, int cmd, long larg);
02483 long R_CDECL BIO_int_ctrl(BIO *bio, int cmd, long larg, int iarg);
02484 BIO * R_CDECL BIO_push(BIO *bio, BIO *stack);
02485 BIO * R_CDECL BIO_pop(BIO *bio);
02486 BIO * R_CDECL BIO_find_type(BIO *bio, int type);
02487 BIO * R_CDECL BIO_get_retry_BIO(BIO *bio, int *reason);
02488 BIO * R_CDECL BIO_dup_chain(BIO *in);
02489 
02490 long MS_CALLBACK R_CDECL BIO_debug_cb(BIO *bio,int cmd,char *argp,int argi,
02491         long argl,long ret);
02501 int R_CDECL BIO_read(BIO *bio, char *out, int outl);
02502 int R_CDECL BIO_gets(BIO *bio, char *in, int inl);
02503 BIO_METHOD * R_CDECL BIO_s_mem();
02504 BIO_METHOD * R_CDECL BIO_s_null();
02508 #ifndef NO_SOCK
02509 
02514 BIO_METHOD * R_CDECL BIO_s_socket();
02515 BIO_METHOD * R_CDECL BIO_s_connect();
02516 BIO_METHOD * R_CDECL BIO_s_accept();
02525 BIO_METHOD * R_CDECL BIO_s_fd();
02526 BIO_METHOD * R_CDECL BIO_s_udp_connect();
02527 BIO_METHOD * R_CDECL BIO_s_dgram_mux();
02528 BIO_METHOD * R_CDECL BIO_s_dgram_mux_session();
02532 #endif /* NO_SOCK */
02533 
02534 /*
02535  * This section lists the Filter BIOs that may be used in a BIO stack.
02536  * These provide data filtering
02537  * prior to writing to, or after reading from, a source/sink #BIO.
02538  */
02544 BIO_METHOD * R_CDECL BIO_f_null();
02545 BIO_METHOD * R_CDECL BIO_f_buffer();
02546 BIO_METHOD * R_CDECL BIO_f_nbio_test();
02556 int R_CDECL BIO_dump(BIO *bio,unsigned char *bytes,int len);
02557 int R_CDECL BIO_dump_format(BIO *bio, unsigned char *data, int len, int format,
02558                                     int separator, int indent, int wrap);
02559 
02560 void R_CDECL ERR_load_BIO_strings();
02561 
02562 BIO * R_CDECL BIO_new_mem();
02563 #if !defined(NO_SOCK)
02564 
02582 BIO * R_CDECL BIO_new_socket(SIO_SOCK fd, int close_flag);
02583 
02584 BIO * R_CDECL BIO_new_dgram(int sock, int close_flag);
02585 
02586 BIO * R_CDECL BIO_new_fd(int fd, int close_flag);
02587 
02588 BIO * R_CDECL BIO_new_fd_file(char *filename, char *mode);
02589 
02590 BIO * R_CDECL BIO_new_connect(char *host_port);
02591 BIO * R_CDECL BIO_new_accept(char *host_port);
02592 BIO * R_CDECL BIO_new_dgram_connect(char *host_port);
02593 BIO * R_CDECL BIO_new_dgram_mux(char *host_port);
02594 BIO * R_CDECL BIO_new_dgram_mux_session(char *peer_addr);
02595 #endif /* !defined(NO_SOCK) */
02596 void R_CDECL BIO_copy_next_retry(BIO *bio);
02597 
02598 void R_CDECL BIO_reference_inc(BIO *bio);
02603 #ifndef SSLEAY_MACROS
02604 
02609 void R_CDECL BIO_set_flags(BIO *bio,int f);
02610 
02611 int R_CDECL BIO_get_flags(BIO *bio);
02612 
02613 void R_CDECL BIO_set_retry_special(BIO *bio);
02614 
02615 void R_CDECL BIO_set_retry_read(BIO *bio);
02616 
02617 void R_CDECL BIO_set_retry_write(BIO *bio);
02618 
02619 void R_CDECL BIO_clear_flags(BIO *bio,int f);
02620 
02621 void R_CDECL BIO_clear_retry_flags(BIO *bio);
02622 
02623 int R_CDECL BIO_get_retry_flags(BIO *bio);
02624 
02625 int R_CDECL BIO_should_read(BIO *bio);
02626 
02627 int R_CDECL BIO_should_write(BIO *bio);
02628 
02629 int R_CDECL BIO_should_io_special(BIO *bio);
02630 
02631 int R_CDECL BIO_retry_type(BIO *bio);
02632 
02633 int R_CDECL BIO_should_retry(BIO *bio);
02634 
02635 int R_CDECL BIO_get_retry_reason(BIO *bio);
02636 
02637 char * R_CDECL BIO_method_name(BIO *bio);
02638 
02639 int R_CDECL BIO_method_type(BIO *bio);
02649 void R_CDECL BIO_set_cb(BIO *bio, BIO_CB_FUNC_T *cb);
02650 void R_CDECL BIO_set_cb_arg(BIO *bio, char *arg);
02651 void R_CDECL BIO_set_bio_cb(BIO *bio, BIO_CB_FUNC_T *cb, char *arg);
02652 
02653 
02654 char * R_CDECL BIO_get_cb_arg(BIO *bio);
02655 BIO_CB_FUNC_T * R_CDECL BIO_get_cb(BIO *bio);
02656 
02657 void R_CDECL BIO_set_state_cb(BIO *bio, BIO_STATE_CB_FUNC_T *cb, char *arg);
02658 
02659 int R_CDECL BIO_state_to_string(BIO *bio, int state, unsigned int len, char *str);
02660 
02661 char * R_CDECL BIO_get_state_cb_arg(BIO *bio);
02662 BIO_STATE_CB_FUNC_T * R_CDECL BIO_get_state_cb(BIO *bio);
02663 
02664 int R_CDECL BIO_set_cb_recursive(BIO *bio, int type, void *cb, char *arg);
02665 
02666 int R_CDECL BIO_flags_to_string(int flags, char sep, unsigned int len, char *str);
02667 
02668 int R_CDECL BIO_cb_cmd_to_string(int cmd, unsigned int len, char *str);
02669 
02674 #endif /* !SSLEAY_MACROS */
02675 
02681 int R_CDECL BIO_open_file(BIO  *bio,char *name,char *mode);
02691 int R_CDECL BIO_set_dgram_peer(BIO *bio, char *peer,int peer_len);
02692 int R_CDECL BIO_get_dgram_peer(BIO *bio, char **peer,int *peer_len);
02693 int R_CDECL BIO_set_dgram_auto_connect(BIO *bio, int flag);
02694 int R_CDECL BIO_get_dgram_auto_connect(BIO *bio);
02695 int R_CDECL BIO_get_current_session(BIO *bio, BIO **active);
02696 int R_CDECL BIO_set_current_session(BIO *bio, BIO *active);
02697 int R_CDECL BIO_delete_current_session(BIO *bio, BIO *active);
02698 
02715 #define BIO_PRINT_HEX_REVERSE        1
02716 int R_CDECL BIO_print_hex(BIO *bio, unsigned char *bytes,int len,int flags);
02717 
02718 #ifdef ANSI_STRICT
02719 int R_CDECL BIO_printf(BIO *bio, ...);
02720 #else
02721 int R_CDECL BIO_printf( VAR_PLIST( BIO *, bio ) );
02722 #endif
02723 
02727 /* Using the TEST_FRAMEWORK is done on a globally for a build, however
02728  * the OVERRIDE_TEST_FRAMEWORK can be defined on a per file basis. Currently
02729  * the build system does not support creating a define for a directory, so
02730  * this is the only way to override using the test framework.
02731  */
02732 #ifdef TEST_FRAMEWORK
02733 #ifndef OVERRIDE_TEST_FRAMEWORK
02734 
02735 #include "te_bio_filter.h"
02736 #include "temessage_type.h"
02737 
02744 #define BIO_new_fp(fp, param) \
02745     ((stdout == fp || stderr == fp) ? BIO_new_tefilter(): BIO_new_fp(fp, param))
02746 
02747 #endif
02748 #endif
02749 
02750 #ifdef        __cplusplus
02751 }
02752 #endif
02753 #endif /* HEADER_COMMON_BIO_H */
02754 
02755 

Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 072-001001-2100-001-000 - 2.1