libsignal-protocol-c  master
signal_protocol_session_store Struct Reference

Public Attributes

int(* load_session_func )(signal_buffer **record, signal_buffer **user_record, const signal_protocol_address *address, void *user_data)
 
int(* get_sub_device_sessions_func )(signal_int_list **sessions, const char *name, size_t name_len, void *user_data)
 
int(* store_session_func )(const signal_protocol_address *address, uint8_t *record, size_t record_len, uint8_t *user_record, size_t user_record_len, void *user_data)
 
int(* contains_session_func )(const signal_protocol_address *address, void *user_data)
 
int(* delete_session_func )(const signal_protocol_address *address, void *user_data)
 
int(* delete_all_sessions_func )(const char *name, size_t name_len, void *user_data)
 
void(* destroy_func )(void *user_data)
 
void * user_data
 

Member Data Documentation

◆ contains_session_func

int(* signal_protocol_session_store::contains_session_func) (const signal_protocol_address *address, void *user_data)

Determine whether there is a committed session record for a recipient ID + device ID tuple.

Parameters
addressthe address of the remote client
Returns
1 if a session record exists, 0 otherwise.

◆ delete_all_sessions_func

int(* signal_protocol_session_store::delete_all_sessions_func) (const char *name, size_t name_len, void *user_data)

Remove the session records corresponding to all devices of a recipient ID.

Parameters
namethe name of the remote client
name_lenthe length of the name
Returns
the number of deleted sessions on success, negative on failure

◆ delete_session_func

int(* signal_protocol_session_store::delete_session_func) (const signal_protocol_address *address, void *user_data)

Remove a session record for a recipient ID + device ID tuple.

Parameters
addressthe address of the remote client
Returns
1 if a session was deleted, 0 if a session was not deleted, negative on error

◆ destroy_func

void(* signal_protocol_session_store::destroy_func) (void *user_data)

Function called to perform cleanup when the data store context is being destroyed.

◆ get_sub_device_sessions_func

int(* signal_protocol_session_store::get_sub_device_sessions_func) (signal_int_list **sessions, const char *name, size_t name_len, void *user_data)

Returns all known devices with active sessions for a recipient

Parameters
pointerto an array that will be allocated and populated with the result
namethe name of the remote client
name_lenthe length of the name
Returns
size of the sessions array, or negative on failure

◆ load_session_func

int(* signal_protocol_session_store::load_session_func) (signal_buffer **record, signal_buffer **user_record, const signal_protocol_address *address, void *user_data)

Returns a copy of the serialized session record corresponding to the provided recipient ID + device ID tuple.

Parameters
recordpointer to a freshly allocated buffer containing the serialized session record. Unset if no record was found. The Signal Protocol library is responsible for freeing this buffer.
user_recordpointer to a freshly allocated buffer containing application specific data stored alongside the serialized session record. If no such data exists, then this pointer may be left unset. The Signal Protocol library is responsible for freeing this buffer.
addressthe address of the remote client
Returns
1 if the session was loaded, 0 if the session was not found, negative on failure

◆ store_session_func

int(* signal_protocol_session_store::store_session_func) (const signal_protocol_address *address, uint8_t *record, size_t record_len, uint8_t *user_record, size_t user_record_len, void *user_data)

Commit to storage the session record for a given recipient ID + device ID tuple.

Parameters
addressthe address of the remote client
recordpointer to a buffer containing the serialized session record for the remote client
record_lenlength of the serialized session record
user_recordpointer to a buffer containing application specific data to be stored alongside the serialized session record for the remote client. If no such data exists, then this pointer will be null.
user_record_lenlength of the application specific data
Returns
0 on success, negative on failure

◆ user_data

void* signal_protocol_session_store::user_data

User data pointer


The documentation for this struct was generated from the following file: