keyhole logo

Heimdal Kerberos 5 storage functions


Functions

krb5_boolean KRB5_LIB_FUNCTION krb5_storage_is_flags (krb5_storage *sp, krb5_flags flags)
void KRB5_LIB_FUNCTION krb5_storage_set_byteorder (krb5_storage *sp, krb5_flags byteorder)
krb5_flags KRB5_LIB_FUNCTION krb5_storage_get_byteorder (krb5_storage *sp)
off_t KRB5_LIB_FUNCTION krb5_storage_seek (krb5_storage *sp, off_t offset, int whence)
int KRB5_LIB_FUNCTION krb5_storage_truncate (krb5_storage *sp, off_t offset)
krb5_ssize_t KRB5_LIB_FUNCTION krb5_storage_read (krb5_storage *sp, void *buf, size_t len)
krb5_ssize_t KRB5_LIB_FUNCTION krb5_storage_write (krb5_storage *sp, const void *buf, size_t len)
void KRB5_LIB_FUNCTION krb5_storage_set_eof_code (krb5_storage *sp, int code)
int KRB5_LIB_FUNCTION krb5_storage_get_eof_code (krb5_storage *sp)
krb5_error_code KRB5_LIB_FUNCTION krb5_storage_free (krb5_storage *sp)
krb5_error_code KRB5_LIB_FUNCTION krb5_storage_to_data (krb5_storage *sp, krb5_data *data)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_int32 (krb5_storage *sp, int32_t value)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_uint32 (krb5_storage *sp, uint32_t value)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_int16 (krb5_storage *sp, int16_t value)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_uint16 (krb5_storage *sp, uint16_t value)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_int8 (krb5_storage *sp, int8_t value)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_uint8 (krb5_storage *sp, uint8_t value)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_data (krb5_storage *sp, krb5_data data)
krb5_error_code KRB5_LIB_FUNCTION krb5_ret_data (krb5_storage *sp, krb5_data *data)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_keyblock (krb5_storage *sp, krb5_keyblock p)
krb5_error_code KRB5_LIB_FUNCTION krb5_ret_keyblock (krb5_storage *sp, krb5_keyblock *p)
krb5_error_code KRB5_LIB_FUNCTION krb5_store_times (krb5_storage *sp, krb5_times times)
krb5_error_code KRB5_LIB_FUNCTION krb5_ret_times (krb5_storage *sp, krb5_times *times)
krb5_storage *KRB5_LIB_FUNCTION krb5_storage_emem (void)
krb5_storage *KRB5_LIB_FUNCTION krb5_storage_from_fd (int fd)
krb5_storage *KRB5_LIB_FUNCTION krb5_storage_from_mem (void *buf, size_t len)
krb5_storage *KRB5_LIB_FUNCTION krb5_storage_from_data (krb5_data *data)
krb5_storage *KRB5_LIB_FUNCTION krb5_storage_from_readonly_mem (const void *buf, size_t len)

Detailed Description


Function Documentation

krb5_error_code KRB5_LIB_FUNCTION krb5_ret_data ( krb5_storage *  sp,
krb5_data *  data 
)

Parse a data from the storage.

Parameters:
sp the storage buffer to read from
data the parsed data
Returns:
0 on success, a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_ret_keyblock ( krb5_storage *  sp,
krb5_keyblock *  p 
)

Read a keyblock from the storage.

Parameters:
sp the storage buffer to write to
p the keyblock read from storage, free using krb5_free_keyblock()
Returns:
0 on success, a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_ret_times ( krb5_storage *  sp,
krb5_times *  times 
)

Read a times block from the storage.

Parameters:
sp the storage buffer to write to
times the times block read from storage
Returns:
0 on success, a Kerberos 5 error code on failure.

krb5_storage* KRB5_LIB_FUNCTION krb5_storage_emem ( void   ) 

Create a elastic (allocating) memory storage backend. Memory is allocated on demand. Free returned krb5_storage with krb5_storage_free().

Returns:
A krb5_storage on success, or NULL on out of memory error.
See also:
krb5_storage_from_mem()

krb5_storage_from_readonly_mem()

krb5_storage_from_fd()

krb5_storage_from_data()

krb5_error_code KRB5_LIB_FUNCTION krb5_storage_free ( krb5_storage *  sp  ) 

Free a krb5 storage.

Parameters:
sp the storage to free.
Returns:
An Kerberos 5 error code.

krb5_storage* KRB5_LIB_FUNCTION krb5_storage_from_data ( krb5_data *  data  ) 

Returns:
A krb5_storage on success, or NULL on out of memory error.
See also:
krb5_storage_mem()

krb5_storage_from_mem()

krb5_storage_from_readonly_mem()

krb5_storage_from_fd()

krb5_storage* KRB5_LIB_FUNCTION krb5_storage_from_fd ( int  fd  ) 

Returns:
A krb5_storage on success, or NULL on out of memory error.
See also:
krb5_storage_emem()

krb5_storage_from_mem()

krb5_storage_from_readonly_mem()

krb5_storage_from_data()

krb5_storage* KRB5_LIB_FUNCTION krb5_storage_from_mem ( void *  buf,
size_t  len 
)

Returns:
A krb5_storage on success, or NULL on out of memory error.
See also:
krb5_storage_mem()

krb5_storage_from_readonly_mem()

krb5_storage_from_data()

krb5_storage_from_fd()

krb5_storage* KRB5_LIB_FUNCTION krb5_storage_from_readonly_mem ( const void *  buf,
size_t  len 
)

Returns:
A krb5_storage on success, or NULL on out of memory error.
See also:
krb5_storage_mem()

krb5_storage_from_mem()

krb5_storage_from_data()

krb5_storage_from_fd()

krb5_flags KRB5_LIB_FUNCTION krb5_storage_get_byteorder ( krb5_storage *  sp  ) 

Return the current byteorder for the buffer. See krb5_storage_set_byteorder() for the list or byte order contants.

int KRB5_LIB_FUNCTION krb5_storage_get_eof_code ( krb5_storage *  sp  ) 

Get the return code that will be used when end of storage is reached.

Parameters:
sp the storage
Returns:
storage error code

krb5_boolean KRB5_LIB_FUNCTION krb5_storage_is_flags ( krb5_storage *  sp,
krb5_flags  flags 
)

Return true or false depending on if the storage flags is set or not. NB testing for the flag 0 always return true.

Parameters:
sp the storage buffer to check flags on
flags The flags to test for
Returns:
true if all the flags are set, false if not.

krb5_ssize_t KRB5_LIB_FUNCTION krb5_storage_read ( krb5_storage *  sp,
void *  buf,
size_t  len 
)

Read to the storage buffer.

Parameters:
sp the storage buffer to read from
buf the buffer to store the data in
len the length to read
Returns:
The length of data read (can be shorter then len), or negative on error.

off_t KRB5_LIB_FUNCTION krb5_storage_seek ( krb5_storage *  sp,
off_t  offset,
int  whence 
)

Seek to a new offset.

Parameters:
sp the storage buffer to seek in.
offset the offset to seek
whence relateive searching, SEEK_CUR from the current position, SEEK_END from the end, SEEK_SET absolute from the start.
Returns:
The new current offset

void KRB5_LIB_FUNCTION krb5_storage_set_byteorder ( krb5_storage *  sp,
krb5_flags  byteorder 
)

Set the new byte order of the storage buffer.

Parameters:
sp the storage buffer to set the byte order for.
byteorder the new byte order.
The byte order are: KRB5_STORAGE_BYTEORDER_BE, KRB5_STORAGE_BYTEORDER_LE and KRB5_STORAGE_BYTEORDER_HOST.

void KRB5_LIB_FUNCTION krb5_storage_set_eof_code ( krb5_storage *  sp,
int  code 
)

Set the return code that will be used when end of storage is reached.

Parameters:
sp the storage
code the error code to return on end of storage

krb5_error_code KRB5_LIB_FUNCTION krb5_storage_to_data ( krb5_storage *  sp,
krb5_data *  data 
)

Copy the contnent of storage

Parameters:
sp the storage to copy to a data
data the copied data, free with krb5_data_free()
Returns:
0 for success, or a Kerberos 5 error code on failure.

int KRB5_LIB_FUNCTION krb5_storage_truncate ( krb5_storage *  sp,
off_t  offset 
)

Truncate the storage buffer in sp to offset.

Parameters:
sp the storage buffer to truncate.
offset the offset to truncate too.
Returns:
An Kerberos 5 error code.

krb5_ssize_t KRB5_LIB_FUNCTION krb5_storage_write ( krb5_storage *  sp,
const void *  buf,
size_t  len 
)

Write to the storage buffer.

Parameters:
sp the storage buffer to write to
buf the buffer to write to the storage buffer
len the length to write
Returns:
The length of data written (can be shorter then len), or negative on error.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_data ( krb5_storage *  sp,
krb5_data  data 
)

Store a data to the storage.

Parameters:
sp the storage buffer to write to
data the buffer to store.
Returns:
0 on success, a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_int16 ( krb5_storage *  sp,
int16_t  value 
)

Store a int16 to storage, byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder().

Parameters:
sp the storage to write too
value the value to store
Returns:
0 for success, or a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_int32 ( krb5_storage *  sp,
int32_t  value 
)

Store a int32 to storage, byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder().

Parameters:
sp the storage to write too
value the value to store
Returns:
0 for success, or a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_int8 ( krb5_storage *  sp,
int8_t  value 
)

Store a int8 to storage.

Parameters:
sp the storage to write too
value the value to store
Returns:
0 for success, or a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_keyblock ( krb5_storage *  sp,
krb5_keyblock  p 
)

Store a keyblock to the storage.

Parameters:
sp the storage buffer to write to
p the keyblock to write
Returns:
0 on success, a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_times ( krb5_storage *  sp,
krb5_times  times 
)

Write a times block to storage.

Parameters:
sp the storage buffer to write to
times the times block to write.
Returns:
0 on success, a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_uint16 ( krb5_storage *  sp,
uint16_t  value 
)

Store a uint16 to storage, byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder().

Parameters:
sp the storage to write too
value the value to store
Returns:
0 for success, or a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_uint32 ( krb5_storage *  sp,
uint32_t  value 
)

Store a uint32 to storage, byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder().

Parameters:
sp the storage to write too
value the value to store
Returns:
0 for success, or a Kerberos 5 error code on failure.

krb5_error_code KRB5_LIB_FUNCTION krb5_store_uint8 ( krb5_storage *  sp,
uint8_t  value 
)

Store a uint8 to storage.

Parameters:
sp the storage to write too
value the value to store
Returns:
0 for success, or a Kerberos 5 error code on failure.


Generated on Thu Aug 13 09:38:34 2009 for HeimdalKerberos5library by doxygen 1.5.6