| RSA BSAFE Micro Edition Suite |
Streamlined security for mobile and embedded devices |
 
![]() |
Each BIO has seven methods. A NULL pointer indicates that the method is not implemented.
The methods define the behavior of an individual BIO type, and are called directly by the BIO access functions. The methods modify the general BIO behavior by replacing it with the specific behavior for the BIO sub-class.
#include <bio.h>
typedef struct bio_method_st { int type; char *name; #if defined(MS_CALLBACK) || defined(MS_FAR) int (MS_FAR *bwrite)(BIO *bio,char *buf,int len); int (MS_FAR *bread)(BIO *bio,char *buf,int len); int (MS_FAR *bputs)(BIO *bio,char *buf); int (MS_FAR *bgets)(BIO *bio,char *buf, int len); long (MS_FAR *ctrl)(BIO *bio,int argi,long argl,char *argp); int (MS_FAR *create)(BIO *bio); int (MS_FAR *destroy)(BIO *bio); #else /* !(defined(MS_CALLBACK) || defined(MS_FAR)) */ int (*bwrite)(BIO *bio,char *buf,int len); int (*bread)(BIO *bio,char *buf,int len); int (*bputs)(BIO *bio,char *buf); int (*bgets)(BIO *bio,char *buf, int len); long (*ctrl)(BIO *bio,int argi,long argl,char *argp); int (*create)(BIO *bio); int (*destroy)(BIO *bio); #endif /* !(defined(MS_CALLBACK) || defined(MS_FAR)) */ } BIO_METHOD;
Data Fields | |
| int | type |
| The numeric identifier for the BIO_METHOD containing bits for the general/class and specific/instance. | |
| char* | name |
| The string identifier corresponding to the type. More... | |
| int(* | bwrite )(BIO *bio, char *buf, int len) |
| The method for writing a number of Bytes from a buffer. | |
| int(* | bread )(BIO *bio, char *buf, int len) |
| The method for reading Bytes into a buffer. | |
| int(* | bputs )(BIO *bio, char *buf) |
| The special write method. | |
| int(* | bgets )(BIO *bio, char *buf, int len) |
| The special read method. | |
| long(* | ctrl )(BIO *bio, int argi, long argl, char *argp) |
| A general object control allowing object functionality in addition to read/write and create/destroy operations. | |
| int(* | create )(BIO *bio) |
| The method for creating a BIO instance (including setting values and allocating context memory). | |
| int(* | destroy )(BIO *bio) |
| The method for freeing an instance. More... | |
|
|
The method for freeing an instance. The shutdown flag is checked to determine whether the instance state (for example, underlying file descriptors) should also be closed. |
|
|
The string identifier corresponding to the type.
|