RSA BSAFE SSL-C

Security protocol components for C

Search

bio.h File Reference

This file provides the Basic Input/Output (BIO) functionality including functions, typedefs and structure declarations.

#include "r_com.h"
#include "r_vararg.h"
#include "bio_err.h"
#include "sio.h"

Go to the source code of this file.

Data Structures

 BIO_METHOD
 This structure stores pointers to functions that implement the BIO methods. More...

 BIO
 This structure contains the data and BIO method structure. More...


Defines

#define BIO_TYPE_FILTER
 The base type indicating that a BIO of this type modifies the data written to, or read from a source/sink BIO. More...

#define BIO_TYPE_SOURCE_SINK
 The base type indicating that a BIO of this type takes data from a device, and/or sends data to a device (data exchange). More...

#define BIO_TYPE_DESCRIPTOR
 The base type that may be combined with the source/sink base type to indicate that the BIO uses a file descriptor. More...

#define BIO_TYPE_DGRAM
 The base type that may be combined with the source/sink base type to indicate that the BIO is a datagram socket.

#define BIO_TYPE_NONE
 Indicates that the BIO does not have a defined type.

#define BIO_TYPE_MEM
 Indicates that the BIO is a memory buffer source/sink BIO.

#define BIO_TYPE_FILE
 Indicates that the BIO is a file pointer source/sink BIO.

#define BIO_TYPE_FD
 Indicates that the BIO is a file descriptor source/sink BIO.

#define BIO_TYPE_NULL
 Indicates that the BIO is a NULL source/sink BIO. More...

#define BIO_TYPE_BUFFER
 Indicates that the BIO is a data buffer filter BIO. More...

#define BIO_TYPE_BASE64
 Indicates that the BIO is a data base 64 filter BIO.

#define BIO_TYPE_TEFILTER
 Test Framework filter.

#define BIO_TYPE_NULL_FILTER
 Indicates that the BIO is a NULL filter BIO. More...

#define BIO_TYPE_SSL
 Indicates that the BIO is a Secure Socket Layer (SSL) filter BIO.

#define BIO_TYPE_SOCKET
 Indicates that the BIO is a socket source/sink BIO.

#define BIO_TYPE_CONNECT
 Indicates that the BIO is a socket connect source/sink BIO.

#define BIO_TYPE_ACCEPT
 Indicates that the BIO is a socket accept source/sink BIO.

#define BIO_TYPE_WTLS
 Indicates that the BIO is a filter BIO for WTLS operations.

#define BIO_TYPE_DGRAM_SOCKET
 Indicates that the BIO is a datagram socket source/sink BIO.

#define BIO_TYPE_DGRAM_CONNECT
 Indicates that the BIO is a datagram socket connect source/sink BIO.

#define BIO_TYPE_DGRAM_MUX
 Indicates that the BIO is a datagram socket multiplexing source/sink BIO.

#define BIO_TYPE_DGRAM_MUX_SESSION
 Indicates that the BIO is a datagram socket multiplexing session source/sink BIO.

#define BIO_CTRL_RESET
 Rewinds to the start of input or output and resets the state of the BIO. More...

#define BIO_CTRL_EOF
 Verifies if the BIO has reached the End-of-File (EOF) marker.

#define BIO_CTRL_INFO
 Retrieves extra information from the BIO. More...

#define BIO_CTRL_SET
 Sets the BIO I/O type.

#define BIO_CTRL_GET
 Retrieves the BIO I/O type.

#define BIO_CTRL_PUSH
 An internal control used for BIO stack manipulation.

#define BIO_CTRL_POP
 An internal control used for BIO stack manipulation.

#define BIO_CTRL_GET_CLOSE
 Retrieves the state of the BIO shutdown flag used by BIO_free(). More...

#define BIO_CTRL_SET_CLOSE
 Sets the state of the BIO shutdown flag used by BIO_free(). More...

#define BIO_CTRL_PENDING
 Verifies if there is more data buffered in the BIO to use.

#define BIO_CTRL_FLUSH
 Flushes any remaining data from the BIO data buffer.

#define BIO_CTRL_DUP
 Contains extra information to use for a duplicated BIO.

#define BIO_CTRL_WPENDING
 Retrieves the number of Bytes in the BIO data buffer pending to write.

#define BIO_CTRL_SET_CALLBACK
 Sets the BIO callback function.

#define BIO_CTRL_GET_CALLBACK
 Retrieves a pointer to a BIO callback function.

#define BIO_CTRL_SET_FILENAME
 Sets the file name to be used by the file BIO.

#define BIO_NOCLOSE
 Indicates not to close the I/O stream on BIO_free(). More...

#define BIO_CLOSE
 Indicates to close the I/O stream on BIO_free(). More...

#define BIO_FLAGS_READ
 Indicates that the BIO has data to read.

#define BIO_FLAGS_WRITE
 Indicates that the BIO has data to write.

#define BIO_FLAGS_IO_SPECIAL
 Indicates that the BIO performs custom socket I/O. More...

#define BIO_FLAGS_RWS
 Indicates a combination of BIO_FLAGS_READ, BIO_FLAGS_WRITE and BIO_FLAGS_IO_SPECIAL.

#define BIO_FLAGS_SHOULD_RETRY
 Indicates whether a retry on write or read should be attempted for the BIO. More...

#define BIO_FLAGS_FLUSH_ON_WRITE
 Indicates that the BIO should flush the data buffer on the write operation.

#define BIO_FLAGS_EOM
 Indicates that there is no more data in the message.

#define BIO_FLAGS_BASE64_NO_NL
 Indicates that the Base64 encoding uses no new line '\n' line ending character.

#define BIO_FLAGS_BASE64_NO_CR
 Indicates that the Base64 encoding uses no carriage return '\r' line ending character.

#define BIO_RR_SSL_X509_LOOKUP
 Returned from the SSL BIO if the certificate retrieval code has an error.

#define BIO_RR_CONNECT
 Returned from the connect BIO when a connection would have been blocked.

#define BIO_RR_ACCEPT
 Returned from the accept BIO. More...

#define BIO_CB_FREE
 Indicates that the BIO callback function was called during an execution of BIO_free().

#define BIO_CB_READ
 Indicates that the BIO callback function was called during an execution of BIO_read().

#define BIO_CB_WRITE
 Indicates that the BIO callback function was called during an execution of BIO_write().

#define BIO_CB_PUTS
 Indicates that the BIO callback function was called during an execution of BIO_puts().

#define BIO_CB_GETS
 Indicates that the BIO callback function was called during an execution of BIO_gets().

#define BIO_CB_CTRL
 Indicates that the BIO callback function was called during an execution of BIO_ctrl().

#define BIO_CB_FUNC_MASK
 Used to mask the function number of the command.

#define BIO_CB_RETURN
 Indicates that the BIO callback function was called after the execution of the underlying operation, rather than before. More...

#define BIO_CB_TYPE_FUNC
 This is the standard callback function. More...

#define BIO_CB_TYPE_INFO
 This is the information callback for connections. More...

#define BIO_CB_TYPE_STATE
 This is the state callback. More...

#define BIO_C_NEXT_MSG
 Performs processing to prepare for the next message.

#define BIO_C_SET_STORE
 Sets the store context against the BIO filter.

#define BIO_C_SET_VFY_CTX
 Sets the verification context against the BIO filter.

#define BIO_C_SET_EITEMS
 Sets the R_EITEM against the BIO filter.

#define BIO_C_SET_CTX
 Sets the context for further operations against the BIO filter.

#define BIO_C_SET_CODE
 Sets the OP program code against the BIO filter.

#define BIO_C_SET_STATE_CB
 Sets the state callback and argument against the BIO filter.

#define BIO_C_GET_STATE_CB
 Retrieves the state callback and argument from the BIO filter.

#define BIO_C_END_OF_MSG
 Indicates that all the data has been written and any post-processing should start and/or trailing data should now be put out.

#define BIO_C_STATE_STRING
 Obtains the string corresponding to the state value passed.

#define BIO_C_SET_PADDING_MODE
 Sets the padding method for a cipher BIO.

#define BIO_C_SET_ASYM_KEY
 Sets the private asymmetric key for a cryptographic message BIO. More...

#define BIO_C_SET_CERT
 Sets the certificate of a recipient for a cryptographic message BIO. More...

#define BIO_C_SET_ALG_ID
 Sets the ID of the encryption algorithm used in encrypting the content data of an enveloped message.

#define BIO_C_GET_PARAMS
 Retrieves the parameters of the cryptographic algorithm.

#define BIO_C_SET_KEY_SIZE
 Sets the size (length) of the key.

#define BIO_C_SET_EFF_BITS
 Sets the effective key bits.

#define BIO_C_SET_NO_ROUNDS
 Sets the number of rounds.

#define BIO_C_SET_WRAPPED
 Indicates whether the cryptographic message is wrapped.

#define BIO_C_SET_CONTENT_TYPE
 Sets the content type of the cryptographic message.

#define BIO_C_SET_OP_CB
 Sets the operation callback and argument against the cryptographic message BIO.

#define BIO_C_INIT
 Initializes the BIO with the data passed in.

#define BIO_DUMP_FORMAT_HEX
 Format the output of each Byte as two hexadecimal characters.

#define BIO_DUMP_FORMAT_HEX_PREFIX
 Format the output of each Byte as '0x' (zero-small-x), followed by two hexadecimal characters.

#define BIO_BIND_NORMAL
 Represents the normal bind mode for the BIO.

#define BIO_BIND_REUSEADDR
 Represents the bind mode for reusing the address for the socket.

#define BIO_PRINT_HEX_REVERSE
 The BIO_print_hex() flag required for printing little-endian numbers. More...


Typedefs

typedef struct bio_st BIO
 The BIO object type identifier.

typedef long BIO_CB_FUNC_T (BIO *bio, int cmd, char *argp, int argi, long argl, long ret)
 Used for creating user-defined debugging routines or surrender functions. More...

typedef long R_BIO_CB_FUNC_T (BIO *bio, int cmd, char *argp, int argi, long argl, long ret)
 Deprecated name for the BIO callback type.

typedef int BIO_STATE_CB_FUNC_T (BIO *bio, int type, int state, int ret, int flag, char *cb_arg)
 The type of callback function that reports on the BIO state. More...

typedef struct bio_state_cb_st BIO_STATE_CB
 The type used to hold the state callback and its user-defined argument for transportation.

typedef struct bio_init_st BIO_INIT
 This structure stores the data that is required to perform initialization on a new BIO that was created from the resource list.

typedef struct bio_method_st BIO_METHOD
 This structure stores pointers to functions that implement the BIO methods. More...


Functions

long * BIO_set_conn_hostname (BIO *bio, char *name)
 Sets the host name value name for the connection BIO bio when using a UDP or TCP-based BIO. More...

long * BIO_set_conn_port (BIO *bio, char *port)
 Sets the port value port for the connection BIO bio. More...

long * BIO_set_conn_ip (BIO *bio, char *ip)
 Sets the IP address value ip for the connection BIO bio. More...

long * BIO_set_conn_int_port (BIO *bio, int port)
 Sets the port value port for the connection BIO bio. More...

char * BIO_get_conn_hostname (BIO *bio)
 Returns a pointer to the host name for the connection BIO bio. More...

char * BIO_get_conn_port (BIO *bio)
 Returns the port value for the connection BIO bio as a string. More...

char * BIO_get_conn_ip (BIO *bio)
 Returns the IP address for the connection BIO bio. More...

long BIO_get_conn_int_port (BIO *bio, char *portp)
 Returns the port number for the connection BIO bio. More...

long BIO_set_nbio (BIO *bio, int nb_flag)
 Sets to blocking or non-blocking I/O of the underlying connection BIO bio. More...

char * BIO_set_accept_port (BIO *bio, char *name)
 Sets the port information for the accept socket of the server. More...

long BIO_set_nbio_accept (BIO *accept_bio, int nb_flag)
 Sets to blocking or non-blocking I/O of the underlying connection BIO bio. More...

long BIO_set_accept_bios (BIO *accept_bio, BIO *template_bio)
 Sets the template BIO template_bio that is automatically duplicated when a successful connection occurs on accept_bio. More...

long BIO_set_bind_mode (BIO *bio, int mode)
 Sets the relevant TCP/IP flag allowing a socket to be re-bound. More...

long BIO_get_bind_mode (BIO *bio)
 Returns the relevant TCP/IP flag for the BIO bio indicating whether a socket can be re-bound. More...

int BIO_do_connect (BIO *bio)
 Sets up a client side connection socket on the connect BIO bio. More...

int BIO_do_accept (BIO *bio)
 Sets up a service side socket that accepts an incoming socket connection on the accept BIO bio. More...

int BIO_do_handshake (BIO *bio)
 Attempts to perform the next state in a BIO handshake for BIOs containing state engines. More...

long BIO_set_fd (BIO *bio, int fd, int close_flag)
 Sets the read file descriptor fd to be associated with the BIO bio. More...

long BIO_get_fd (BIO *bio, char *fd)
 Retrieves the read file descriptor fd associated with the BIO bio. More...

int BIO_seek (BIO *bio, long offset)
 Moves the current position in the BIO bio. More...

int BIO_tell (BIO *bio)
 Retrieves the current position in the BIO bio. More...

long BIO_read_filename (BIO *bio, char *name)
 Opens the file name name for reading on the BIO bio. More...

long BIO_write_filename (BIO *bio, char *name)
 Opens the file name name for writing on the BIO bio. More...

long BIO_append_filename (BIO *bio, char *name)
 Opens the file name name for writing on the BIO bio after End-of-File (EOF). More...

long BIO_rw_filename (BIO *bio, char *name)
 Opens the file name name on the BIO bio for both reading and writing. More...

long BIO_set_ssl (BIO *bio, SSL *ssl, int close_flag)
 Sets the SSL structure ssl for the BIO bio. More...

long BIO_get_ssl (BIO *bio, SSL **sslp)
 Returns the SSL structure for the SSL BIO bio. More...

long BIO_set_ssl_mode (BIO *bio, int client)
 Sets the connection state client of the SSL for the BIO bio. More...

int BIO_set_ssl_renegotiate_bytes (BIO *bio, int num)
 Sets the number of Bytes that are sent between renegotiations for the SSL BIO bio. More...

int BIO_set_ssl_renegotiate_timeout (BIO *bio, int seconds)
 Sets the renegotiation period for the SSL BIO bio. More...

int BIO_reset (BIO *bio)
 Resets the BIO bio to its initial state. More...

int BIO_set_close (BIO *bio, long mode)
 Sets the close mode for the BIO bio. More...

int BIO_get_close (BIO *bio)
 Returns the close flag for the BIO bio. More...

int BIO_pending (BIO *bio)
 Indicates that additional buffered data is available internally for the application to read from the BIO bio. More...

int BIO_flush (BIO *bio)
 Flushes any data stored in any output buffers of the BIO stack bio. More...

BIO_METHODBIO_s_file ()
 Returns a reference to the static BIO_METHOD used by a file source sink BIO. More...

BIOBIO_new_file (char *filename, char *mode)
 Creates a file BIO descriptor filename with a file opening mode of mode. More...

BIOBIO_new_fp (FILE *stream, int close_flag)
 Creates a new file BIO descriptor file pointer. More...

BIOBIO_new (BIO_METHOD *method)
 Creates a new BIO and associates the method type against the structure. More...

int BIO_free (BIO *bio)
 Frees the BIO bio. More...

void BIO_free_all (BIO *bio)
 Frees all BIOs in the BIO stack bio. More...

int BIO_read (BIO *bio, char *out, int outl)
 Reads data through the BIO bio. More...

int BIO_gets (BIO *bio, char *in, int inl)
 Reads a string from the BIO bio into the specified buffer in. More...

int BIO_write (BIO *bio, char *in, int inl)
 Writes data through the BIO bio. More...

int BIO_puts (BIO *bio, char *in)
 Writes the NULL terminated string contained in in to the BIO bio. More...

long BIO_ctrl (BIO *bio, int cmd, long larg, char *parg)
 Provides the replaceable point for all implementation-specific behavior for the I/O. More...

BIOBIO_push (BIO *bio, BIO *stack)
 Pushes the BIO bio onto the existing BIO stack and returns a pointer to the new stack. More...

BIOBIO_pop (BIO *bio)
 Pops the uppermost BIO bio from the BIO stack and returns the remaining BIO stack. More...

BIOBIO_find_type (BIO *bio, int type)
 Returns a BIO from the stack bio with a specified type. More...

BIOBIO_get_retry_BIO (BIO *bio, int *reason)
 Walks the BIO stack bio and returns the first BIO found that has a retry error set and the reason why the operation should be retried. More...

BIOBIO_dup_chain (BIO *in)
 Iterates down the BIO stack bio and creates a new copy of each BIO. More...

long MS_CALLBACK BIO_debug_cb (BIO *bio, int cmd, char *argp, int argi, long argl, long ret)
 Sets a prepared callback for the BIO structure bio to output debug information via BIO_set_cb(). More...

BIO_METHODBIO_s_mem ()
 Returns a reference to the static BIO_METHOD used by a memory source sink BIO. More...

BIO_METHODBIO_s_null ()
 Returns a reference to the static BIO_METHOD used by a NULL source sink BIO. More...

BIO_METHODBIO_s_socket ()
 Returns the BIO_METHOD for the socket. More...

BIO_METHODBIO_s_connect ()
 Returns the BIO_METHOD for the connect socket. More...

BIO_METHODBIO_s_accept ()
 Returns the BIO_METHOD for the accept socket. More...

BIO_METHODBIO_s_fd ()
 Returns the BIO_METHOD for a file descriptor. More...

BIO_METHODBIO_f_buffer ()
 Returns a reference to the static BIO_METHOD used by a buffer filter BIO. More...

int BIO_dump (BIO *bio, unsigned char *bytes, int len)
 Dumps the contents of binary data buffer bytes to the BIO structure bio in hexadecimal and ASCII form, removing any trailing spaces or NULL characters. More...

int BIO_dump_format (BIO *bio, unsigned char *data, int len, int format, int separator, int indent, int wrap)
 Specifies the format for dumping the contents of the BIO structure bio. More...

BIOBIO_new_mem ()
 Creates a memory BIO where all read and write operations refer to an internal memory buffer. More...

BIOBIO_new_socket (SIO_SOCK fd, int close_flag)
 Creates a socket BIO for a socket file descriptor fd where all read and write operations refer to the socket. More...

BIOBIO_new_fd (int fd, int close_flag)
 Creates a new BIO for a file descriptor fd where all read and write operations refer to fd. More...

BIOBIO_new_connect (char *host_port)
 Creates a new BIO for use by other BIO functions when connecting to remote machines via TCP. More...

BIOBIO_new_accept (char *host_port)
 Creates a new accept BIO which listens on the TCP port host_port. More...

void BIO_copy_next_retry (BIO *bio)
 Copies the retry flags and reason from the next BIO in the BIO stack to this BIO bio in order to propagate the retry values up one element in the BIO stack. More...

void BIO_reference_inc (BIO *bio)
 Increments the reference count for the BIO bio. More...

void BIO_set_flags (BIO *bio, int f)
 Sets the flags indicating the current state of the BIO bio. More...

int BIO_get_flags (BIO *bio)
 Returns the flags indicating the current state of the BIO bio. More...

void BIO_set_retry_special (BIO *bio)
 Sets the retry flag and the mode of retry to BIO_FLAGS_IO_SPECIAL for the connection BIO bio. More...

void BIO_set_retry_read (BIO *bio)
 Sets the retry flag and the mode of retry to BIO_FLAGS_READ for the connection BIO bio. More...

void BIO_set_retry_write (BIO *bio)
 Sets the retry flag and the mode of retry to BIO_FLAGS_WRITE for the connection BIO bio. More...

void BIO_clear_retry_flags (BIO *bio)
 Clears the flags field for BIO_FLAGS_RWS and BIO_FLAGS_SHOULD_RETRY for the BIO bio. More...

int BIO_get_retry_flags (BIO *bio)
 Retrieves the settings from the retry flags field for the BIO bio. More...

int BIO_should_read (BIO *bio)
 Indicates whether the last read operation should be retried for the BIO bio. More...

int BIO_should_write (BIO *bio)
 Indicates whether the last write operation should be retried for the BIO bio. More...

int BIO_should_io_special (BIO *bio)
 Indicates a BIO-specific retry reason caused the transitory error for the BIO bio. More...

int BIO_retry_type (BIO *bio)
 Returns the setting corresponding to the BIO_FLAGS_RWS flag for the BIO bio and indicates of the type of retry required. More...

int BIO_should_retry (BIO *bio)
 Indicates whether the last I/O operation (read or write) should be retried for the BIO bio. More...

int BIO_get_retry_reason (BIO *bio)
 Returns the settings from the retry reason field for the BIO bio. More...

char* BIO_method_name (BIO *bio)
 Returns the name field for the method structure for the BIO bio. More...

int BIO_method_type (BIO *bio)
 Returns the numeric type of the method structure for the BIO bio. More...

void BIO_set_cb (BIO *bio, BIO_CB_FUNC_T *cb)
 Sets a user-defined callback for the BIO bio. More...

void BIO_set_cb_arg (BIO *bio, char *arg)
 Sets an extra user-defined argument against the BIO bio that developers may use in the callback. More...

void BIO_set_bio_cb (BIO *bio, BIO_CB_FUNC_T *cb, char *arg)
 Sets the BIO callback and an argument against the BIO bio. More...

char* BIO_get_cb_arg (BIO *bio)
 Returns a pointer to the user-defined data for the user-defined callback that exists within the BIO bio. More...

BIO_CB_FUNC_TBIO_get_cb (BIO *bio)
 Returns the user-defined callback function for the BIO bio if a callback function is defined. More...

int BIO_open_file (BIO *bio, char *name, char *mode)
 Opens the file name with a file opening mode of mode. More...

int BIO_get_current_session (BIO *bio, BIO **active)
 Returns the current session for the BIO running over a Multiplexed connection. More...

int BIO_set_current_session (BIO *bio, BIO *active)
 Sets the current session for the BIO running over a Multiplexed connection. More...

int BIO_delete_current_session (BIO *bio, BIO *active)
 Deletes the current active session active from the session list. More...

int BIO_print_hex (BIO *bio, unsigned char *bytes, int len, int flags)
 Prints an array of Bytes in hexadecimal format to the BIO bio. More...

int BIO_printf (BIO *bio,...)
 Provides the equivalent of the standard C run time printf function where the output is directed to the BIO structure bio with a format string. More...


Copyright (c) 1999-2004 RSA Security Inc. All rights reserved. 050-001001-2600-000-000 - 2.6