common components for the implementation the different set operations More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_applications.h"
#include "gnunet_core_service.h"
#include "gnunet_cadet_service.h"
#include "gnunet_set_service.h"
#include "set.h"
Go to the source code of this file.
Data Structures | |
struct | SetVT |
Dispatch table for a specific set operation. More... | |
struct | MutationEvent |
MutationEvent gives information about changes to an element (removal / addition) in a set content. More... | |
struct | ElementEntry |
Information about an element element in the set. More... | |
struct | ClientState |
State we keep per client. More... | |
struct | Operation |
Operation context used to execute a set operation. More... | |
struct | SetContent |
SetContent stores the actual set elements, which may be shared by multiple generations derived from one set. More... | |
struct | GenerationRange |
struct | PendingMutation |
Information about a mutation to apply to a set. More... | |
struct | Set |
A set that supports a specific operation with other peers. More... | |
Typedefs | |
typedef struct SetState *(* | SetCreateImpl) (void) |
Signature of functions that create the implementation-specific state for a set supporting a specific operation. More... | |
typedef void(* | SetAddRemoveImpl) (struct SetState *state, struct ElementEntry *ee) |
Signature of functions that implement the add/remove functionality for a set supporting a specific operation. More... | |
typedef struct SetState *(* | SetCopyStateImpl) (struct SetState *state) |
Make a copy of a set's internal state. More... | |
typedef void(* | SetDestroyImpl) (struct SetState *state) |
Signature of functions that implement the destruction of the implementation-specific set state. More... | |
typedef struct OperationState *(* | OpAcceptImpl) (struct Operation *op) |
Signature of functions that implement accepting a set operation. More... | |
typedef struct OperationState *(* | OpEvaluateImpl) (struct Operation *op, const struct GNUNET_MessageHeader *opaque_context) |
Signature of functions that implement starting the evaluation of set operations. More... | |
typedef void(* | OpCancelImpl) (struct Operation *op) |
Signature of functions that implement operation cancellation. More... | |
typedef void(* | OpChannelDeathImpl) (struct Operation *op) |
Signature of functions called when the CADET channel died. More... | |
Functions | |
void | _GSS_operation_destroy (struct Operation *op, int gc) |
Destroy the given operation. More... | |
void | _GSS_operation_destroy2 (struct Operation *op) |
This function probably should not exist and be replaced by inlining more specific logic in the various places where it is called. More... | |
const struct SetVT * | _GSS_union_vt (void) |
Get the table with implementing functions for set union. More... | |
const struct SetVT * | _GSS_intersection_vt (void) |
Get the table with implementing functions for set intersection. More... | |
int | _GSS_is_element_of_operation (struct ElementEntry *ee, struct Operation *op) |
Is element ee part of the set used by op? More... | |
Variables | |
struct GNUNET_STATISTICS_Handle * | _GSS_statistics |
Statistics handle. More... | |
common components for the implementation the different set operations
Definition in file gnunet-service-set.h.
typedef struct SetState *(* SetCreateImpl) (void) |
Signature of functions that create the implementation-specific state for a set supporting a specific operation.
Definition at line 1 of file gnunet-service-set.h.
typedef void(* SetAddRemoveImpl) (struct SetState *state, struct ElementEntry *ee) |
Signature of functions that implement the add/remove functionality for a set supporting a specific operation.
set | implementation-specific set state |
ee | element message from the client |
Definition at line 87 of file gnunet-service-set.h.
Make a copy of a set's internal state.
state | set state to copy |
Definition at line 87 of file gnunet-service-set.h.
Signature of functions that implement the destruction of the implementation-specific set state.
state | the set state, contains implementation-specific data |
Definition at line 108 of file gnunet-service-set.h.
typedef struct OperationState *(* OpAcceptImpl) (struct Operation *op) |
Signature of functions that implement accepting a set operation.
op | operation that is created by accepting the operation, should be initialized by the implementation |
Definition at line 108 of file gnunet-service-set.h.
typedef struct OperationState *(* OpEvaluateImpl) (struct Operation *op, const struct GNUNET_MessageHeader *opaque_context) |
Signature of functions that implement starting the evaluation of set operations.
op | operation that is created, should be initialized to begin the evaluation |
opaque_context | message to be transmitted to the listener to convince it to accept, may be NULL |
Definition at line 108 of file gnunet-service-set.h.
Signature of functions that implement operation cancellation.
This includes notifying the client about the operation's final state.
op | operation state |
Definition at line 144 of file gnunet-service-set.h.
Signature of functions called when the CADET channel died.
op | operation state |
Definition at line 153 of file gnunet-service-set.h.
void _GSS_operation_destroy | ( | struct Operation * | op, |
int | gc | ||
) |
Destroy the given operation.
Used for any operation where both peers were known and that thus actually had a vt and channel. Must not be used for operations where 'listener' is still set and we do not know the other peer.
Call the implementation-specific cancel function of the operation. Disconnects from the remote peer. Does not disconnect the client, as there may be multiple operations per set.
op | operation to destroy |
gc | GNUNET_YES to perform garbage collection on the set |
Definition at line 421 of file gnunet-service-set.c.
References SetVT::cancel, collect_generation_garbage(), GNUNET_assert, GNUNET_CADET_channel_destroy(), GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_YES, op, Set::ops_head, Set::ops_tail, and Set::vt.
Referenced by _GSS_operation_destroy2(), client_disconnect_cb(), fail_intersection_operation(), fail_union_operation(), handle_client_cancel(), intersection_channel_death(), send_client_done_and_destroy(), and union_channel_death().
void _GSS_operation_destroy2 | ( | struct Operation * | op | ) |
This function probably should not exist and be replaced by inlining more specific logic in the various places where it is called.
Definition at line 1152 of file gnunet-service-set.c.
References _GSS_operation_destroy(), GNUNET_CADET_channel_destroy(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_log, GNUNET_YES, incoming_destroy(), and op.
Referenced by channel_end_cb(), handle_client_reject(), handle_union_p2p_full_done(), incoming_destroy(), and maybe_finish().
const struct SetVT * _GSS_union_vt | ( | void | ) |
Get the table with implementing functions for set union.
Definition at line 2448 of file gnunet-service-set_union.c.
References SetVT::create, union_accept(), union_add(), union_channel_death(), union_copy_state(), union_evaluate(), union_op_cancel(), union_remove(), union_set_create(), and union_set_destroy().
Referenced by handle_client_copy_lazy_connect(), and handle_client_create_set().
const struct SetVT * _GSS_intersection_vt | ( | void | ) |
Get the table with implementing functions for set intersection.
Definition at line 1310 of file gnunet-service-set_intersection.c.
References SetVT::create, intersection_accept(), intersection_add(), intersection_channel_death(), intersection_evaluate(), intersection_op_cancel(), intersection_remove(), intersection_set_create(), and intersection_set_destroy().
Referenced by handle_client_copy_lazy_connect(), and handle_client_create_set().
int _GSS_is_element_of_operation | ( | struct ElementEntry * | ee, |
struct Operation * | op | ||
) |
Is element ee part of the set used by op?
ee | element to test |
op | operation the defines the set and its generation |
Definition at line 398 of file gnunet-service-set.c.
References is_element_of_generation(), and op.
Referenced by filtered_map_initialization(), handle_union_p2p_demand(), handle_union_p2p_offer(), init_key_to_element_iterator(), and initialize_map_unfiltered().
|
extern |
Statistics handle.
Definition at line 145 of file gnunet-service-set.c.
Referenced by decode_and_send(), fail_intersection_operation(), handle_union_p2p_demand(), handle_union_p2p_elements(), handle_union_p2p_full_element(), handle_union_p2p_strata_estimator(), run(), send_bloomfilter(), send_client_done(), send_client_done_and_destroy(), send_client_removed_element(), send_ibf(), shutdown_task(), union_accept(), and union_evaluate().