GNUnet 0.21.1
gnunet_set_service.h File Reference

Two-peer set operations. More...

Include dependency graph for gnunet_set_service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GNUNET_SET_Element
 Element stored in a set. More...
 
struct  GNUNET_SET_Option
 Option for set operations. More...
 

Macros

#define GNUNET_SET_CONTEXT_MESSAGE_MAX_SIZE   ((1 << 16) - 1024)
 Maximum size of a context message for set operation requests. More...
 

Typedefs

typedef void(* GNUNET_SET_Continuation) (void *cls)
 Continuation used for some of the set operations. More...
 
typedef void(* GNUNET_SET_ResultIterator) (void *cls, const struct GNUNET_SET_Element *element, uint64_t current_size, enum GNUNET_SET_Status status)
 Callback for set operation results. More...
 
typedef int(* GNUNET_SET_ElementIterator) (void *cls, const struct GNUNET_SET_Element *element)
 Iterator for set elements. More...
 
typedef void(* GNUNET_SET_ListenCallback) (void *cls, const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_MessageHeader *context_msg, struct GNUNET_SET_Request *request)
 Called when another peer wants to do a set operation with the local peer. More...
 
typedef void(* GNUNET_SET_CopyReadyCallback) (void *cls, struct GNUNET_SET_Handle *copy)
 

Enumerations

enum  GNUNET_SET_OperationType { GNUNET_SET_OPERATION_NONE , GNUNET_SET_OPERATION_INTERSECTION , GNUNET_SET_OPERATION_UNION }
 The operation that a set set supports. More...
 
enum  GNUNET_SET_Status {
  GNUNET_SET_STATUS_OK , GNUNET_SET_STATUS_ADD_LOCAL , GNUNET_SET_STATUS_ADD_REMOTE , GNUNET_SET_STATUS_FAILURE ,
  GNUNET_SET_STATUS_HALF_DONE , GNUNET_SET_STATUS_DONE
}
 Status for the result callback. More...
 
enum  GNUNET_SET_ResultMode { GNUNET_SET_RESULT_FULL , GNUNET_SET_RESULT_SYMMETRIC , GNUNET_SET_RESULT_REMOVED , GNUNET_SET_RESULT_ADDED }
 The way results are given to the client. More...
 
enum  GNUNET_SET_OptionType { GNUNET_SET_OPTION_END =0 , GNUNET_SET_OPTION_BYZANTINE =1 , GNUNET_SET_OPTION_FORCE_FULL =2 , GNUNET_SET_OPTION_FORCE_DELTA =4 }
 Possible options to pass to a set operation. More...
 

Functions

struct GNUNET_SET_HandleGNUNET_SET_create (const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_SET_OperationType op)
 Create an empty set, supporting the specified operation. More...
 
int GNUNET_SET_add_element (struct GNUNET_SET_Handle *set, const struct GNUNET_SET_Element *element, GNUNET_SET_Continuation cont, void *cont_cls)
 Add an element to the given set. More...
 
int GNUNET_SET_remove_element (struct GNUNET_SET_Handle *set, const struct GNUNET_SET_Element *element, GNUNET_SET_Continuation cont, void *cont_cls)
 Remove an element to the given set. More...
 
void GNUNET_SET_copy_lazy (struct GNUNET_SET_Handle *set, GNUNET_SET_CopyReadyCallback cb, void *cls)
 
void GNUNET_SET_destroy (struct GNUNET_SET_Handle *set)
 Destroy the set handle, and free all associated resources. More...
 
struct GNUNET_SET_OperationHandleGNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer, const struct GNUNET_HashCode *app_id, const struct GNUNET_MessageHeader *context_msg, enum GNUNET_SET_ResultMode result_mode, struct GNUNET_SET_Option options[], GNUNET_SET_ResultIterator result_cb, void *result_cls)
 Prepare a set operation to be evaluated with another peer. More...
 
struct GNUNET_SET_ListenHandleGNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_SET_OperationType op_type, const struct GNUNET_HashCode *app_id, GNUNET_SET_ListenCallback listen_cb, void *listen_cls)
 Wait for set operation requests for the given application ID. More...
 
void GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh)
 Cancel the given listen operation. More...
 
struct GNUNET_SET_OperationHandleGNUNET_SET_accept (struct GNUNET_SET_Request *request, enum GNUNET_SET_ResultMode result_mode, struct GNUNET_SET_Option options[], GNUNET_SET_ResultIterator result_cb, void *result_cls)
 Accept a request we got via GNUNET_SET_listen(). More...
 
int GNUNET_SET_commit (struct GNUNET_SET_OperationHandle *oh, struct GNUNET_SET_Handle *set)
 Commit a set to be used with a set operation. More...
 
void GNUNET_SET_operation_cancel (struct GNUNET_SET_OperationHandle *oh)
 Cancel the given set operation. More...
 
int GNUNET_SET_iterate (struct GNUNET_SET_Handle *set, GNUNET_SET_ElementIterator iter, void *iter_cls)
 Iterate over all elements in the given set. More...
 
void GNUNET_SET_iterate_cancel (struct GNUNET_SET_Handle *set)
 Stop iteration over all elements in the given set. More...
 
struct GNUNET_SET_ElementGNUNET_SET_element_dup (const struct GNUNET_SET_Element *element)
 Create a copy of an element. More...
 
void GNUNET_SET_element_hash (const struct GNUNET_SET_Element *element, struct GNUNET_HashCode *ret_hash)
 Hash a set element. More...
 

Detailed Description

Two-peer set operations.

Definition in file gnunet_set_service.h.