Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

codec_t - codec funtions


Typedefs

typedef codec_gzip_s codec_gzip_t
typedef codec_null_s codec_null_t

Functions

int codec_cipher_create (int op, const EVP_CIPHER *cipher, unsigned char *key, unsigned char *iv, codec_t **pcc)
 Create a cipher codec_t object.
int codec_free (codec_t *codec)
 Dispose all the resources allocated to the supplied codec.
int codec_gzip_create (int op, codec_t **piz)
 Create a cipher codec_t object.
int codec_null_create (codec_t **pcn)
 Create a cipher codec_t object.

Typedef Documentation

typedef struct codec_gzip_s codec_gzip_t
 

Definition at line 35 of file gzip.c.

Referenced by codec_gzip_create().

typedef struct codec_null_s codec_null_t
 

Definition at line 27 of file null.c.

Referenced by codec_null_create().


Function Documentation

int codec_cipher_create int  op,
const EVP_CIPHER *  cipher,
unsigned char *  key,
unsigned char *  iv,
codec_t **  pcc
 

Create a cipher codec_t object at *pcc suitable for encryption or decryption (depending on op). The cipher, key and iv parameters hold the algorithm, key and initialisation vector respectively, used for the data transforms.

Parameters:
op one of CIPHER_ENCRYPT or CIPHER_DECRYPT
cipher an OpenSSL EVP_CIPHER object
key the encryption/decryption key
iv the initialisation vector
pcc the created codec as a value-result arguement
Returns:
0 on success, ~0 otherwise

Definition at line 172 of file cipher.c.

References codec_s::cbuf, CODEC_CIPHER_MAX_INPUT, codec_cipher_t, codec_t, codec_s::flush, codec_s::free, and codec_s::transform.

Referenced by session_prv_load_from_io(), session_prv_save_to_io(), and translate().

int codec_free codec_t codec  ) 
 

Dispose all the resources allocated to the supplied codec

Parameters:
codec the codec_t object to be disposed
Returns:
always successful, i.e. 0

Definition at line 28 of file codec.c.

References codec_t, and codec_s::free.

Referenced by emb_open(), io_codecs_remove(), session_prv_load_from_io(), session_prv_save_to_io(), and translate().

int codec_gzip_create int  op,
codec_t **  piz
 

Create a gzip codec_t object at *piz suitable for compression or decompression (depending on op).

Parameters:
op one of GZIP_COMPRESS or GZIP_UNCOMPRESS
piz the created codec as a value-result arguement
Returns:
0 on success, ~0 otherwise

Definition at line 142 of file gzip.c.

References codec_gzip_t, codec_t, codec_s::flush, codec_s::free, GZIP_COMPRESS, GZIP_UNCOMPRESS, and codec_s::transform.

Referenced by emb_open(), session_prv_load_from_io(), session_prv_save_to_io(), and translate().

int codec_null_create codec_t **  pcn  ) 
 

Create a null codec_t object at *pcn.

Parameters:
pcn the created codec as a value-result arguement
Returns:
0 on success, ~0 otherwise

Definition at line 74 of file null.c.

References codec_null_t, and codec_t.


←Products
© 2005-2006 - KoanLogic S.r.l. - All rights reserved